[NTG-context] Re: applying style to frame content

2024-05-14 Thread Wolfgang Schuster
] \starttexdefinition spaces protected Mystyle #1 \startMPcode picture tt ; tt:= lmt_outline [ kind = "path", text = "\Myframe{#1}", ]; fill for i within tt : pathpart i && endfor cycle withshademethod "linear" withshadedirect

[NTG-context] applying style to frame content

2024-05-14 Thread seyal . zavira
Hi all, what is the better way to apply a metapost effect to a piece of any structure text for example when defining footnotes, frames , etc. i use this method for frames: this is my MWE: \defineframed[Myframe][frame=off] \starttexdefinition spaces protected Mystyle #1 \startMPcode

[NTG-context] Re: how to apply metapost effects to section title?

2024-04-09 Thread Wolfgang Schuster
\stopMyhead \stoptext You can't use commands with parameters as argument for the style key. To format single parts (number or title) of a section title you have to apply a command to the "deep...command" key but even then you have to make manual changes to the vertical alignment of th

[NTG-context] Re: Adjusted Chapter Headings

2024-03-19 Thread Wolfgang Schuster
ter number in the frame (inside the frame is vertically centered, the title not). Is there a way to align the chapter title with the chapter number? \starttexdefinition MyNumberChapterCommand #1     \inframed[frame=off,rightframe=on,framecolor=black,      rulethickness=1px,height=30pt]{

[NTG-context] Re: Adjusted Chapter Headings

2024-03-19 Thread Jeroen
vertical separator was introduced with an > inframe. The chapter title at the right side does not vertically align > properly with the chapter number in the frame (inside the frame is > vertically centered, the title not). Is there a way to align the chapter > title with the chapter number? > >

[NTG-context] Re: Adjusted Chapter Headings

2024-03-19 Thread Hraban Ramm
vertically align properly with the chapter number in the frame (inside the frame is vertically centered, the title not). Is there a way to align the chapter title with the chapter number? \starttexdefinition MyNumberChapterCommand #1     \inframed[frame=off,rightframe=on,framec

[NTG-context] Adjusted Chapter Headings

2024-03-19 Thread Jeroen
vertically centered, the title not). Is there a way to align the chapter title with the chapter number? \starttexdefinition MyNumberChapterCommand #1 \inframed[frame=off,rightframe=on,framecolor=black, rulethickness=1px,height=30pt]{#1\enspace} \stoptexdefinition \setuphead[chapter][s

[NTG-context] Re: \intertext and highlighting with \alignhere/\breakhere

2024-03-12 Thread Hans Hagen
managed to find a "solution" for this, although I'd prefer something a bit less hacky. Any ideas? Also, is there a way to highlight an equation across an \alignhere? Once again, I've found a "solution", but like before, it's pretty hacky. Example files are attached. maybe

[NTG-context] \intertext and highlighting with \alignhere/\breakhere

2024-03-12 Thread Max Chernoff
ad[section][page=yes] \unprotect \newbox\intertext_tmp_box \newdimen\intertext_tmp_dimen \starttexdefinition protected newintertext #1 \texthere[left]{ \setbox\intertext_tmp_box=\hbox{ \startframedtext[ offset=none, width=\hsize,

[NTG-context] Re: XML processing, unwanted indentation/alignment

2024-02-15 Thread Wolfgang Schuster
ts. To avoid problems with existing commands it is good practice to use camelcase for your own commands. begin example \starttexdefinition Name #1 \ifxmlattempty{#1}{first_name} \xmlatt{#1}{initials} \else \xmlatt{#1}{initials}, \xmlatt{#1}{first_name} \fi \ifxmla

[NTG-context] Re: APA 7 and https

2023-12-17 Thread Oliver Marugg
t; rauricast...@gmail.com wrote: > >> Hi >> >> I found a solution to reach APA7 list and links. >> >> Using >> $PATH/ConTeXtPATH/tex/texmf-context/tex/context/base/mkiv/publ-imp-apa.mkvi >> in line 1306-1312, where \starttexd

[NTG-context] Re: APA 7 and https

2023-12-16 Thread Alan Braslau via ntg-context
> in line 1306-1312, where \starttexdefinition mutable protected > btx:apa:doi \texdefinition {btx:format:goto} { > url(https://doi.org/\btxflush{doi}) > } { >\hyphenatedurl{https://\btxflush{doi}} > } > \stoptexdefinition > > Change: > url(http://dx.

[NTG-context] Re: APA 7 and https

2023-12-15 Thread rauricastone
Sorry I missed to add doi.org at hyphenatedurl, now the whole block shows: \starttexdefinition mutable protected btx:apa:doi \texdefinition {btx:format:goto} { url(https://doi.org/\btxflush{doi}) } { \hyphenatedurl{https://doi.org/\btxflush{doi}} } \stoptexdefinition

[NTG-context] Re: APA 7 and https

2023-12-15 Thread rauricastone
Hi I found a solution to reach APA7 list and links. Using $PATH/ConTeXtPATH/tex/texmf-context/tex/context/base/mkiv/publ-imp-apa.mkvi in line 1306-1312, where \starttexdefinition mutable protected btx:apa:doi \texdefinition {btx:format:goto} { url(https://doi.org/\btxflush{doi

[NTG-context] Re: Using structureuservariables before the heading

2023-09-14 Thread Wolfgang Schuster
denis.ma...@unibe.ch schrieb am 12.09.2023 um 23:32: You need a box to get the author on a separate line. % \define[2]\ChapterCommand %   {\vbox %  {\structureuservariable{author} %  \blank %  #1\space#2}} \starttexdefinition protected ChapterCommand #1#2   \vbox\bgroup

[NTG-context] Re: tiffs: autoconversion via graphicsmagick produces invalid pdfs

2023-09-13 Thread denis.maier
rters.tif.default = convert \stopluacode \setfigureconversion[tif][jpg] % has no effect \defineexternalfigure[tif][conversion=jpg] \starttexdefinition includegraphics #1 \splitfilename{#1} \processaction[\splitofftype][ tif=>{\externalfigure[#1][tif]}, default=>{\externa

[NTG-context] Re: Using structureuservariables before the heading

2023-09-12 Thread denis.maier
he same space as the chapter title is a custom layout for the title. Yes, I've tried that in the original MWE: ... Here, I'm getting just before <3 Third>. So I guess this goes in the right direction, but \define doesn't allow for blanks etc. \starttexdefinition and \def on the other hand gave me

[NTG-context] Re: Using structureuservariables before the heading

2023-09-12 Thread Wolfgang Schuster
} \define[2]\myChapterCommand{\structureuservariable{author}\blank #1\space#2} %\def\myChapterCommand#1#2{\structureuservariable{author}\blank #1\space#2} % does not work % \starttexdefinition myChapterCommand #1 #2 % doesn't work either, but at least blanks should work %   \structureuservariable{author}

[NTG-context] Re: Using structureuservariables before the heading

2023-09-12 Thread denis.maier
le{author}\blank}, ] \def\myChapterCommand#1#2{\structureuservariable{author}\space\blank} \define[2]\myChapterCommand{\structureuservariable{author}\blank #1\space#2} %\def\myChapterCommand#1#2{\structureuservariable{author}\blank #1\space#2} % does not work % \starttexdefinition myChapterComma

[NTG-context] Re: Using structureuservariables before the heading

2023-09-12 Thread denis.maier
Ok, \starttexdefinition allows blanks, apparently just like setups. But, it still fails exactly like the version with \def \setuphead[chapter][ before={Before: \structureuservariable{author}\blank}, beforesection={Beforesection: \structureuservariable{author}\blank}, insidesection

[NTG-context] Re: text width shadow background

2023-07-08 Thread Henning Hraban Ramm
Please, can you explain why the result of lmt_outline is shifted to the right, if I use it in a macro? """ \setupbodyfont[ss,24pt] \definecolor[tshade][t=.05,a=1,k=1] \starttexdefinition MyCaption #1 \startMPcode steps := 5 ; % number of shadow layers rulesize := BodyF

[NTG-context] Re: text width shadow background

2023-07-06 Thread Henning Hraban Ramm
: """ \setupbodyfont[ss,24pt] \definecolor[tshade][t=.05,a=1,k=1] \starttexdefinition MyCaption #1 \startMPcode{doublefun} steps := 10 ; rulesize := BodyFontSize/steps/3; for step = 1 upto steps: draw lmt_outline [ text = "\bf #1", %style = "bold",

[NTG-context] text width shadow background

2023-07-06 Thread Henning Hraban Ramm
Hi, maybe you remember that I wanted this since 2017... I finally managed to get a fuzzy background behind text: """ \setupbodyfont[ss,24pt] \definecolor[tshade][t=.05,a=1,k=1] \starttexdefinition MyCaption #1 \startMPcode{doublefun} steps := 10 ; rulesize := BodyFontSize/steps/

Re: [NTG-context] Is there a way to centrally add a list of indexed items to a sub category?

2023-05-15 Thread Alan Braslau via ntg-context
On Mon, 15 May 2023 09:40:22 +0200 Hans Hagen via ntg-context wrote: > \starttexdefinition tolerant protected IndexB[#1]#:#*#2 > \index{#2} > \doloopoverlist {#1} { > \index{##1+#2} > } > \stoptexdefinition Awesome! However, I think that Joel was look

Re: [NTG-context] Is there a way to centrally add a list of indexed items to a sub category?

2023-05-15 Thread Hans Hagen via ntg-context
t;animals --> dogs" under "a". \starttexdefinition protected IndexA#1#2 \index{#2} \doloopoverlist {#1} { \index{##1+#2} } \stoptexdefinition \starttexdefinition tolerant protected IndexB[#1]#:#*#2 \index{#2} \doloopoverlist {#1} { \index{#

Re: [NTG-context] \autoinsertedspace fails

2023-01-05 Thread Hans Hagen via ntg-context
On 1/6/2023 3:05 AM, Rik Kabel via ntg-context wrote: On 2023-01-05 04:35, Hans Hagen via ntg-context wrote: On 1/5/2023 4:21 AM, Rik Kabel via ntg-context wrote:     [ snipped by rik] Here is a more lmtx-ish variant: \starttexdefinition tolerant protected BD

Re: [NTG-context] \autoinsertedspace fails

2023-01-05 Thread Rik Kabel via ntg-context
On 2023-01-05 04:35, Hans Hagen via ntg-context wrote: On 1/5/2023 4:21 AM, Rik Kabel via ntg-context wrote:     [ snipped by rik] Here is a more lmtx-ish variant: \starttexdefinition tolerant protected BD #=#*#=    \removeunwantedspaces    \space % insert a space    (    \ifparameter#2

Re: [NTG-context] \autoinsertedspace fails

2023-01-05 Thread Hans Hagen via ntg-context
? As far as removing leading spaces, I do not see that it is necessary, but it may help create more readable sources. Thank you for the fix. Here is a more lmtx-ish variant: \starttexdefinition tolerant protected BD #=#*#= \removeunwantedspaces \space % insert a space ( \ifparameter#2\or

Re: [NTG-context] \autoinsertedspace fails

2023-01-04 Thread Rik Kabel via ntg-context
expected in many cases. As the first examples after \starttext show, the problem appears to be with \autoinsertedspace, but perhaps I am using it incorrectly in the macro as well. \starttexdefinition unexpanded BD   \dodoublegroupempty   \doBD \stoptexdefinition

[NTG-context] \autoinsertedspace fails

2022-12-29 Thread Rik Kabel via ntg-context
in the macro as well. \starttexdefinition unexpanded BD   \dodoublegroupempty   \doBD \stoptexdefinition \starttexdefinition doBD #1#2    \removeunwantedspaces\ % insert a space    (    \ifsecondargument    #1|–|#2    \else\iffirstargument    #1

Re: [NTG-context] How to display the pages of a particular section in another PDF?

2022-12-05 Thread Hans Hagen via ntg-context
ore inpiut and discussion for that \starttexdefinition DoWithSection #1#2 \startpagemakeup \externalfigure[#1.pdf][page=#2] \stoppagemakeup \stoptexdefinition \starttexdefinition LoadSectionsA #1#2 \ctxlua{document.loadsection("#1","#2")} \doifnot{\cldcontext{do

[NTG-context] \autoinsertedspace fails following \nbsp under LMTX

2022-11-16 Thread Rik Kabel via ntg-context
380: Attempt to node.direct.remove() a non-existing node %<-- \starttexdefinition unexpanded New   \dodoublegroupempty   \doNew \stoptexdefinition \starttexdefinition doNew #1#2    \removeunwantedspaces    \ (#

Re: [NTG-context] \autoinsertnextspace regression / discrepancy, mkiv to lmtx

2022-10-27 Thread Hans Hagen via ntg-context
is not auto-inserted by LMTX, while it is by MkIV.     \starttexdefinition TEST #1   #1\autoinsertnextspace     \stoptexdefinition     \tt     \starttext   \TEST{X} \emph{Y}     \stoptext The MkIV result is the correct result (in my opinion). more a side effect ... we lookahead

Re: [NTG-context] \autoinsertnextspace regression / discrepancy, mkiv to lmtx

2022-10-26 Thread Rik Kabel via ntg-context
.     \starttexdefinition TEST #1   #1\autoinsertnextspace     \stoptexdefinition     \tt     \starttext   \TEST{X} \emph{Y}     \stoptext The MkIV result is the correct result (in my opinion). more a side effect ... we lookahead and \emph is not some character I made a variants that does

Re: [NTG-context] \autoinsertnextspace regression / discrepancy, mkiv to lmtx

2022-10-26 Thread Hans Hagen via ntg-context
On 10/26/2022 1:52 AM, Rik Kabel via ntg-context wrote: The following example produces different results when processed by LMTX and MkIV. In particular, a space between the X and Y is not auto-inserted by LMTX, while it is by MkIV. \starttexdefinition TEST #1   #1\autoinsertnextspace

[NTG-context] \autoinsertnextspace regression / discrepancy, mkiv to lmtx

2022-10-25 Thread Rik Kabel via ntg-context
The following example produces different results when processed by LMTX and MkIV. In particular, a space between the X and Y is not auto-inserted by LMTX, while it is by MkIV. \starttexdefinition TEST #1   #1\autoinsertnextspace \stoptexdefinition \tt \starttext   \TEST{X

Re: [NTG-context] Set up external figure for particular image type

2022-08-01 Thread Hans Hagen via ntg-context
be applied because there's no process action. % Default (\textwidth) is used, as defined above. \defineexternalfigure[pdf][width=6cm] \starttexdefinition includegraphics #1 \splitfilename{#1} \processaction[\splitofftype][ jpg=>{\externalfigure[#1][jpg]}, png=>{\externalfigure[#1][png]}

Re: [NTG-context] Set up external figure for particular image type

2022-08-01 Thread Thangalin via ntg-context
(\textwidth) is used, as defined above.\defineexternalfigure[pdf][width=6cm] \starttexdefinition includegraphics #1 \splitfilename{#1} \processaction[\splitofftype][ jpg=>{\externalfigure[#1][jpg]}, png=>{\externalfigure[#1][png]}, svg=>{\externalfigure[#1][svg][conversion=mp]},

Re: [NTG-context] Set up external figure for particular image type

2022-07-18 Thread Thangalin via ntg-context
ain! > \setupexternalfigures [location={local,global,default}] > > \defineexternalfigure [jpg] [width=4cm] > \defineexternalfigure [png] [width=8cm] > > \starttexdefinition includegraphics #1 > > \splitfilename{#1} > > \processaction > [\splitofftype] >

Re: [NTG-context] Set up external figure for particular image type

2022-07-12 Thread Wolfgang Schuster via ntg-context
\externalfigure to load the image. \setupexternalfigures [location={local,global,default}] \defineexternalfigure [jpg] [width=4cm] \defineexternalfigure [png] [width=8cm] \starttexdefinition includegraphics #1     \splitfilename{#1}     \processaction     [\splitofftype]     [    jpg

Re: [NTG-context] Foonotes in Captions ... again

2022-06-16 Thread Denis Maier via ntg-context
("footnote", 1, page_index - 1) > > end > > end > > } > > \stopluacode > > > > \def\save_footnote_data#1{% > > \latelua{ > > userdata.visual_order = userdata.visual_order + 1 > >

Re: [NTG-context] Foonotes in Captions ... again

2022-06-16 Thread Denis Maier via ntg-context
userdata.visual_order = userdata.visual_order + 1 > userdata.save_data[#1] = userdata.visual_order > }% > } > > \let\old_footnote=\footnote > > \starttexdefinition protected footnote #1 > \begingroup > \clf_set_footnote_

Re: [NTG-context] Foonotes in Captions ... again

2022-06-15 Thread Max Chernoff via ntg-context
telua{ userdata.visual_order = userdata.visual_order + 1 userdata.save_data[#1] = userdata.visual_order }% } \let\old_footnote=\footnote \starttexdefinition protected footnote #1 \begingroup \clf_set_footnote_number

Re: [NTG-context] Changing font and font size inside textex

2022-05-31 Thread Stefan Nedeljkovic via ntg-context
Thank you, I'll try that later. On Tue, May 31, 2022 at 9:42 AM Max Chernoff wrote: > > Thanks Max that works perfectly! But It would still be useful if I could > > change families inside a MPpage. > > Sure, but you'll need to store the x-heights first: > > \startte

Re: [NTG-context] Changing font and font size inside textex

2022-05-31 Thread Max Chernoff via ntg-context
Thanks Max that works perfectly! But It would still be useful if I could change families inside a MPpage. Sure, but you'll need to store the x-heights first: \starttexdefinition storexheight [#1] % Placing the first use of \switchtobodyfont inside a group messes

Re: [NTG-context] Changing font and font size inside textex

2022-05-30 Thread Stefan Nedeljkovic via ntg-context
Thanks Max that works perfectly! But It would still be useful if I could change families inside a MPpage. On Tue, May 31, 2022 at 1:31 AM Max Chernoff wrote: > > I'm using the following macro to set the font size via h-height: > > > > \starttexdefinition

Re: [NTG-context] Changing font and font size inside textex

2022-05-30 Thread Max Chernoff via ntg-context
I'm using the following macro to set the font size via h-height: \starttexdefinition setxheight [#1][#2] \switchtobodyfont[#1, 12pt] \scratchdimen=\dimexpr#2\relax \switchtobodyfont[#1, \cldcontext{tex.dimen.scratchdimen / tex.sp"1ex" * tex.sp"1em" .. "sp&quo

[NTG-context] Changing font and font size inside textex

2022-05-30 Thread Stefan Nedeljkovic via ntg-context
Dear list, I want to be able to change the font and the font size inside a MPpage. But if I try to prepend \switchtobodyfont to the text inside textext it doesn't work. I'm using the following macro to set the font size via h-height: \starttexdefinition setxheight [#1][#2] \switchtobodyfont

Re: [NTG-context] Specifying font size as x-height

2022-05-28 Thread Stefan Nedeljkovic via ntg-context
old version expected direct input, not a \dimen. Try this: > > \starttexdefinition setxheight [#1][#2] > \switchtobodyfont[#1, 12pt] > \scratchdimen=\dimexpr#2\relax > \switchtobodyfont[#1, \cldcontext{tex.dimen.scratchdimen / > tex.sp"1ex"

Re: [NTG-context] Specifying font size as x-height

2022-05-28 Thread Max Chernoff via ntg-context
On 2022-05-28 2:27 a.m., Stefan Nedeljkovic wrote: One slight problem is when I use 2\measured{xheight} as the font size I get an error. \measure works fine though. The old version expected direct input, not a \dimen. Try this: \starttexdefinition setxheight [#1][#2

Re: [NTG-context] Specifying font size as x-height

2022-05-28 Thread Stefan Nedeljkovic via ntg-context
How would one specify the font size in LMTX, but via x-height? >> >> You could try this: >> >> \starttexdefinition setxheight [#1][#2] >> \switchtobodyfont[#1, 12pt] >> \switchtobodyfont[#1, \cldcontext{tex.sp"#2" / tex.sp&qu

Re: [NTG-context] Specifying font size as x-height

2022-05-28 Thread Stefan Nedeljkovic via ntg-context
Awesome, thank you very much Max! On Sat, May 28, 2022 at 8:49 AM Max Chernoff wrote: > > How would one specify the font size in LMTX, but via x-height? > > You could try this: > > \starttexdefinition setxheight [#1][#2] > \switchtobodyfont[#1, 12pt] >

Re: [NTG-context] Specifying font size as x-height

2022-05-28 Thread Max Chernoff via ntg-context
How would one specify the font size in LMTX, but via x-height? You could try this: \starttexdefinition setxheight [#1][#2] \switchtobodyfont[#1, 12pt] \switchtobodyfont[#1, \cldcontext{tex.sp"#2" / tex.sp"1ex" * tex.sp"1em" .. "

Re: [NTG-context] \getcommacommandsize not working in lmtx

2022-05-02 Thread Hans Hagen via ntg-context
stsize \starttexdefinition protected somelist foo, bar, baz \stoptexdefinition {\tt\meaningasis\somelist} \getcommacommandsize[\somelist] \commalistsize \starttexdefinition somelist foo, bar, baz \stoptexdefinition {\tt\meaningasis\somelist} \getcommacommandsize[\somelist] \commali

Re: [NTG-context] Metafun, difficulty with graphical element in the margin

2022-03-20 Thread Wolfgang Schuster via ntg-context
\start \setupinterlinespace[line=5.6ex]% also possible: \setupinterlinespace[5.6ex] \samplefile{lorem}\par \stop \stoptext \starttexdefinition RemovePreceding #1 \removeunwantedspaces #1 \stoptexdefinition \starttexdefinition RemoveFollowing #1 #1 \ignorespaces \stoptexdefini

Re: [NTG-context] Regular Online meeting

2022-02-07 Thread Hans Hagen via ntg-context
\starttexdefinition MaxFigure #1#2 \page \getfiguredimensions[#1][page=#2]\relax \ifdim\figurewidth>\figureheight\relax \externalfigure [#1] [page=#2, fr

Re: [NTG-context] How to override ConTeXt-SBL titles, to make all titles everywhere capitalized?

2022-01-17 Thread Joey McCollum via ntg-context
: ``` \starttexdefinition titleemph #1 \emph{\Word{#1}} \stoptexdefinition \starttexdefinition titlequote #1 \quotation{\Word{#1}} \stoptexdefinition ``` If you want the behavior you've described, you can change \Word to \Words in the lines above (in publ-imp-sbl.mkvi). I probably will leave the code

Re: [NTG-context] XML, dealing with whitespace

2022-01-17 Thread Denis Maier via ntg-context
on xsl:output that can be used to control this: (https://www.saxonica.com/documentation9.5/xsl-elements/output.html) So, the solution to my problem is this: Denis begin example \starttexdefinition RemovePreceding #1 \removeunwantedspaces #1 \stoptexdefinition \starttexdefinition

Re: [NTG-context] XML, dealing with whitespace

2022-01-15 Thread Wolfgang Schuster via ntg-context
\starttexdefinition RemovePreceding #1     \removeunwantedspaces     #1 \stoptexdefinition \starttexdefinition RemoveFollowing #1     #1     \ignorespaces \stoptexdefinition \starttext Bla \RemovePreceding{Bla} Bla Bla \RemoveFollowing{Bla} Bla \stoptext end example When only  following

Re: [NTG-context] Displaying names in Chicago-Turabian "note" style

2021-12-21 Thread Joey McCollum via ntg-context
orm citations for inline citations after the first one. To make these work, it ended up being easiest to create distinct \fastsetups for an "inlineshort" style. Here is how I handled the citation of the author in such instances in publ-imp-sbl.mkvi : \starttexdefinition btx:sbl:inlin

Re: [NTG-context] Checking for a Unicode prefix of a Unicode string

2021-11-27 Thread Joey McCollum via ntg-context
t; > to ensure that the first input is expanded when it is passed to Lua, I > > have to pass it as [==[#1]==], not "#1". But the updated MWE below still > > does not seem to work, as the \DoIfPrefixElse macro is printing "NOP" > > instead of "YES": &

Re: [NTG-context] Checking for a Unicode prefix of a Unicode string

2021-11-27 Thread Hans Hagen via ntg-context
em to work, as the \DoIfPrefixElse macro is printing "NOP" instead of "YES": ``` \starttexdefinition loc [#1] \doifassignmentelse{#1} { % if an assignment, then parse and format accordingly \getparameters[loc][#1] % Was a section number specified? \doifdefined{locsec} { § \loc

Re: [NTG-context] Checking for a Unicode prefix of a Unicode string

2021-11-27 Thread Joey McCollum via ntg-context
ot;NOP" instead of "YES": ``` \starttexdefinition loc [#1] \doifassignmentelse{#1} { % if an assignment, then parse and format accordingly \getparameters[loc][#1] % Was a section number specified? \doifdefined{locsec} { § \locsec } } { % otherwise, just print the input as

Re: [NTG-context] Checking for a Unicode prefix of a Unicode string

2021-11-26 Thread Joey McCollum via ntg-context
ter it has been fully expanded) starts with a certain prefix. A minimal (non-)working example follows: ``` \starttexdefinition loc [#1] \doifassignmentelse{#1} { % if an assignment, then parse and format accordingly \getparameters[loc][#1] % Was a section number specified? \doifdefined

Re: [NTG-context] Short forms and abbreviations in bibliography

2021-10-06 Thread Joey McCollum via ntg-context
fttext=,righttext=][\currentbtxtag]}} >> } >> ``` >> >> Thankfully, everything else gets rendered as expected. But why is the >> \texdefinition not expanding? If it helps, I've included it below: >> >> ``` >> \starttexdefinition btx:sbl:inline:short

Re: [NTG-context] Short forms and abbreviations in bibliography

2021-10-06 Thread Joey McCollum via ntg-context
ive=listsubcite,lefttext=,righttext=][\currentbtxtag]}} > } > ``` > > Thankfully, everything else gets rendered as expected. But why is the > \texdefinition not expanding? If it helps, I've included it below: > > ``` > \starttexdefinition btx:sbl:inline:shorthand > \bt

Re: [NTG-context] Short forms and abbreviations in bibliography

2021-10-06 Thread Joey McCollum via ntg-context
]{\texdefinition{btx:sbl:inline:shorthand}}{\textcite[alternative=listsubcite,lefttext=,righttext=][\currentbtxtag]}} } ``` Thankfully, everything else gets rendered as expected. But why is the \texdefinition not expanding? If it helps, I've included it below: ``` \starttexdefinition btx:sbl:inline:shorthand

Re: [NTG-context] Changing the style of author’s surname in a custom bibliographical style

2021-09-15 Thread Tomáš V via ntg-context
,     ] % field definitions \starttexdefinition btx:iso690:author     \btxdoif {author} {     \btxflush{author}     \btxperiod     } \stoptexdefinition % book definition \startsetups btx:iso690:list:book     \texdefinition{btx:iso690:author}     \removeunwantedspaces \stopsetups

[NTG-context] Changing the style of author’s surname in a custom bibliographical style

2021-09-11 Thread Tomáš V via ntg-context
\starttexdefinition btx:iso690:author     \btxdoif {author} {     \btxflush{author}     \btxperiod     } \stoptexdefinition % book definition \startsetups btx:iso690:list:book     \texdefinition{btx:iso690:author}     \removeunwantedspaces \stopsetups % publ-imp-iso690.lua local specification

Re: [NTG-context] Heading for endnotes / grouped by chapter endnotes

2021-07-02 Thread denis.maier
ank[halfline]}] > > %- endnote pages setup % > > \definemarking [notePage] > > \startsetups   [noteHeadingsText] >   {\em Notes for page > \doifelse{\fetchmark[notePage][top]}{\fetchmark[notePage][bottom]} >

Re: [NTG-context] Heading for endnotes / grouped by chapter endnotes

2021-06-30 Thread Rik Kabel
]}     { \getmarking[notePage][top]}     {s \getmarking[notePage][top]–\getmarking[notePage][bottom]}} \stopsetups \starttexdefinition unexpanded startEndnote   \dosingleempty\doStartEndnote \stoptexdefinition \starttexdefinition doStartEndnote [#1]   \expanded{\dodoStartEndnote[#1][{\rawcountervalue

Re: [NTG-context] Loop?

2021-02-13 Thread Wolfgang Schuster
ake adding and removing (can be done by commenting entries with %) you can use the \starttexdefinition environment with each name on a separate line. begin example \starttext \startsetups [NameEntry] Person Number \recursestring\par \stopsetups \doloopoverlist{One,Two,Three,Four}{\directsetup

Re: [NTG-context] Loop?

2021-02-12 Thread Jairo A. del Rio
> > > Another way is to use the database module: > > \usemodule[database] > > \starttext > > \defineseparatedlist >[namelist] >[command=\NameEntry] > > \starttexdefinition

Re: [NTG-context] Loop?

2021-02-12 Thread Wolfgang Schuster
\currentcommalistitem\par \stopprocesscommacommand \stoptext Another way is to use the database module: \usemodule[database] \starttext \defineseparatedlist [namelist] [command=\NameEntry] \starttexdefinition unexpanded NameEntry #1 Person Number #1\par \stoptexdefinition

Re: [NTG-context] Using \overloaded

2021-01-24 Thread Jairo A. del Rio
he following construction to change the formatting > >> of URLs: > >> > >> \let\OrigHyphenatedurl\hyphenatedurl > >> \starttexdefinition hyphenatedurl #URL > >>\begingroup > >> \URLfont\OrigHyphenatedurl{#URL} > >>

Re: [NTG-context] Using \overloaded

2021-01-24 Thread Rik Kabel
of URLs:     \let\OrigHyphenatedurl\hyphenatedurl     \starttexdefinition hyphenatedurl #URL   \begingroup     \URLfont\OrigHyphenatedurl{#URL}   \endgroup     \stoptexdefinition You can use a hook to change the font for \hyphenatedurl. \starttext \hyphenatedurl{https

Re: [NTG-context] Using \overloaded

2021-01-24 Thread Hans Hagen
\hyphenatedurl \starttexdefinition hyphenatedurl #URL   \begingroup     \URLfont\OrigHyphenatedurl{#URL}   \endgroup \stoptexdefinition This results in the following warning about overloading \hyphenatedurl: csname overload > warning, protection level 3, control seque

Re: [NTG-context] Using \overloaded

2021-01-24 Thread Wolfgang Schuster
\hyphenatedurl \starttexdefinition hyphenatedurl #URL   \begingroup     \URLfont\OrigHyphenatedurl{#URL}   \endgroup \stoptexdefinition You can use a hook to change the font for \hyphenatedurl. \starttext \hyphenatedurl{https://wiki.contextgarden.net/Main_Page} \appendtoks

[NTG-context] Using \overloaded

2021-01-23 Thread Rik Kabel
Hans and all, Preparing my standard environments for future strict enforcement of overloading prevention, I have run into one issue. I had been using the following construction to change the formatting of URLs: \let\OrigHyphenatedurl\hyphenatedurl \starttexdefinition hyphenatedurl

[NTG-context] MkIV and LMTX difference in comma list expansion

2020-10-26 Thread Rik Kabel
complex bit to show the issue.) % macros=mkvi \starttexdefinition unexpanded startBlockQuotation     \dosingleempty\dostartBlockQuotation \stoptexdefinition \starttexdefinition dostartBlockQuotation [#SETUPS]     \getrawparameters[BlockQuotation]   [index=,#SETUPS

Re: [NTG-context] How to calculate the height of text of a certain width?

2020-03-25 Thread Rudolf Bahr
toptext Thank you! I played with the example a bit, all works well with one exception: When I replace "align=normal" by "align=left" the frame gets too wide at it's left edge. I append this pdf-file. But "align=right" works well and that's what I'm using mo

Re: [NTG-context] How to calculate the height of text of a certain width?

2020-03-24 Thread Wolfgang Schuster
{\framed[width=300pt,align=normal]{\samplefile{ward}}} \flushlayer[TextBox] \stoptext Now to your proposal, Wolfgang: \starttexdefinition NextboxDimension \starttabulate \NC Width \EQ \the\nextboxwd \NC\NR \NC Height \NC \the\nextboxht \NC\NR \stoptabulate \stoptexdefinition \startte

Re: [NTG-context] How to calculate the height of text of a certain width?

2020-03-24 Thread Rudolf Bahr
wd0=\the\wd0, ht0=\the\ht0 \vskip12pt \startalign[flushleft] \setbox1=\vbox{\hsize=300pt\input ward } \stopalign \copy1 wd1=\the\wd1, ht1=\the\ht1 \stoptext - The .pdf-file is appended Now to your proposal, Wolfgang: > > \starttexdefinition Nextb

Re: [NTG-context] How to calculate the height of text of a certain width?

2020-03-24 Thread Wolfgang Schuster
\setbox0=\vbox{... somehow flushed text ...} wount work, i.e \wd0 or \ht0 will both result in 0. With "unflushed" text this means will work perfectly. I have no idea where you get 0 (0pt?). \starttexdefinition NextboxDimension \starttabulate \NC Width \EQ \the\nextboxwd \NC\NR \N

Re: [NTG-context] Tent style cards

2019-12-22 Thread Hans Hagen
solution: \starttexdefinition TableCard #1     \setupTABLE [start] [frame=off,width=4in,height=3in,align={middle,lohi},style=\tfd]     \setupTABLE [row]   [1] [orientation=180]    %\setupTABLE [start] [leftframe=on,rightframe=on]    %\setupTABLE [row]   [1] [topframe=on]    %\setupTABLE

Re: [NTG-context] Tent style cards

2019-12-22 Thread Wolfgang Schuster
with. But mirroring doesn't work. If I use \setuparranging[2*4] mirroring works, but I only need tent style (1*2 head-to-head) so that I can trim to size. Any template that could be suggested would be most helpful as the wedding is on Mon (yikes!). Simple solution: \starttexdefinition TableCard #1

Re: [NTG-context] Filling a page with \thinrules

2019-12-07 Thread Hans Hagen
On 12/7/2019 10:10 AM, Otared Kavian wrote: Hi Rik, Thanks a lot for the link to that message dating back to 2010… I tried to put that solution on the wiki but I could not create a new page. I'll try later. Think TeX (and a little ConTeXt): \starttexdefinition thinrulesfillpage \par

[NTG-context] Modifying the place of the year in APA.

2019-05-16 Thread Dmitry Starostin
are listed. I need to: 1. place the year in the end 2. remove parentheses. Do I start with btx:apa:authoryear and redefine it? Do I use \texdefinition{btx:apa:suffixedyear} separately? and: in the following, where is the parenthesis? \starttexdefinition unexpanded btx:apa:suffixedyear

Re: [NTG-context] Bibliography: I think module [aps] is rendering incorrectly the electronic category and others too

2019-03-21 Thread Alan Braslau
quot;collaboration", "organization" and, indeed, if there is none, it should not include the comma. So the texdefinition (in publ-imp-aps.mkvi) should be changed to: \starttexdefinition unexpanded btx:aps:author \btxdoif {author} { \btxflush{author} \btxcomma } \stoptexdefi

[NTG-context] Bidi-related register problem

2019-01-24 Thread Rik Kabel
nce=no] \starttexdefinition unexpanded MIndex \dosinglegroupempty\doMIndex \stoptexdefinition \starttexdefinition unexpanded doMIndex #MARKER \def\Marker{#MARKER}% \dosinglegroupempty\doMIndexFull \stoptexdefinition \starttexdefinition doMIndexFull #ITEM \doifelse{#I

[NTG-context] Issues using publications subsystem for non-bibliographic database

2018-12-06 Thread Rik Kabel
}} \stopsetups \startsetups btx:quotedb:list:quote \limitatetext{\btxfield{extract}}{\textwidth}{\unknown} \blank[none] -\btxspace\btxflush{author} \btxcomma\btxfield{year} \stopsetups \starttexdefinition Quotation #QUOTE \startnarrower \blank

Re: [NTG-context] what defines the font size?

2018-10-18 Thread Hans Hagen
andard tex but it's more a gimmick than useful: \starttext % at : fraction of design size % sa : fraction of current bodyfont size % ht : fraction of font ascender % cp : fraction of height of glyph X \starttexdefinition ShowThem #1#2#3 \startoverlay {\color[trace:r]{\definedfont[#1*

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-14 Thread Rik Kabel
{? }}\GotoPar \input knuth \stopnarrower \stoptext Wolfgang I am applying it incorrectly, or it does not work with the buffers created by \grabbufferdata: \setupwhitespace[none] \setupindenting[none] \starttexdefinition unexpanded startBufTest   \bgroup   \dosingleempty

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel
\stoptext Wolfgang I am applying it incorrectly, or it does not work with the buffers created by \grabbufferdata: \setupwhitespace[none] \setupindenting[none] \starttexdefinition unexpanded startBufTest   \bgroup   \dosingleempty\dostartBufTest \stoptexdefinition

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Wolfgang Schuster
it incorrectly, or it does not work with the buffers created by \grabbufferdata: \setupwhitespace[none] \setupindenting[none] \starttexdefinition unexpanded startBufTest \bgroup \dosingleempty\dostartBufTest \stoptexdefinition \starttexdefinition dostartBufTest [#SETUPS

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel
with the buffers created by \grabbufferdata: \setupwhitespace[none] \setupindenting[none] \starttexdefinition unexpanded startBufTest   \bgroup   \dosingleempty\dostartBufTest \stoptexdefinition \starttexdefinition dostartBufTest [#SETUPS]   \getrawparameters[BufTest][xx=yy,#SETUPS

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel
' of the narrowed paragraph. Also, the placement of the text in the margin is wrong and not easily controlled as with \llap and \rlap. The code started out more like: \define\Mark{\color[middlegray]{\hskip.6cm\itb¿\ }} \setwidthof{\Mark}\to\MarkWidth ... \starttexdefinition

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Wolfgang Schuster
and not easily controlled as with \llap and \rlap. The code started out more like: \define\Mark{\color[middlegray]{\hskip.6cm\itb¿\ }} \setwidthof{\Mark}\to\MarkWidth ... \starttexdefinition stopBufTest \startluacode buffers.prepend("TestBuffer","\\dontl

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel
{\color[middlegray]{\itb¿\ }} \define\First{nothing yet} \define\Arg{nothing yet} \setuplanguage[en][spacing=packed] \starttexdefinition unexpanded startBufTest    \bgroup    \dosingleempty\dostartBufTest \stoptexdefinition \starttexdefinition dostartBufTest [#SETUPS]    \doifsomethingelse{#{SETUPS

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Hans Hagen
{nothing yet} \define\Arg{nothing yet} \setuplanguage[en][spacing=packed] \starttexdefinition unexpanded startBufTest   \bgroup   \dosingleempty\dostartBufTest \stoptexdefinition \starttexdefinition dostartBufTest [#SETUPS]   \doifsomethingelse{#{SETUPS}}     {\define\Arg{yes

  1   2   3   >