[NTG-context] Re: It works after a few changes but ..
> On 17 Nov 2023, at 14:06, Ursula Hermann wrote: > > \margintext{2.1.1}{\starttheorem {The square on the hypotenuse is equal > to the sum of the squares on the other two sides. Ach is das schön, dass du > da bist} > \stoptheorem The spurious parentheses seem to be a side-effect of having unmatched curly brackets in the bit that I have quoted. The following eliminates them: \definemargindata [MyInMargin][inright] \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1cm] \margintext{\blackrule[color=black, height=0.25ex, width=1cm]\\}\blackrule[color=black, height=0.25ex, width=7cm] \setupenumerations [ before={\blank[big]}, after={\blank[big]}, location=serried, width=broad, distance=0.5em, headstyle=bold, titlestyle=normal, way=bytext, conversion=numbers] \defineenumeration [theorem] [text=Theorem, title=yes, style=italic, list=all, listtext={Theorem }] \starttext \margintext{2.1.1}{\starttheorem The square on the hypotenuse is equal to the sum of the squares on the other two sides. Ach is das schön, dass du da bist \stoptheorem } \stoptext I see also in this thread that you have sad "yes" to Aditya's suggestion. But that doesn't have the margintext. Do you still want/need margintext? — Bruce Horrocks Hampshire, UK — Bruce Horrocks Hampshire, UK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Problem with textstyle
Hello list, The following example does not compile, complaining “Missing number, treated as zero needed to see a number, look up 'weird error' in the index to The TeXbook”: \setuphead [chapter] [ textstyle=cap, ] \starttext \startchapter [title={Oops!}] \input knuth-gpt \par \stopchapter \stoptext Replacing the textstyle /cap/ by any of /bold/, /slanted/, /smallcaps/, and /italic/ results in a clean compilation but the indicated style is not applied. Using a style description like /em/, /\em/, /bf/, /\bf/, /\sc,/ does produce the suggested result. The wiki and mail repository are full of examples with the former style names. Using /style=cap/ (which would change the number as well) also results in a failed compilation, while using /style=bolditalic/ works as it should. ConTeXt ver: 2023.09.26 18:19 LMTX fmt: 2023.10.9 int: english/english -- Rik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: It works after a few changes but ..
Dear Aditya, yes, thank you so much, this works. Uschi Von: Aditya Mahajan Gesendet: Freitag, 17. November 2023 15:47:40 An: mailing list for ConTeXt users Betreff: [NTG-context] Re: It works after a few changes but .. On Fri, 17 Nov 2023, Ursula Hermann wrote: > Dear List, > After a few changes i have here an example: > It works, but what I wanted to know is why are there > > round brackets after writing \starttheroem if i compile it. > Should be without round brackets. Are you looking for something like this? \defineenumeration [theorem] [ text=Theorem, title=yes, width=fit, distance=0.5em, alternative=serried, ] \starttext \starttheorem The square on the hypotenuse is equal to the sum of the squares on the other two sides. Ach is das schön, dass du da bist \stoptheorem \stoptext Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] wrong destination types?
Dear list, I have the following sample: \setupinteraction[state=start, page=name, focus=standard] \starttext a\footnote{b} \stoptext In \setupinteraction, "focus=standard" is ignored when I use "page=name". I mean, link destinations are to the full page and they alter the page view (when the document is not viewed as full page). Sorry, I don’t have other way to say it. I should get (only named destination value): 7 0 obj << /D [ 6 0 R /XYZ 76.84458 722.7349 null ] >> endobj And I’m getting: 4 0 obj << /D [ 1 0 R /Fit ] /S /GoTo >> endobj Could anyone confirm the issue or explain me what I’m doing wrong? BTW, "page=name" is required for references to named destinations in external documents. I get the same results with both LMTX and MkIV from current latest (2023.09.26 18:19). Many thanks for your help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: It works after a few changes but ..
On Fri, 17 Nov 2023, Ursula Hermann wrote: > Dear List, > After a few changes i have here an example: > It works, but what I wanted to know is why are there > > round brackets after writing \starttheroem if i compile it. > Should be without round brackets. Are you looking for something like this? \defineenumeration [theorem] [ text=Theorem, title=yes, width=fit, distance=0.5em, alternative=serried, ] \starttext \starttheorem The square on the hypotenuse is equal to the sum of the squares on the other two sides. Ach is das schön, dass du da bist \stoptheorem \stoptext Aditya___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] It works after a few changes but ..
Dear List, After a few changes i have here an example: It works, but what I wanted to know is why are there round brackets after writing \starttheroem if i compile it. Should be without round brackets. I have the following example, the text was in a PDF from 2008, called: Theorems in ConTeXt, and also my text with the margin: \definemargindata [MyInMargin][inright] \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1cm] \margintext{\blackrule[color=black, height=0.25ex, width=1cm]\\}\blackrule[color=black, height=0.25ex, width=7cm] \setupenumerations [ before={\blank[big]}, after={\blank[big]}, location=serried, width=broad, distance=0.5em, headstyle=bold, titlestyle=normal, way=bytext, conversion=numbers] \defineenumeration [theorem] [text=Theorem, title=yes, style=italic, list=all, listtext={Theorem }] \starttext \margintext{2.1.1}{\starttheorem {The square on the hypotenuse is equal to the sum of the squares on the other two sides. Ach is das schön, dass du da bist} \stoptheorem \stoptext Maybe someone can help me. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Text and Remark
Dear Bruce Yes, it was better. But i show you how it should loook: \definemargindata [MyInMargin][inright] \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1cm] \margintext{\blackrule[color=black, height=0.25ex, width=1cm]\\}\blackrule[color=black, height=0.25ex, width=7cm] \starttext \margintext{2.1.1}\remark{Remark 1 Ach ist das schön, dass du da bist} \stoptext But Remark should be a number as you wrote in your example. Thank you Uschi Von: Bruce Horrocks Gesendet: Donnerstag, 16. November 2023 15:58:50 An: ntg-context mailing list Betreff: [NTG-context] Re: Text and Remark On 16 Nov 2023, at 12:52, Ursula Hermann wrote: > > \defineenumeration > [remark] > [location=top,text=Remark,inbetween={\blank[nowhite]},after=\blank,headstyle=bold,margin=1in] Does [alternative=left,text=Remark,inbetween={\blank[nowhite]},after=\blank,headstyle=bold,margin=1in] give what you want? — Bruce Horrocks Hampshire, UK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: [ how to force hyphenation all words ]
On Thu, 16 Nov 2023 21:40:08 +0100 vm via ntg-context wrote: > Is there a command in context to force every word in a text to > hyphenate? e.g to typeset a text with "ge-dach-ten-streep-jes" Like this? \starttext \hyphenatedword{\samplefile{knuth}} \stoptext Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Vertically aligned alternating fillers
Hi! A while back Wolfgang presented a nice solution for alternating fillers: https://www.mail-archive.com/ntg-context@ntg.nl/msg67677.html It works if the text has a constant width. But if the width changes, the alternating look is lost. Is there a way to align the dots vertically even if the text has variable width? Example: \usemodule [visual] \definefiller [pavel-0] [alterntive=symbol, method=global, width=2em, leftmargin=.5em, rightmargin=.5em, symbol=\clap{.}] \definefiller [pavel-1] [pavel-0] [align=left] \definefiller [pavel-2] [pavel-0] [align=middle] \newconditional\PavelState \global\setfalse\PavelState \define\PavelFiller {\ifconditional\PavelState \global\setfalse\PavelState \filler[pavel-1]%% \else \global\settrue\PavelState \filler[pavel-2]%% \fi} \def\oneword {\getrandomnumber\n{1}{100}\fakenwords{1}{\n}} \starttext %% dots are vertically aligned \dorecurse{6}{%% Foo \PavelFiller Bar\par} \hairline %% dots are not aligned \dorecurse{6}{%% \oneword\PavelFiller\oneword\par} \stoptext Marco LMTX 2023.09.04 19:15 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Text and Remark
Dear List: I would like to have text next to the Remark Number \setupindenting[yes,small,first] \defineenumeration [remark] [location=top,text=Remark,inbetween={\blank[nowhite]},after=\blank,headstyle=bold,margin=1in] \starttext \remark An enumeration (\tex{remark}, in this case) takes the paragraph that follows it as its argument. \remark This is the first paragraph after \tex{remark}. It is part of the remark. This is the second paragraph after \tex{remark}. It is not part of the remark. \startremark This is the first paragraph inside \tex{startremark}. It is part of the remark. This is the second paragraph inside \tex{startremark}. It is part of the remark. \stopremark \subsubremark Presto! \stoptext It should look like: Remark 1 I am here. How can I do that. Many Thanks Uschi ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] textbackground spacing offset
Hi! I'm having problems getting the textbackground spacing offset to work. Example: \setupframedtext [offset=overlay, width=max, depthcorrection=off] \setuptextbackground [location=paragraph, %% offset=overlay, %% does nothing %% backgroundoffset=overlay, %% does nothing %% depthcorrection=off, %% does nothing %% topoffset=3mm,%% works, but only for positive values background=, frame=on] \starttext \startframedtext \framed{Foo} \stopframedtext \starttextbackground \framed{Foo} \stoptextbackground \stoptext How do it get the same spacing as in the framedtext case? The textbackground has a small gap between the inner and outer frame at the top and a larger gab at the bottom. I'm not concerned with horizontal spacing here. Marco LMTX 2023.09.04 19:15 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: \doifemptyelse issue?
> On 14 Nov 2023, at 10:40, Hans Hagen wrote: > > On 11/13/2023 1:10 PM, Bruce Horrocks wrote: >> The following MWE gives "false false" instead of "false true". I'm sure this >> used to work (18 months or more ago!) as I found it when re-processing an >> old document. > > because it's not empty (it's a command that you pass) > >> ---start--- >> \setdataset [DS] [a=] >> \setdataset [DS] [a=] >> \starttext >> :\datasetvariable{DS}{1}{a}: \crlf >> :\datasetvariable{DS}{2}{a}: \crlf >> \doifemptyelse{\datasetvariable{DS}{1}{a}}{true}{false} >> \doifemptyelse{\datasetvariable{DS}{2}{a}}{true}{false} >> \stoptext >> ---end--- >> ConTeXt ver: 2023.09.26 18:19 LMTX >> There is a work-around using \doiftext instead as that seems to work okay >> with recalled dataset values but I thought I'd raise it. > for that we have: > > \doifsomethingelse > Thank-you for this. I've realised now that this isn't actually my problem (and that why it worked in the past was probably becuase that part of the 'if' was never taken!). I'll start another thread. — Bruce Horrocks Hampshire, UK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: named destinations in /GoToR
On 11/13/23 23:30, Michal Vlasák wrote: >> […] >> With the previous code, the only destination reads in the PDF source: >> >> 5 0 obj >> << >> /D [ 0 /Fit ] >> /F (whatever.pdf) >> /S /GoToR >> >> >> endobj > > It seems that the default mode for outer (external file) references is > the "auto" mode. This one seems to load the whatever.pdf file, check the > named destinations and decide based on that. Many thanks for your explanation, Michal. I was totally ignorant of the page key in \setupinteraction. It works fine now, with both the options you provided (and the patch, many thanks for both). I have accidentally discovered an issue in which users may run in an uninteded ways. If many destinations have the same identifier, only the first one is generated. Using the following sample: \setupinteraction[state=start, focus=standard] \starttext \dorecurse{5}{\dorecurse{5} {\chapter[\recurselevel]{Chapter} \section[sec-\recurselevel]{Section}}} \stoptext Of course, this kind of identifiers have to be unique to be useful, but I wonder whether they may be created adding something like: identifier identifier-1 identifier-2 identifier-3 … identifier-n This way (or a similar one) all named destinations are created. Of course, when linking with \goto, \in, \at, \about, the right identifier should be chosen. With links within the same document, correcting the identifier (or the link destination) is a trivial matter. With links from external documents, there may be no option to generate the external files again. If destinations are there, inspecting the external document is an option. Would it be possible that already given destination identifiers could automatically have another indentifier to generate a new destination? I hope my explanation is clear. Let me know if it isn’t and I try to ellaborate it further (in a clearer way ). Many thanks for your help again, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: \doifemptyelse issue?
On 11/13/2023 1:10 PM, Bruce Horrocks wrote: The following MWE gives "false false" instead of "false true". I'm sure this used to work (18 months or more ago!) as I found it when re-processing an old document. because it's not empty (it's a command that you pass) ---start--- \setdataset [DS] [a=] \setdataset [DS] [a=] \starttext :\datasetvariable{DS}{1}{a}: \crlf :\datasetvariable{DS}{2}{a}: \crlf \doifemptyelse{\datasetvariable{DS}{1}{a}}{true}{false} \doifemptyelse{\datasetvariable{DS}{2}{a}}{true}{false} \stoptext ---end--- ConTeXt ver: 2023.09.26 18:19 LMTX There is a work-around using \doiftext instead as that seems to work okay with recalled dataset values but I thought I'd raise it. for that we have: \doifsomethingelse Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: named destinations in /GoToR
Hello Pablo, On Mon Nov 13, 2023 at 5:25 PM CET, Pablo Rodriguez via ntg-context wrote: > Dear list, > > imagine I have a PDF document (named "whatever.pdf") such as the one > generated from this source: > > \setupinteraction[state=start, > focus=standard] > \starttext > \dorecurse{5} > {\chapter[\recurselevel]{Chapter} > \section[sec-\recurselevel]{Section}} > \stoptext > > This source only samples PDF documents not generated with ConTeXt. This > means that no .tuc file may be available and named destinations may > contain only digits. > > Then I need to access some named destinations from a document such as: > > \setupinteraction[state=start, > focus=standard] > \starttext > \dorecurse{5} > {\goto{Chapter \recurselevel}[whatever.pdf::\recurselevel], > \goto{section \recurselevel}[whatever.pdf::sec-\recurselevel]\par} > \stoptext > > Sorry, but after reading again lpdf-ano.mkxl I’m not sure whether I can > get named destinations (such as "/D (4)" or "/D (sec-3)") and how I > could get them. > > With the previous code, the only destination reads in the PDF source: > > 5 0 obj > << > /D [ 0 /Fit ] > /F (whatever.pdf) > /S /GoToR > >> > endobj It seems that the default mode for outer (external file) references is the "auto" mode. This one seems to load the whatever.pdf file, check the named destinations and decide based on that. I am not exactly sure why your example fails, because it seems desirable that the auto mode detects the named destination and refers to it instead, or at least refers to the page number the destination is actually at. In any case, you can try the "name" mode, which forces the use of destination names (i.e. "/D (...)"): % both inner and outer references in name mode \setupinteraction[page=name] % inner default (auto mode) and outer name mode \setupinteraction[page={auto,name}] Unfortunately, the second one doesn't work due to a typo in strc-ref.lmt: --- a/tex/context/base/mkxl/strc-ref.lmt +++ b/tex/context/base/mkxl/strc-ref.lmt end if toboolean(outer) or outer == v_page or outer == v_yes then outermethod = v_page -elseif inner == v_name then +elseif outer == v_name then outermethod = v_name else outermethod = v_auto Other thing you can try Pablo, is to not actually have the destination file (whatever.pdf) present when running context. This works, because if ConTeXt can't find the file, the auto mode fails and you get named destinations unless in page mode (`page=page`). Whether something better can be done (and in a backwards compatible way) at the ConTeXt side I am not sure, I didn't go that deep. Michal PS: Sorry if this message finds its way onto the list twice, I got blocked by automoderation by initially also including the full strc-ref.lmt file, which is too big. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] named destinations in /GoToR
Dear list, imagine I have a PDF document (named "whatever.pdf") such as the one generated from this source: \setupinteraction[state=start, focus=standard] \starttext \dorecurse{5} {\chapter[\recurselevel]{Chapter} \section[sec-\recurselevel]{Section}} \stoptext This source only samples PDF documents not generated with ConTeXt. This means that no .tuc file may be available and named destinations may contain only digits. Then I need to access some named destinations from a document such as: \setupinteraction[state=start, focus=standard] \starttext \dorecurse{5} {\goto{Chapter \recurselevel}[whatever.pdf::\recurselevel], \goto{section \recurselevel}[whatever.pdf::sec-\recurselevel]\par} \stoptext Sorry, but after reading again lpdf-ano.mkxl I’m not sure whether I can get named destinations (such as "/D (4)" or "/D (sec-3)") and how I could get them. With the previous code, the only destination reads in the PDF source: 5 0 obj << /D [ 0 /Fit ] /F (whatever.pdf) /S /GoToR >> endobj Many thanks for your help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] \doifemptyelse issue?
The following MWE gives "false false" instead of "false true". I'm sure this used to work (18 months or more ago!) as I found it when re-processing an old document. ---start--- \setdataset [DS] [a=] \setdataset [DS] [a=] \starttext :\datasetvariable{DS}{1}{a}: \crlf :\datasetvariable{DS}{2}{a}: \crlf \doifemptyelse{\datasetvariable{DS}{1}{a}}{true}{false} \doifemptyelse{\datasetvariable{DS}{2}{a}}{true}{false} \stoptext ---end--- ConTeXt ver: 2023.09.26 18:19 LMTX There is a work-around using \doiftext instead as that seems to work okay with recalled dataset values but I thought I'd raise it. — Bruce Horrocks Hampshire, UK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: placing \externalfigure
On 11/12/2023 5:30 PM, Marco Patzer wrote: On Sun, 12 Nov 2023 16:34:00 +0100 Hans van der Meer via ntg-context wrote: In placing \externalfigure[file] I observe the figure is placed with its bottom on the baseline, thus: [externalfigure] --- baseline I looked into the option list of setupexternalfigure but could not find one whereby the location with respect to the baseline is either top, bottom or center. Maybe this is what you're looking for: \useMPlibrary [dum] \setuplayout [grid=yes] \showgrid \starttext foo \externalfigure[][][location=high] bar \blank [5*line] foo \externalfigure[][][location=middle] bar \blank [5*line] foo \externalfigure[][][location=low]bar \stoptext This variant: \useMPlibrary [dum] \starttext foo \figuresymbol[] bar foo \figuresymbol[][height=1cm,depth=\strutdepth] bar foo \figuresymbol[][height=3ex,depth=2ex] bar \stoptext gives the lines proepr dimensions. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: How can I use \naturalnumbers
Ursula Hermann schrieb am 12.11.2023 um 17:54: Dear List, I would like to use the \integers. I would like to use the commands in Text and also in Formulars. How to write in the right way? I have: \starttext \naturalnumbers {N} stoptext 1. You have to use math mode. 2. You need the \mathblackboard switch. \starttext \im{{\mathblackboard CINQRZ}} \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] How can I use \naturalnumbers
Dear List, I would like to use the \integers. I would like to use the commands in Text and also in Formulars. How to write in the right way? I have: \starttext \naturalnumbers {N} stoptext Many thanka Uschi ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: placing \externalfigure
On Sun, 12 Nov 2023 16:34:00 +0100 Hans van der Meer via ntg-context wrote: > In placing \externalfigure[file] I observe the figure is placed with > its bottom on the baseline, thus: > > [externalfigure] > --- baseline > > I looked into the option list of setupexternalfigure but could not > find one whereby the location with respect to the baseline is either > top, bottom or center. Maybe this is what you're looking for: \useMPlibrary [dum] \setuplayout [grid=yes] \showgrid \starttext foo \externalfigure[][][location=high] bar \blank [5*line] foo \externalfigure[][][location=middle] bar \blank [5*line] foo \externalfigure[][][location=low]bar \stoptext Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: hard clipping in ConTeXt?
On 11/10/2023 6:17 PM, Pablo Rodriguez via ntg-context wrote: Dear list, I have the following sample: \setuplayout[page] \starttext \clip[hoffset=5mm, voffset=5mm, width=15mm, height=15mm] {\externalfigure[xml-mkiv.pdf]} \stopnotmode \stoptext Using PDF.js (from current Firefox), xpdf, Evince, mupdf-gl, the viewer is able to find "dealing", altough it cannot be displayed. Okular and Sumatra (with Wine in Linux) are not able to find "dealing". Is there any way to have a hard clipping in ConTeXt? I mean, that only the contents of the clipped section is added to the resulting PDF document? one has to render a document (page stream) in order to wee what end up where .. a viewer has that info so it can decide to act upon it (apart from some gambling with words clipped in the middle of a character) this is not something for context to provide (it would mean keeping track of what gets clipped, and then compensating for it because it can still contribute to placement of following stuff, and then how about half clipped stuff) if i had a lifespan of 1000 years or were on a boring trip to another planet it might make a nice (although pointless) challenge to keep me occupied Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] hard clipping in ConTeXt?
Dear list, I have the following sample: \setuplayout[page] \starttext \clip[hoffset=5mm, voffset=5mm, width=15mm, height=15mm] {\externalfigure[xml-mkiv.pdf]} \stopnotmode \stoptext Using PDF.js (from current Firefox), xpdf, Evince, mupdf-gl, the viewer is able to find "dealing", altough it cannot be displayed. Okular and Sumatra (with Wine in Linux) are not able to find "dealing". Is there any way to have a hard clipping in ConTeXt? I mean, that only the contents of the clipped section is added to the resulting PDF document? Many thanks for your help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] \xmlinclusion?
I cannot get \xmlinclusion working. Below an MWE with its output. What I am missing here or is \xmlinclusion not ok?\startxmlsetups demo \xmlsetsetup{#1}{ root|test }{demo:*}\stopxmlsetups\xmlregisterdocumentsetup{demo}{demo}\startxmlsetups demo:root \blank{\bf Start test}\crlf \string\xmlinclusion\{\#1\} ===> "\xmlinclusion{#1}"\crlf \xmlflush{#1}\crlf {\bf End test}\blank\stopxmlsetups\startxmlsetups demo:test \xmlflush{#1}\stopxmlsetups\starttext\currentdate-\currenttime\quad\ConTeXt-version=\contextversion\blankThe following text is on page 52 of xml-mkiv.pdf:\crlf\type{\xmlinclusion{...}}\crlfreturns the file where the node comes from\blankFollows the test of this claim:\xmlprocessfile{demo}{demo.xml}{}\blank\typefile{demo.xml}\stoptext node TEST xml-inclusion.pdf Description: Adobe PDF document met vriendelijke groet,dr. Hans van der MeerBurgemeester Rijnderslaan 244 ingang D1185 MC Amstelveentel. 020 6452701 / 06 53743629 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: command to process CSV file (database module)
On 11/5/23 13:56, Pablo Rodriguez via ntg-context wrote: > [...] > I get an error about an unexpected symbol near "\" in the line of > "\processdatabasefile". > > Could anyone enlighten me about what I am missing here? Replying to myself, thanks to the wiki (https://wiki.contextgarden.net/Commands_with_optional_arguments). It seems that the command has to be defined as unexpanded, such as in: \setupinteraction[state=start] \setupattachments[method=hidden] \usemodule[database] \starttext \unexpanded\def\ItemContents#1#2#3{\doiftext{#2} {\item {\em #1}\attachment[file=#2, name=\currentitemnumber-#2]% \doiftext{#3}{ (also available at #3)}}} \defineseparatedlist [test] [separator={,}, quotechar={"}, before={\startitemize[n]},after={\stopitemize}, first={\ItemContents},last={.}, left={\{},right={\}}] \processdatabasefile[test][context-documents.csv] \stoptext It is not clear for me why is this needed, but it might be one of the many aspects of expansion that average users cannot understand from TeX. Many thanks for your help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] command to process CSV file (database module)
Dear list, These are the following first four lines of a CSV file: ,, "About \LuaTeX\ and \ConTeXt","about.pdf","https://www.pragma-ade.com/general/manuals/about.pdf; "l2r, r2l: A Few Tips","bidi.pdf","https://www.pragma-ade.com/general/manuals/bidi.pdf; "Flowcharts","charts-mkiv.pdf", Faking a command such as \cA, \cB and \cC (for contents of columns A, B or C) I would like to create a source document with an enumeration that contains: \doiftext{\cB} {\item {\em\cA}\attachment[file=\cB]% \doiftext{\cC}{ (also available at \cC)}.} I would like to do that with the "database" module. So far I have adapted the itemize environment, but I don't get the contents for items right: \usemodule[database] \starttext \def\ItemContents#1#2#3{\doiftext{#2} {\item {\em #1}\attachment[file=#2]% \doiftext{#3}{ (also available at #3)}.}} \defineseparatedlist [test] [separator={,}, % tab quotechar={"}, % tab before={\startitemize[n]},after={\stopitemize}, first={\ItemContents},last={.}, left={\{},right={\}}] \processdatabasefile[test][context-documents.csv] \stoptext I get an error about an unexpected symbol near "\" in the line of "\processdatabasefile". Could anyone enlighten me about what I am missing here? Many thanks for your help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: How to encircle text?
On 11/5/23 12:59, anton.chig...@mail.com wrote: > Wow! > This certainly is not the noobie version! > All I wanted was to put a circle around a letter > for emphasis. Anton, it works as you intend: \starttext \startusableMPgraphic{MetaCirc} draw fullcircle xyscaled (OverlayWidth-OverlayLineWidth,OverlayHeight-OverlayLineWidth) withpen pencircle scaled OverlayLineWidth withcolor OverlayColor ; \stopusableMPgraphic \defineoverlay[MetaCirc][\useMPgraphic{MetaCirc}] a\dontleavehmode\framed [background=MetaCirc, backgroundcolor=red, frame=off, location=bottom, rulethickness=1pt] {b}c \stoptext Just in case it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Several math features broke for me in new Debian version
On Fri, Nov 03, 2023 at 01:16:15PM +0100, Wolfgang Schuster wrote: > > \starttext > > Hello world! > > \startformula > > X(f) = \startcases[align={right,left},distance=3pt] > > \NC T, \NC{} $|f| < \frac{1}{2T}$ \NR > > \NC 0, \NC{} $|f| \geq \frac{1}{2T}$ \NR > > \stopcases > > \stopformula > > \stoptext > > There has been changes in the math alignment mechanism a while ago and the > cases > environment use math mode for a column entry when you use the \NC tag at the > begin > of a cell, to make your example working again remove the $ in the column. > > \starttext > > \startformula > X(f) = > \startcases > \NC T, \NC |f| < \frac{1}{2T} \NR > \NC 0, \NC |f| \geq \frac{1}{2T} \NR > \stopcases > \stopformula > > \stoptext > > To typeset the content of a column as text replace \NC with \TC at the begin > of the cell. > Thank you for pointing this out. For now, I shall refrain from upgrading, since this is a backwards incompatible change that affects many files. Eventually, I'll make the required changes. Kumar -- Kumar Appaiah ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Several math features broke for me in new Debian version
Kumar Appaiah schrieb am 03.11.2023 um 11:44: Dear Friends, I am a regular user of ConTeXt. A recent upgrade of ConTeXt in Debian broke things for me. The bug report is here: https://bugs.debian.org/1055233 but I have reproduced the gist here: Upon upgrading to ConTeXt 2023.05.05.20230730+dfsg-2, several math features seem to break for me. Here is an example: \starttext Hello world! \startformula X(f) = \startcases[align={right,left},distance=3pt] \NC T, \NC{} $|f| < \frac{1}{2T}$ \NR \NC 0, \NC{} $|f| \geq \frac{1}{2T}$ \NR \stopcases \stopformula \stoptext There has been changes in the math alignment mechanism a while ago and the cases environment use math mode for a column entry when you use the \NC tag at the begin of a cell, to make your example working again remove the $ in the column. \starttext \startformula X(f) = \startcases \NC T, \NC |f| < \frac{1}{2T} \NR \NC 0, \NC |f| \geq \frac{1}{2T} \NR \stopcases \stopformula \stoptext To typeset the content of a column as text replace \NC with \TC at the begin of the cell. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Example is not working
Dear Aditya, Many thanks. Von: Aditya Mahajan Gesendet: Freitag, 3. November 2023 11:48:10 An: mailing list for ConTeXt users Betreff: [NTG-context] Re: Example is not working On Fri, 3 Nov 2023, Ursula Hermann wrote: > Dear List, > i hope somone can help me. \starttext ... \stoptext is missing! > This litte example is from the wiki, i wanted to try \placeformula \starttext > \placeformula[formula:aformula] > \startformula > y=x^2 > \stopformula > \placeformula > \startformula > \int_0^1 x^2 dx > \stopformula \stoptext Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Several math features broke for me in new Debian version
Dear Friends, I am a regular user of ConTeXt. A recent upgrade of ConTeXt in Debian broke things for me. The bug report is here: https://bugs.debian.org/1055233 but I have reproduced the gist here: Upon upgrading to ConTeXt 2023.05.05.20230730+dfsg-2, several math features seem to break for me. Here is an example: \starttext Hello world! \startformula X(f) = \startcases[align={right,left},distance=3pt] \NC T, \NC{} $|f| < \frac{1}{2T}$ \NR \NC 0, \NC{} $|f| \geq \frac{1}{2T}$ \NR \stopcases \stopformula \stoptext The above works very well in 2021.03.05.20230120+dfsg-1+deb12u1 but gives me this error in 2023.05.05.20230730+dfsg-2: resolvers | formats | executing runner 'run luametatex format': /usr/bin/luametatex --jobname="./test.tex" --socket --shell-escape --fmt=/home/kumar/.texlive2023/texmf-var/luametatex-cache/context/f919750633122078d706dd10f1cfd39b/formats/luametatex/cont-en.fmt --lua=/home/kumar/.texlive2023/texmf-var/luametatex-cache/context/f919750633122078d706dd10f1cfd39b/formats/luametatex/cont-en.lui --c:currentrun=1 --c:fulljobname="./test.tex" --c:input="./test.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:texmfbinpath="/usr/bin" job > passes > version mismatch: 1.32 <> 1.33 system > system > ConTeXt ver: 2023.05.05 18:36 LMTX fmt: 2023.11.2 int: english/english system > system > 'cont-new.mkxl' loaded open source > level 1, order 1, name '/usr/share/texmf/tex/context/base/mkxl/cont-new.mkxl' system > beware: some patches loaded from cont-new.mkiv close source> level 1, order 1, name '/usr/share/texmf/tex/context/base/mkxl/cont-new.mkxl' system > files > jobname './test', input './test.tex', result './test' fonts > latin modern fonts are not preloaded languages > language 'en' is active open source > level 1, order 2, name './test.tex' fonts > preloading latin modern fonts (second stage) mathematics > tweak > 'LatinModernMath-Regular', size 6, math size 3, version 'Version 1.959' found, version 'Version 1.958' expected fonts > 'fallback modern rm 12pt' is loaded tex error > tex error on line 5 in file ./test.tex: Missing $ inserted $ \mathatom \math_atom_by_parameter_indeed #1->\mathatom \s!class \mathcodechecked {#1} \math_frac #1#*[#2]->\beginmathgroup \setlocalmathfractioncurrent {#1}\ifparameter #2\or \setupcurrentmathfraction [#2]\fi \edef \p_math_fraction_fences {\mathfractionparameter \c!fences }\math_atom_by_parameter \mathfractionparameter \bgroup \ifempty \p_math_f { \NC T, \NC{} $|f| < \frac{ 1}{2T}$ \NR 1 \starttext 2 Hello world! 3 \startformula 4 X(f) = \startcases[align={right,left},distance=3pt] 5 >> \NC T, \NC{} $|f| < \frac{1}{2T}$ \NR 6\NC 0, \NC{} $|f| \geq \frac{1}{2T}$ \NR 7 \stopcases 8 \stopformula 9 \stoptext 10 I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. mtx-context | fatal error: return code: 1 Just another note: some examples seem broken here as well: https://wiki.contextgarden.net/Multiline_equations Please let me know how I can help debug this. Thanks. Kumar -- Kumar Appaiah ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Example is not working
On Fri, 3 Nov 2023, Ursula Hermann wrote: > Dear List, > i hope somone can help me. \starttext ... \stoptext is missing! > This litte example is from the wiki, i wanted to try \placeformula \starttext > \placeformula[formula:aformula] > \startformula > y=x^2 > \stopformula > \placeformula > \startformula > \int_0^1 x^2 dx > \stopformula \stoptext Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Adobe Source Typescript With Design Sizes
it be that typescripts are processed in some special mode that doesn’t like Lua syntax? As a workaround, I put the code in an external file and require it from inside the typescript. In the goodies file, I use what I believe is the largest possible font size that can be used in ConTeXt (16,383pt) to select the Display design size. Otherwise, text above that size will fall back to the default, regular design size. Now, since I use the goodies file only when design sizes are enabled, I thought I could make it more robust by using AdobeSource4Display as a default, that is, for any size above 16.5pt. However, if I mix design sizes enabled and disabled in a document, the disabled one seems to be using the goodies file even though it’s not mentioned in the typescript. Any idea of why? For example: \usetypescriptfile[adobesource] \usebodyfont[adobesource] \setupbodyfont[adobesource-nodesignsize] \starttext This text is typeset in Display when Regular should be used. \switchtobodyfont[adobesource] This text is typeset in Regular with design sizes enabled. \stoptext What’s Next === * A harmonious-looking companion math font. * A harmonious-looking companion math font that uses glyphs from Adobe Serif 4 when available. Thanks, Vincent ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Adobe Source Typescript With Design Sizes
On 10/31/2023 8:18 PM, Vincent Hennebert wrote: Hello there, I had mentioned this on a thread some (long) time ago, finally got around to finishing a first version of a typescript with the Adobe Source font family, in all its weight alternatives and design sizes (the latter being available in the Serif style only). Comments welcome. If it looks good I can upload it to the wiki, on the Typescripts_examples page I guess. I have no tiem now to figure out this (somewhat excessive) amount of fonts - hopefully we will not end up in a world where all fonts have many weights which makes it easier for designers not to make choices and delegate that to users instead. That said, - attached a different approach - in your variant you can put the lua in the lfg file (at the top) and then add \loadfontgoodies[...] before where the functions are used I'm not sure if we can talk of design sizes here. It's more about 'usage' because a display vs subhead vs ... variant is not about mixing depending on scale (e.g. using display for 20 pt in a 15 pt setup versus using scaled regular for 20pt and then display 20pt for e.g. a title page or 50pt on posters). (I have Questions For the Experts further down...) maybe a side effect of not defining a math font About Adobe Source == The fonts are available on GitHub [1]. They are the descendants of the Source {Serif,Sans,Code} Pro fonts described in the type-imp-source.mkiv typescript available in the ConTeXt distribution. Due to major changes, Serif Pro was renamed into Serif 4 in, well, its version 4 [2] (that’s the version that introduces design sizes, a.k.a. optical sizes), and Sans Pro was renamed into Sans 3 [3]. [1] https://github.com/adobe-fonts/ [2] https://github.com/adobe-fonts/source-serif/releases/tag/4.004R [3] https://github.com/adobe-fonts/source-sans/issues/192 Usage = Short version: store the attached typescript and its helper Lua files somewhere on your file system where ConTeXt will find them ($HOME/texmf for example), then use in your document: \setupbodyfont[adobesource] Long version: The default typescript name is adobesource (also available as adobesource-regular) and has design sizes enabled. Each weight is also available: adobesource-extralight, adobesource-light, etc., all the way to adobesource-black. There is also a medium weight, that selects the regular versions of Serif and Sans, but the medium version of Mono (just slightly bolder than the regular one, presumably for better on-screen rendering in terminals). Design sizes can be disabled by adding -nodesignsize- to the typescript name: adobesource-nodesignsize-extralight, etc. Finally, I thought it would be cool to over-engineer the typescript a little bit and provide direct access to the design sizes (in case one would want a narrower version for body text, or a bolder and more expanded version for titles, etc.). Here they are, again in all their weights: adobesource-caption-extralight, adobesource-smtext-light, adobesource-subhead, adobesource-display-bold, etc. The ‘regular’ design size is accessed by simply using adobesource-nodesignsize. Questions For the Experts = To avoid a gigantic typescript file with a lot of duplication, I offloaded the font filename calculation to a Lua function (see attached adobesource.lua). I initially wanted to put the Lua code inside the typescript, but then I had all sorts of weird Lua compilation errors. The very same code works fine when included in a normal document though. Could it be that typescripts are processed in some special mode that doesn’t like Lua syntax? As a workaround, I put the code in an external file and require it from inside the typescript. In the goodies file, I use what I believe is the largest possible font size that can be used in ConTeXt (16,383pt) to select the Display design size. Otherwise, text above that size will fall back to the default, regular design size. Now, since I use the goodies file only when design sizes are enabled, I thought I could make it more robust by using AdobeSource4Display as a default, that is, for any size above 16.5pt. However, if I mix design sizes enabled and disabled in a document, the disabled one seems to be using the goodies file even though it’s not mentioned in the typescript. Any idea of why? For example: \usetypescriptfile[adobesource] \usebodyfont[adobesource] \setupbodyfont[adobesource-nodesignsize] \starttext This text is typeset in Display when Regular should be used. \switchtobodyfont[adobesource] This text is typeset in Regular with design sizes enabled. \stoptext What’s Next === * A harmonious-looking companion math font. * A harmonious-looking companion math font that uses glyphs from Adobe Serif 4 when available. Thanks, Vincent ___ If your question
[NTG-context] Adobe Source Typescript With Design Sizes
Hello there, I had mentioned this on a thread some (long) time ago, finally got around to finishing a first version of a typescript with the Adobe Source font family, in all its weight alternatives and design sizes (the latter being available in the Serif style only). Comments welcome. If it looks good I can upload it to the wiki, on the Typescripts_examples page I guess. (I have Questions For the Experts further down...) About Adobe Source == The fonts are available on GitHub [1]. They are the descendants of the Source {Serif,Sans,Code} Pro fonts described in the type-imp-source.mkiv typescript available in the ConTeXt distribution. Due to major changes, Serif Pro was renamed into Serif 4 in, well, its version 4 [2] (that’s the version that introduces design sizes, a.k.a. optical sizes), and Sans Pro was renamed into Sans 3 [3]. [1] https://github.com/adobe-fonts/ [2] https://github.com/adobe-fonts/source-serif/releases/tag/4.004R [3] https://github.com/adobe-fonts/source-sans/issues/192 Usage = Short version: store the attached typescript and its helper Lua files somewhere on your file system where ConTeXt will find them ($HOME/texmf for example), then use in your document: \setupbodyfont[adobesource] Long version: The default typescript name is adobesource (also available as adobesource-regular) and has design sizes enabled. Each weight is also available: adobesource-extralight, adobesource-light, etc., all the way to adobesource-black. There is also a medium weight, that selects the regular versions of Serif and Sans, but the medium version of Mono (just slightly bolder than the regular one, presumably for better on-screen rendering in terminals). Design sizes can be disabled by adding -nodesignsize- to the typescript name: adobesource-nodesignsize-extralight, etc. Finally, I thought it would be cool to over-engineer the typescript a little bit and provide direct access to the design sizes (in case one would want a narrower version for body text, or a bolder and more expanded version for titles, etc.). Here they are, again in all their weights: adobesource-caption-extralight, adobesource-smtext-light, adobesource-subhead, adobesource-display-bold, etc. The ‘regular’ design size is accessed by simply using adobesource-nodesignsize. Questions For the Experts = To avoid a gigantic typescript file with a lot of duplication, I offloaded the font filename calculation to a Lua function (see attached adobesource.lua). I initially wanted to put the Lua code inside the typescript, but then I had all sorts of weird Lua compilation errors. The very same code works fine when included in a normal document though. Could it be that typescripts are processed in some special mode that doesn’t like Lua syntax? As a workaround, I put the code in an external file and require it from inside the typescript. In the goodies file, I use what I believe is the largest possible font size that can be used in ConTeXt (16,383pt) to select the Display design size. Otherwise, text above that size will fall back to the default, regular design size. Now, since I use the goodies file only when design sizes are enabled, I thought I could make it more robust by using AdobeSource4Display as a default, that is, for any size above 16.5pt. However, if I mix design sizes enabled and disabled in a document, the disabled one seems to be using the goodies file even though it’s not mentioned in the typescript. Any idea of why? For example: \usetypescriptfile[adobesource] \usebodyfont[adobesource] \setupbodyfont[adobesource-nodesignsize] \starttext This text is typeset in Display when Regular should be used. \switchtobodyfont[adobesource] This text is typeset in Regular with design sizes enabled. \stoptext What’s Next === * A harmonious-looking companion math font. * A harmonious-looking companion math font that uses glyphs from Adobe Serif 4 when available. Thanks, Vincent\starttypescriptcollection[adobesource] \startluacode require("adobesource") \stopluacode \starttypescript[serif,sans,mono] [ adobesource-extralight, adobesource-light, adobesource, adobesource-regular, adobesource-medium, adobesource-semibold, adobesource-bold, adobesource-black, adobesource-nodesignsize-extralight, adobesource-nodesignsize-light, adobesource-nodesignsize, adobesource-nodesignsize-regular, adobesource-nodesignsize-medium, adobesource-nodesignsize-semibold, adobesource-nodesignsize-bold, adobesource-nodesignsize-black, ] [name] \setups[font:fallback:\typescriptone] \definefontsynonym [\typescriptprefix{\typescriptone}] [\ctxlua{context(userdata.adobesource.getfontname("\typescriptone", "\typescripttwo", false, false))}] [features=default] \definefontsynonym [\t
[NTG-context] Re: Inline mathematics is stretched
On 10/29/2023 1:33 PM, Mia Bikey wrote: Hi, I was using \setupalign[verytolerant,stretch] so that the mono font does not go inside the right inline image but after using that command the inline math seems to spread. how about just using this \setupbodyfont[concrete] \starttext When $a, b, c$ are given, two values of $x$ and no more can be found which shall make the function $ax^2 + bx + c$ vanish; that is, the equation always has two roots and no more. The roots may be equal or unequal, real or imaginary, according to circumstances. \stoptext Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Inline mathematics is stretched
Hi, I was using \setupalign[verytolerant,stretch] so that the mono font does not go inside the right inline image but after using that command the inline math seems to spread. Here is a Minimal Working Example: ConTeXt ver: 2023.09.26 18:19 LMTX \setupbodyfont[10pt, mono] This is how it should look. \\ When $a, b, c$ are given, two values of $x$ and no more can be found which shall make the function $ax^2 + bx + c$ vanish; that is, the equation always has two roots and no more. The roots may be equal or unequal, real or imaginary, according to circumstances. \\ \starttext \setupalign[stretch] This paragraph seems to look fine on 12pt. \\ When $a, b, c$ are given, two values of $x$ and no more can be found which shall make the function $ax^2 + bx + c$ vanish; that is, the equation always has two roots and no more. The roots may be equal or unequal, real or imaginary, according to circumstances. \\ \setupalign[verytolerant, nothyphenated] It looks even worse when I also use verytolerant and nothyphenated. \\ When $a, b, c$ are given, two values of $x$ and no more can be found which shall make the function $ax^2 + bx + c$ vanish; that is, the equation always has two roots and no more. The roots may be equal or unequal, real or imaginary, according to circumstances. \stoptext Thisishowitlooks.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: typearea
Henning Hraban Ramm schrieb am 29.10.2023 um 12:13: Am 29.10.23 um 11:37 schrieb Thomas Meyer: Hi, I'm new to ConTeXt and try to use the module typearea (https://modules.contextgarden.net/cgi-bin/module.cgi/action=find/name=typearea). But the example doesn't work: The module is from 2008, i.e. MkII. You can’t expect it to work with MkIV/LMTX. Just define your layout yourself. You can use the \averagecharwidth length to set the text width to a certain number of characters per line but for now only only a few languages are supported. \mainlanguage[en] \setuplayout [width=60\averagecharwidth] \starttext \samplefile{lorem} \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: typearea
Oh, I found something about in the archive! Am 29.10.23 um 11:37 schrieb Thomas Meyer: Hi, I'm new to ConTeXt and try to use the module typearea (https://modules.contextgarden.net/cgi-bin/module.cgi/action=find/name=typearea). But the example doesn't work: \usemodule[typearea] \setupTypeArea[bcor=0mm,alphabets=3.1] \setuppagenumbering[alternative=doublesided] \starttext \dorecurse4{\framed[width=\textwidth,height=\textheight]{test}\page} \stoptext I got: texmf-dist/tex/context/third/typearea/t-typearea.tex' loading > Something like KOMA-TypeArea tex error > tex error on line 89 in file /usr/local/texlive/2023/texmf-dist/tex/context/third/typearea/t-typearea.tex: Missing number, treated as zero { \TA@alphabets \par \PageWidth =\dimexpr \paperwidth -\TA@bcor \relax \par \edef \Ratio {\withoutpt { \the \dimexpr 2\paperheight /(\PageWidth /32768)\relax }} \par \setbox \scratchbox \hbox {\dorecurse {26}{\character \recurselevel }} \Width =\dimexpr \TA@alphabet \setupTypeArea[bcor=0pt,oneside=no,alphabets=2.6] 79 height=\the\Height, 80 width=\the\Width, 81 header=2\lineheight, 82 headerdistance=\lineheight, 83 footer=2\lineheight, 84 footerdistance=3\lineheight, 85 topspace=\Top] 86 } 87 \protect 88 89 >> \setupTypeArea[bcor=0pt,oneside=no,alphabets=2.6] 90 91 \doifnotmode{demo}{\endinput} 92 93 %D Usage example: 94 \usemodule[typearea] 95 \setupTypeArea[bcor=0mm,alphabets=3.1] 96 \setuppagenumbering[alternative=doublesided] 97 \starttext 98 \dorecurse4{\framed[width=\textwidth,height=\textheight]{test}\page} 99 \stoptext A number should have been here; I inserted '0'. (If you can't figure out why I needed to see a number, look up 'weird error' in the index to The TeXbook.) mtx-context | fatal error: return code: 1 Line 89 in the module should be the problem. But how can I solve it? I think some lines in the module should be commented out. (An example directly in the module?) I thank you for any hint. Greetings Thomas ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist :ntg-context@ntg.nl /https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage :https://www.pragma-ade.nl /https://context.aanhet.net (mirror) archive :https://github.com/contextgarden/context wiki :https://wiki.contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] typearea
Hi, I'm new to ConTeXt and try to use the module typearea (https://modules.contextgarden.net/cgi-bin/module.cgi/action=find/name=typearea). But the example doesn't work: \usemodule[typearea] \setupTypeArea[bcor=0mm,alphabets=3.1] \setuppagenumbering[alternative=doublesided] \starttext \dorecurse4{\framed[width=\textwidth,height=\textheight]{test}\page} \stoptext I got: texmf-dist/tex/context/third/typearea/t-typearea.tex' loading > Something like KOMA-TypeArea tex error > tex error on line 89 in file /usr/local/texlive/2023/texmf-dist/tex/context/third/typearea/t-typearea.tex: Missing number, treated as zero { \TA@alphabets \par \PageWidth =\dimexpr \paperwidth -\TA@bcor \relax \par \edef \Ratio {\withoutpt { \the \dimexpr 2\paperheight /(\PageWidth /32768)\relax }} \par \setbox \scratchbox \hbox {\dorecurse {26}{\character \recurselevel }} \Width =\dimexpr \TA@alphabet \setupTypeArea[bcor=0pt,oneside=no,alphabets=2.6] 79 height=\the\Height, 80 width=\the\Width, 81 header=2\lineheight, 82 headerdistance=\lineheight, 83 footer=2\lineheight, 84 footerdistance=3\lineheight, 85 topspace=\Top] 86 } 87 \protect 88 89 >> \setupTypeArea[bcor=0pt,oneside=no,alphabets=2.6] 90 91 \doifnotmode{demo}{\endinput} 92 93 %D Usage example: 94 \usemodule[typearea] 95 \setupTypeArea[bcor=0mm,alphabets=3.1] 96 \setuppagenumbering[alternative=doublesided] 97 \starttext 98 \dorecurse4{\framed[width=\textwidth,height=\textheight]{test}\page} 99 \stoptext A number should have been here; I inserted '0'. (If you can't figure out why I needed to see a number, look up 'weird error' in the index to The TeXbook.) mtx-context | fatal error: return code: 1 Line 89 in the module should be the problem. But how can I solve it? I think some lines in the module should be commented out. (An example directly in the module?) I thank you for any hint. Greetings Thomas___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Mono font goes inside right inline image
Thanks, that works great. On Sat, Oct 28, 2023 at 7:10 PM Hans Hagen wrote: > On 10/28/2023 2:25 PM, Henning Hraban Ramm wrote: > > Am 28.10.23 um 14:17 schrieb Mia Bikey: > >> Hi, > >> I was using mono font as my default font but it appears to have issues > >> with right side inline images. > >> > >> Here is a Minimal Working Example: > >> > >> ConTeXt ver: 2023.09.26 18:19 LMTX > >> > >> \setupbodyfont[mono] > >> > >> \starttext > >> > >> Image on the right side gets issues. > >> \placefigure[right]{}{\externalfigure[dummy]} > >> \input tufte \\ > >> > >> Image on the left side is fine. > >> \placefigure[left]{}{\externalfigure[dummy]} > >> \input tufte > >> > >> \stoptext > > > > I fear there’s something generally wrong with mono font calculations, > > also affecting line breaking, since I get overfull hboxes with code > > examples all the time. > mono runs way to wide for decent linebreaks so use > > \setupalign[verytolerant,stretch] > > > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) > archive : https://github.com/contextgarden/context > wiki : https://wiki.contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Double sided pages leave a thin white line on the right side
Hi, I cannot reproduce it, and I do not see a white line in your file. Maybe I look at the wrong place. /Mikael On Sat, Oct 28, 2023 at 4:11 PM Mia Bikey wrote: > > Hi, > I was using \setuppagenumbering[alternative=doublesided] to get double sided > pages. > After doing that I noticed a thin white line on the right side. > > Here is a Minimal Working Example: > > ConTeXt ver: 2023.09.26 18:19 LMTX > > \setupbackgrounds[page][background=color,backgroundcolor=black] > \setuppagenumbering[alternative=doublesided] > > \starttext > a > \stoptext > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) > archive : https://github.com/contextgarden/context > wiki : https://wiki.contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Double sided pages leave a thin white line on the right side
Hi, I was using \setuppagenumbering[alternative=doublesided] to get double sided pages. After doing that I noticed a thin white line on the right side. Here is a Minimal Working Example: ConTeXt ver: 2023.09.26 18:19 LMTX \setupbackgrounds[page][background=color,backgroundcolor=black] \setuppagenumbering[alternative=doublesided] \starttext a \stoptext Thisishowitlooks.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Mono font goes inside right inline image
On 10/28/2023 2:25 PM, Henning Hraban Ramm wrote: Am 28.10.23 um 14:17 schrieb Mia Bikey: Hi, I was using mono font as my default font but it appears to have issues with right side inline images. Here is a Minimal Working Example: ConTeXt ver: 2023.09.26 18:19 LMTX \setupbodyfont[mono] \starttext Image on the right side gets issues. \placefigure[right]{}{\externalfigure[dummy]} \input tufte \\ Image on the left side is fine. \placefigure[left]{}{\externalfigure[dummy]} \input tufte \stoptext I fear there’s something generally wrong with mono font calculations, also affecting line breaking, since I get overfull hboxes with code examples all the time. mono runs way to wide for decent linebreaks so use \setupalign[verytolerant,stretch] - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Mono font goes inside right inline image
Ah that sucks, I really like how the font looks. I guess I will use some other font then. Thank You On Sat, Oct 28, 2023 at 5:56 PM Henning Hraban Ramm wrote: > Am 28.10.23 um 14:17 schrieb Mia Bikey: > > Hi, > > I was using mono font as my default font but it appears to have issues > > with right side inline images. > > > > Here is a Minimal Working Example: > > > > ConTeXt ver: 2023.09.26 18:19 LMTX > > > > \setupbodyfont[mono] > > > > \starttext > > > > Image on the right side gets issues. > > \placefigure[right]{}{\externalfigure[dummy]} > > \input tufte \\ > > > > Image on the left side is fine. > > \placefigure[left]{}{\externalfigure[dummy]} > > \input tufte > > > > \stoptext > > I fear there’s something generally wrong with mono font calculations, > also affecting line breaking, since I get overfull hboxes with code > examples all the time. > > Hraban > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) > archive : https://github.com/contextgarden/context > wiki : https://wiki.contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Mono font goes inside right inline image
Am 28.10.23 um 14:17 schrieb Mia Bikey: Hi, I was using mono font as my default font but it appears to have issues with right side inline images. Here is a Minimal Working Example: ConTeXt ver: 2023.09.26 18:19 LMTX \setupbodyfont[mono] \starttext Image on the right side gets issues. \placefigure[right]{}{\externalfigure[dummy]} \input tufte \\ Image on the left side is fine. \placefigure[left]{}{\externalfigure[dummy]} \input tufte \stoptext I fear there’s something generally wrong with mono font calculations, also affecting line breaking, since I get overfull hboxes with code examples all the time. Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Mono font goes inside right inline image
Hi, I was using mono font as my default font but it appears to have issues with right side inline images. Here is a Minimal Working Example: ConTeXt ver: 2023.09.26 18:19 LMTX \setupbodyfont[mono] \starttext Image on the right side gets issues. \placefigure[right]{}{\externalfigure[dummy]} \input tufte \\ Image on the left side is fine. \placefigure[left]{}{\externalfigure[dummy]} \input tufte \stoptext This is how it looks.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Color option in \setupinteraction doesn't work sometimes
Hi, you can try contrastcolor: \setupinteraction[state=start,color=,contrastcolor=] /Mikael On Sat, Oct 28, 2023 at 1:54 PM Mia Bikey wrote: > > Ah, wrong attachment. > Here is the correct one. > > On Sat, Oct 28, 2023 at 5:18 PM Mia Bikey wrote: >> >> Hi, >> I was trying to get all my references black as it goes well along with black >> text but they appear red in some pages. >> >> I have reinstalled context in case there was some software issue but it is >> still the same. >> >> Here is a minimal working example: >> >> ConTeXt ver: 2023.09.26 18:19 LMTX >> >> \setupinteraction[state=start, color=black] >> >> \starttext >> >> \placeformula[eq:equation1] >> \startformula >> x >> \stopformula >> >> References are red on the first page \in[eq:equation1] >> \at{page}[eq:equation1] >> >> \input tufte >> \input tufte >> \input tufte >> \input tufte >> \input tufte >> >> Now they become black \in[eq:equation1] \at{page}[eq:equation1] >> >> \stoptext > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) > archive : https://github.com/contextgarden/context > wiki : https://wiki.contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Color option in \setupinteraction doesn't work sometimes
Ah, wrong attachment. Here is the correct one. On Sat, Oct 28, 2023 at 5:18 PM Mia Bikey wrote: > Hi, > I was trying to get all my references black as it goes well along with > black text but they appear red in some pages. > > I have reinstalled context in case there was some software issue but it is > still the same. > > Here is a minimal working example: > > ConTeXt ver: 2023.09.26 18:19 LMTX > > \setupinteraction[state=start, color=black] > > \starttext > > \placeformula[eq:equation1] > \startformula > x > \stopformula > > References are red on the first page \in[eq:equation1] > \at{page}[eq:equation1] > > \input tufte > \input tufte > \input tufte > \input tufte > \input tufte > > Now they become black \in[eq:equation1] \at{page}[eq:equation1] > > \stoptext > This is how it looks 2.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Color option in \setupinteraction doesn't work sometimes
Hi, I was trying to get all my references black as it goes well along with black text but they appear red in some pages. I have reinstalled context in case there was some software issue but it is still the same. Here is a minimal working example: ConTeXt ver: 2023.09.26 18:19 LMTX \setupinteraction[state=start, color=black] \starttext \placeformula[eq:equation1] \startformula x \stopformula References are red on the first page \in[eq:equation1] \at{page}[eq:equation1] \input tufte \input tufte \input tufte \input tufte \input tufte Now they become black \in[eq:equation1] \at{page}[eq:equation1] \stoptext This is how it looks.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Combining python and lua
Hi, Thanks for your inputs Aditya and Bruce. I’m still having some issues when trying to include the output of the filter module within lua. MNWE: \defineexternalfilter [sympy] [filtercommand={/Users/aleks/miniconda3/bin/python3 \externalfilterinputfile\space > \externalfilteroutputfile}, bufferbefore=init, output={\externalfilterbasefile.out}, readcommand=\typefile, read=no,] \startbuffer[init] from sympy import * \stopbuffer \starttext \startluacode local deg2rad = [[ %\startsympy print(latex(rad(%angleVal%))) %\stopsympy ]] local calcTrigFunction = [[ \startsympy from sympy import * print(latex(%fname%(rad(%angleVal% \stopsympy ]] local angleList = {0, 30, 45, 60, 90, 120, 135, 150, 180, 210, 225, 240, 270, 300, 315, 330, 360} for _, a in ipairs(angleList) do context.templates[calcTrigFunction] { fname = "sin", angleVal = a } end \stopluacode \stoptext In particular, it fails as soon as \startsympy and \stopsympy are part of the template. Should I protect these? A. Christe Le 25 oct. 2023 à 21:56 +0200, Aditya Mahajan , a écrit : > On Wed, 25 Oct 2023, Alexandre Christe wrote: > > > Dear list, > > > > I’d like to know the best approach to make this a bit more usable. I’m > > trying to typeset a table with sin/cos/tan values. I’d like to be able to > > convert the angles in degrees into radians (with math notation) and to > > compute the trigonometric function leading to sin(pi/4) = 1/2, or cos(pi/6) > > = sqrt(3)/2 and display it in math mode. > > > > Here’s my current MWE, where I fail to convert the angles in radians > > there is math.sind, cosd, etc. for computing sin for angle in degrees. The > implementation is l-math.lua is: > > local pipi = 2*math.pi/360 > > function math.sind(d) return sin(d*pipi) end > function math.cosd(d) return cos(d*pipi) end > function math.tand(d) return tan(d*pipi) end > > > and fail to display the result in symbolic form. > > Context doesn't do symbolic math. You can try checking if one of the symbolic > math libraries in lua provides all the features that you want. > > > One possible way would be to use Python and the t-filter module, like this > > This can work as follows. Take the array of angles, and convert them to the > desired format in python and write them to a temp file. Read that temp file > in lua and typeset it as you want. > > Another option is an old proof of concept by Luigi: > https://github.com/bastibe/lunatic-python which allowed two-way communication > between python and luatex. Not sure if it still works. > > Aditya > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) > archive : https://github.com/contextgarden/context > wiki : https://wiki.contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Combining python and lua
Dear list, I’d like to know the best approach to make this a bit more usable. I’m trying to typeset a table with sin/cos/tan values. I’d like to be able to convert the angles in degrees into radians (with math notation) and to compute the trigonometric function leading to sin(pi/4) = 1/2, or cos(pi/6) = sqrt(3)/2 and display it in math mode. Here’s my current MWE, where I fail to convert the angles in radians and fail to display the result in symbolic form. \starttext \startluacode local angleList = {0, 30, 45, 60, 90, 120, 135, 150, 180, 210, 225, 240, 270, 300, 315, 330, 360} context.bTABLE() context.bTR() context.bTD() context("$x$") context.eTD() context.bTD() context("$0$") context.eTD() for _, a in ipairs(angleList) do context.bTD() context("$\letterpercent.0f$",a) context.eTD() end context.eTR() context.bTR() context.bTD() context("$\\cos(x)$") context.eTD() for _, a in ipairs(angleList) do context.bTD() context("$\letterpercent.3f$",math.cos(math.rad(a))) context.eTD() end context.eTR() context.bTR() context.bTD() context("$\\sin(x)$") context.eTD() for _, a in ipairs(angleList) do context.bTD() context("$\letterpercent.3f$",math.sin(math.rad(a))) context.eTD() end context.eTR() context.bTR() context.bTD() context("$\\tan(x)$") context.eTD() for _, a in ipairs(angleList) do if a == 90 or a == 270 then context.bTD() context("$-$") context.eTD() else context.bTD() context("$\letterpercent.3f$",math.tan(math.rad(a))) context.eTD() end end context.eTR() context.eTABLE() \stopluacode \stoptext \stoptext One possible way would be to use Python and the t-filter module, like this \usemodule[filter] %It depends on your OS. In mine it's python3 \defineexternalfilter [pythontyping] [filtercommand={python3 \externalfilterinputfile \space > \externalfilteroutputfile}, output={\externalfilterbasefile.tex}, cache=yes, readcommand=\typefile, spacebefore=medium, spaceafter=medium] %We copy settings to save typing \defineexternalfilter[pythonformula][pythontyping] %But instead of typing, we input a formula \setupexternalfilter[pythonformula] [readcommand=\samplefile] %\input should also work \starttext Convert angle to radians: $\startpythonformula from sympy import * print(latex(pi/180*60)) \stoppythonformula$ Compute trigonometric function: $\startpythonformula from sympy import * print(latex(cos(pi/3))) \stoppythonformula$ \stoptext However, I haven’t managed so far to combine things (lua and Python) in an automatic way. How should I proceed? A. Christe ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: sidebar and marginrule not working
Hi Otared, Many thanks. Could you kindly open the pdf I sent as well? How does that look? Here, on Windows 11, the bars do not appear on sumatra, adobe, or nitropdf. Best wishes Idris -- Original Message -- From "Otared Kavian" mailto:ota...@gmail.com>> To "Hamid,Idris" mailto:idris.ha...@colostate.edu>>; "mailing list for ConTeXt users" mailto:ntg-context@ntg.nl>> Date 10/24/2023 7:18:40 AM Subject Re: [NTG-context] sidebar and marginrule not working ** Caution: EXTERNAL Sender ** Hi Idris, Your code works fine on my machine (version 2023.09.26 18:19 LMTX on MacOS 11.7.10). I see both bars correctly. Best regards: Otared On 24 Oct 2023, at 02:24, Hamid,Idris mailto:idris.ha...@colostate.edu>> wrote: Dear gang, The appears to be something wrong with the sidebar and marginrule mechanisms. MWE: == % ConTeXt ver: 2023.09.26 18:19 LMTX \setupmarginrule[1][rulecolor=darkred] \definesidebar[Sidebar][rulethickness=0.28pt,distance=3pt,rulecolor=darkgreen] \setupsidebar[rulecolor=darkgreen] \starttext \startmarginrule[1] \input ward \stopmarginrule \blank \startsidebar[Sidebar] \input zapf \stopsidebar \stoptext == In the output, either i) the rules do not appear at all (most attempts); or ii) the rules appear for a split-second then disappear (using sumatrapdf as the viewer, so the pdf updates on the fly). Is is a bug? A second question: Is either mechanism preferable over the other? That is: In LMTX, what is the best mechanism to use? Thank you in advance for any guidance. Best wishes -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80523 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl<https://www.pragma-ade.nl/> / https://context.aanhet.net<https://context.aanhet.net/> (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net<https://wiki.contextgarden.net/> ___ Otared Kavian e-mail: ota...@gmail.com<mailto:ota...@gmail.com> Phone: +33 6 88 26 70 95 -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80523 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: sidebar and marginrule not working
Hi Idris, Your code works fine on my machine (version 2023.09.26 18:19 LMTX on MacOS 11.7.10). I see both bars correctly. Best regards: Otared > On 24 Oct 2023, at 02:24, Hamid,Idris wrote: > > Dear gang, > > The appears to be something wrong with the sidebar and marginrule mechanisms. > MWE: > > == > % ConTeXt ver: 2023.09.26 18:19 LMTX > > \setupmarginrule[1][rulecolor=darkred] > > \definesidebar[Sidebar][rulethickness=0.28pt,distance=3pt,rulecolor=darkgreen] > \setupsidebar[rulecolor=darkgreen] > > \starttext > \startmarginrule[1] > \input ward > \stopmarginrule > > \blank > > \startsidebar[Sidebar] > \input zapf > \stopsidebar > \stoptext > == > > In the output, either > > i) the rules do not appear at all (most attempts); or > ii) the rules appear for a split-second then disappear (using sumatrapdf as > the viewer, so the pdf updates on the fly). > > Is is a bug? > > A second question: Is either mechanism preferable over the other? That is: In > LMTX, what is the best mechanism to use? > > Thank you in advance for any guidance. > > Best wishes > -- > Idris Samawi Hamid, Professor > Department of Philosophy > Colorado State University > Fort Collins, CO 80523 > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > <https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl> > webpage : https://www.pragma-ade.nl <https://www.pragma-ade.nl/> / > https://context.aanhet.net <https://context.aanhet.net/> (mirror) > archive : https://github.com/contextgarden/context > <https://github.com/contextgarden/context> > wiki : https://wiki.contextgarden.net <https://wiki.contextgarden.net/> > ___ Otared Kavian e-mail: ota...@gmail.com Phone: +33 6 88 26 70 95 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: sidebar and marginrule not working
-- Original Message -- From "Hans Hagen" mailto:j.ha...@xs4all.nl>> To "ntg-context@ntg.nl<mailto:ntg-context@ntg.nl>" mailto:ntg-context@ntg.nl>> Date 10/24/2023 6:17:24 AM Subject [NTG-context] Re: sidebar and marginrule not working ** Caution: EXTERNAL Sender ** On 10/24/2023 1:39 PM, Hamid,Idris wrote: -- Original Message -- From "Hamid,Idris" mailto:idris.ha...@colostate.edu><mailto:idris.ha...@colostate.edu>> To "mailing list for ConTeXt users" mailto:ntg-context@ntg.nl><mailto:ntg-context@ntg.nl>> Date 10/23/2023 6:24:38 PM Subject [NTG-context] sidebar and marginrule not working Dear gang, The appears to be something wrong with the sidebar and marginrule mechanisms. MWE: == % ConTeXt ver: 2023.09.26 18:19 LMTX \setupmarginrule[1][rulecolor=darkred] \definesidebar[Sidebar][rulethickness=0.28pt,distance=3pt,rulecolor=darkgreen] \setupsidebar[rulecolor=darkgreen] \starttext \startmarginrule[1] \input ward \stopmarginrule \blank \startsidebar[Sidebar] \input zapf \stopsidebar \stoptext == In the output, either i) the rules do not appear at all (most attempts); or ii) the rules appear for a split-second then disappear (using sumatrapdf as the viewer, so the pdf updates on the fly). Is this a bug? maybe your viewer is bugged Before sending to the list, I tested the pdf in sumatra (default), adobe, and nitropdf - same result. If three distinct viewers don't show it, then something else must be wrong. Could you open the pdf I sent to the list? What do you see? Best wishes -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80523 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: sidebar and marginrule not working
On 10/24/2023 1:39 PM, Hamid,Idris wrote: -- Original Message -- From "Hamid,Idris" mailto:idris.ha...@colostate.edu>> To "mailing list for ConTeXt users" mailto:ntg-context@ntg.nl>> Date 10/23/2023 6:24:38 PM Subject [NTG-context] sidebar and marginrule not working Dear gang, The appears to be something wrong with the sidebar and marginrule mechanisms. MWE: == % ConTeXt ver: 2023.09.26 18:19 LMTX \setupmarginrule[1][rulecolor=darkred] \definesidebar[Sidebar][rulethickness=0.28pt,distance=3pt,rulecolor=darkgreen] \setupsidebar[rulecolor=darkgreen] \starttext \startmarginrule[1] \input ward \stopmarginrule \blank \startsidebar[Sidebar] \input zapf \stopsidebar \stoptext == In the output, either i) the rules do not appear at all (most attempts); or ii) the rules appear for a split-second then disappear (using sumatrapdf as the viewer, so the pdf updates on the fly). Is this a bug? maybe your viewer is bugged Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: sidebar and marginrule not working
-- Original Message -- From "Hamid,Idris" mailto:idris.ha...@colostate.edu>> To "mailing list for ConTeXt users" mailto:ntg-context@ntg.nl>> Date 10/23/2023 6:24:38 PM Subject [NTG-context] sidebar and marginrule not working Dear gang, The appears to be something wrong with the sidebar and marginrule mechanisms. MWE: == % ConTeXt ver: 2023.09.26 18:19 LMTX \setupmarginrule[1][rulecolor=darkred] \definesidebar[Sidebar][rulethickness=0.28pt,distance=3pt,rulecolor=darkgreen] \setupsidebar[rulecolor=darkgreen] \starttext \startmarginrule[1] \input ward \stopmarginrule \blank \startsidebar[Sidebar] \input zapf \stopsidebar \stoptext == In the output, either i) the rules do not appear at all (most attempts); or ii) the rules appear for a split-second then disappear (using sumatrapdf as the viewer, so the pdf updates on the fly). Is this a bug? A second question: Is either mechanism preferable over the other? That is: In LMTX, what is the best mechanism to use? Thank you in advance for any guidance. Here is the pdf that is a result of the MWE above: https://www.dropbox.com/scl/fi/r18ao8dhpz8m5cj3jk7kv/test-sidebar.pdf?rlkey=slgmiu2wst5xfv3adydhbprj4=0 Also attached. Best wishes -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80523 test-sidebar.pdf Description: test-sidebar.pdf ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] sidebar and marginrule not working
Dear gang, The appears to be something wrong with the sidebar and marginrule mechanisms. MWE: == % ConTeXt ver: 2023.09.26 18:19 LMTX \setupmarginrule[1][rulecolor=darkred] \definesidebar[Sidebar][rulethickness=0.28pt,distance=3pt,rulecolor=darkgreen] \setupsidebar[rulecolor=darkgreen] \starttext \startmarginrule[1] \input ward \stopmarginrule \blank \startsidebar[Sidebar] \input zapf \stopsidebar \stoptext == In the output, either i) the rules do not appear at all (most attempts); or ii) the rules appear for a split-second then disappear (using sumatrapdf as the viewer, so the pdf updates on the fly). Is is a bug? A second question: Is either mechanism preferable over the other? That is: In LMTX, what is the best mechanism to use? Thank you in advance for any guidance. Best wishes -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80523 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Large unwanted white space
Hi, Thanks, it works perfectly. Fabrice Le sam. 21 oct. 2023 à 20:33, Hans Hagen a écrit : > On 10/21/2023 9:43 PM, Fabrice Couvreur wrote: > > Hi, > > I don't know if I will explain my problem clearly but I will try. For my > > students' tests, I use a master file. If I insert this piece of code, > there > > is a large white space that is created between the horizontal line of the > > header and the first exercise. > > \startMPcode makes an image so it will take space > > for definitions use \startMPdefinitions > > > > \startMPcode > >def suite (expr n, t) = > >begingroup > > numeric u; > > u := 5mm; > > pickup pencircle scaled 5pt; > > for i=0 upto n: > > for j=0 upto n: > > drawdot (i*u,j*u) shifted(t*u,0) withcolor \MPcolor{darkred}; > > endfor > > endfor > >endgroup > >enddef; > > > >def Suite (expr n, t) = > >begingroup > >numeric u; > >u := 5mm; > >pickup pencircle scaled 5pt; > >for i=0 upto n: > > drawdot(i*u,0) shifted(t*u,0) withcolor \MPcolor{blue}; > >endfor > >endgroup > >enddef; > > > >def cross (expr n, t) = > >begingroup > >numeric u; > >u := 5mm; > >pickup pencircle scaled 5pt; > >for i=-n upto n: > > drawdot(0,i*u) shifted(t*u,0) withcolor \MPcolor{blue}; > >endfor > >endgroup > >enddef; > > \stopMPcode > > __ %horizontal > line > > % big unwanted white space > > \starttext > > % \startex First exercise > > \startlinecorrection[blank] > > \startmidaligned > >\startcombination[1*2] > > {\startMPcode > >Suite(2,0); > >cross(1,1); > >Suite(4,4); > >cross(2,6); > >Suite(6,10); > >cross(3,13); > >\stopMPcode > > }{\tfx \bf Suite 1} > > {\startMPcode > >suite(0,0); > >suite(1,2); > >suite(2,5); > >\stopMPcode > > }{\tfx \bf Suite 2} > > \stopcombination > > \stopmidaligned > > \stoplinecorrection > >%\stopex > > \stoptext > > > > > > > ___ > > If your question is of interest to others as well, please add an entry > to the Wiki! > > > > maillist : ntg-context@ntg.nl / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > > webpage : https://www.pragma-ade.nl / https://context.aanhet.net > (mirror) > > archive : https://github.com/contextgarden/context > > wiki : https://wiki.contextgarden.net > > > ___ > > -- > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) > archive : https://github.com/contextgarden/context > wiki : https://wiki.contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Large unwanted white space
On 10/21/2023 9:43 PM, Fabrice Couvreur wrote: Hi, I don't know if I will explain my problem clearly but I will try. For my students' tests, I use a master file. If I insert this piece of code, there is a large white space that is created between the horizontal line of the header and the first exercise. \startMPcode makes an image so it will take space for definitions use \startMPdefinitions \startMPcode def suite (expr n, t) = begingroup numeric u; u := 5mm; pickup pencircle scaled 5pt; for i=0 upto n: for j=0 upto n: drawdot (i*u,j*u) shifted(t*u,0) withcolor \MPcolor{darkred}; endfor endfor endgroup enddef; def Suite (expr n, t) = begingroup numeric u; u := 5mm; pickup pencircle scaled 5pt; for i=0 upto n: drawdot(i*u,0) shifted(t*u,0) withcolor \MPcolor{blue}; endfor endgroup enddef; def cross (expr n, t) = begingroup numeric u; u := 5mm; pickup pencircle scaled 5pt; for i=-n upto n: drawdot(0,i*u) shifted(t*u,0) withcolor \MPcolor{blue}; endfor endgroup enddef; \stopMPcode __ %horizontal line % big unwanted white space \starttext % \startex First exercise \startlinecorrection[blank] \startmidaligned \startcombination[1*2] {\startMPcode Suite(2,0); cross(1,1); Suite(4,4); cross(2,6); Suite(6,10); cross(3,13); \stopMPcode }{\tfx \bf Suite 1} {\startMPcode suite(0,0); suite(1,2); suite(2,5); \stopMPcode }{\tfx \bf Suite 2} \stopcombination \stopmidaligned \stoplinecorrection %\stopex \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___ -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Large unwanted white space
Hi, I don't know if I will explain my problem clearly but I will try. For my students' tests, I use a master file. If I insert this piece of code, there is a large white space that is created between the horizontal line of the header and the first exercise. Thanks for your help. Fabrice \startMPcode def suite (expr n, t) = begingroup numeric u; u := 5mm; pickup pencircle scaled 5pt; for i=0 upto n: for j=0 upto n: drawdot (i*u,j*u) shifted(t*u,0) withcolor \MPcolor{darkred}; endfor endfor endgroup enddef; def Suite (expr n, t) = begingroup numeric u; u := 5mm; pickup pencircle scaled 5pt; for i=0 upto n: drawdot(i*u,0) shifted(t*u,0) withcolor \MPcolor{blue}; endfor endgroup enddef; def cross (expr n, t) = begingroup numeric u; u := 5mm; pickup pencircle scaled 5pt; for i=-n upto n: drawdot(0,i*u) shifted(t*u,0) withcolor \MPcolor{blue}; endfor endgroup enddef; \stopMPcode __ %horizontal line % big unwanted white space \starttext % \startex First exercise \startlinecorrection[blank] \startmidaligned \startcombination[1*2] {\startMPcode Suite(2,0); cross(1,1); Suite(4,4); cross(2,6); Suite(6,10); cross(3,13); \stopMPcode }{\tfx \bf Suite 1} {\startMPcode suite(0,0); suite(1,2); suite(2,5); \stopMPcode }{\tfx \bf Suite 2} \stopcombination \stopmidaligned \stoplinecorrection %\stopex \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: protrusion in framed
Csikos Bela schrieb am 20.10.2023 um 14:53: > Hello: > > Protrusioin doesn't work in framed environment. > > This is a short code: > > \definefontfeature[default][default][expansion=quality,protrusion=quality] > > \setupalign[hz,hanging] > > \showframe > > \starttext > > \input tufte > > \blank > > \framed[frame=off,location=top,align=normal,offset=0pt]{\input tufte } \framed[...,align={normal,hz,hanging},...]{...} Wolfgang Thank you for the super fast answer!Another question related to my sample code:Why the right edge of the text hangs into the margin when I use this code:\framed[frame=off,location=top,align=normal,offset=0pt]{\input tufte }Thanks,bcsikos___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: protrusion in framed
I forgot to attach the pdf. Eredeti levél Hello:Protrusioin doesn't work in framed environment.This is a short code:\definefontfeature[default][default][expansion=quality,protrusion=quality]\setupalign[hz,hanging]\showframe\starttext\input tufte\blank\framed[frame=off,location=top,align=normal,offset=0pt]{\input tufte }\blank\setlocalhsize\framed[frame=off,location=top,align=normal,offset=0pt,width=local]{\input tufte }\stoptextThe compiled pdf is attached as protrusion-in-framed.pdf.Is is possible to make protrusion work in framed?I need to use framed in itemize to prevent splittinf of items between pages.Thanks,bcsikos protrusion-in-framed.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: protrusion in framed
Csikos Bela schrieb am 20.10.2023 um 14:53: Hello: Protrusioin doesn't work in framed environment. This is a short code: \definefontfeature[default][default][expansion=quality,protrusion=quality] \setupalign[hz,hanging] \showframe \starttext \input tufte \blank \framed[frame=off,location=top,align=normal,offset=0pt]{\input tufte } \framed[...,align={normal,hz,hanging},...]{...} Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] protrusion in framed
Hello:Protrusioin doesn't work in framed environment.This is a short code:\definefontfeature[default][default][expansion=quality,protrusion=quality]\setupalign[hz,hanging]\showframe\starttext\input tufte\blank\framed[frame=off,location=top,align=normal,offset=0pt]{\input tufte }\blank\setlocalhsize\framed[frame=off,location=top,align=normal,offset=0pt,width=local]{\input tufte }\stoptextThe compiled pdf is attached as protrusion-in-framed.pdf.Is is possible to make protrusion work in framed?I need to use framed in itemize to prevent splittinf of items between pages.Thanks,bcsikos___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: numbered itemize list item label alignment
Eredeti levél Feladó: Aditya Mahajan Dátum: 2023 október 15 22:32:37Tárgy: Re: [NTG-context] Re: numbered itemize list item label alignmentCímzett: mailing list for ConTeXt users On Sun, 15 Oct 2023, Wolfgang Schuster wrote: > Csikos Bela schrieb am 15.10.2023 um 15:51: > > Hello: > > > > I would like to make a long numbered itemize list, where the numbers > > increase up to three digits. > > I would like the numbered labels aligned to the right and the widest > > label's left side located at the left margin. > > I tried the below code but the 3 digit labels' left sides go into the left > > margin. How can I fix it? > > > > Code: > > > > \showframe > > \starttext > > \startitemize[n,broad][itemalign=flushright] > > \dorecurse{250}{\item } > > \stopitemize > > \stoptext > > You can use the width-key to set a value for the number, below is a example > for method > to calculate the width based on the number of items but I would use fixed > value > (e.g. width=2em) to let all items (independent of the entries) start on the > same position. I normally use the `fit` key with an appropriate value of `distance`. For example: \showframe[text][text] \starttext \startitemize[n,fit,broad][distance=0.25em,itemalign=flushright] \dorecurse{1}{\startitem xxx\stopitem} \stopitemize \page \startitemize[n,fit,broad][distance=0.25em,itemalign=flushright] \dorecurse{11}{\startitem xxx\stopitem} \stopitemize \page \startitemize[n,fit,broad][distance=0.25em,itemalign=flushright] \dorecurse{111}{\startitem xxx\stopitem} \stopitemize \stoptext Thank you, the fit option worked well.bcsikos___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Testing whether an XML attribute exists
Hi, I am typesetting a very simple address list whose source is written in XML. Typesetting choices need to be made dependent on the presence of various attributes; consider the following element. If the prefix attribute exists I'l like the name to appear as, e.g. 'Boer, den." The several XML attribute testing functions in the XML manual appear to discriminate on an attribute's value. I tried \xmldoifnotatt in an attempt to say, "TRUE if prefix does not match an empty string", since I am not interested in the attribute's value but only whether or not it exists. The code below doesn't work. If someone who knows why it doesn't work would enlighten my ignorance I would be most grateful. A brief explanation and example of \xmldoifatt, \xmldoifnotatt, and \xmldoifelseatt would be exceedingly helpful. \startxmlsetups xml:list:family {\bf \xmlatt{#1}{surname} \xmldoifnotatt{#1, prefix, ''} {, \xmlatt{#1}{prefix}}} \crlf \xmlflush{#1} \stopxmlsetups I have attached three files below: an XML address list, the ConTeXt source file and the typeset result. -- With kind regards, Michael Guravage \startxmlsetups xml:list:base \xmlsetsetup{#1}{addressBook|family|address|members|member}{xml:list:*} \stopxmlsetups \xmlregisterdocumentsetup{list}{xml:list:base} \startxmlsetups xml:list:addressBook \title{Address List} \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:list:family %% {\bf \xmlatt{#1}{surname} \xmldoifnotatt{#1, prefix, ''} {, \xmlatt{#1}{prefix}}} \crlf {\bf \xmlatt{#1}{surname}}\crlf \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:list:address \xmlatt{#1}{street} \xmlatt{#1}{housenumber}\crlf \xmlatt{#1}{postcode}\crlf \xmlatt{#1}{city}\crlf \xmlatt{#1}{telephone}\crlf \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:list:members \starttabulate[|l|l|l|l|] \xmlflush{#1} \stoptabulate \stopxmlsetups \startxmlsetups xml:list:member \NC \xmlatt{#1}{name} {\tfxx \xmlatt{#1}{maiden_name}} \NC \xmlatt{#1}{birthday} \NC \xmlatt{#1}{email} \NC \xmlatt{#1}{mobile} \NC\NR \stopxmlsetups \starttext \xmlprocessfile{list}{stooges.xml}{} \stoptext stooges.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: numbered itemize list item label alignment
On Sun, 15 Oct 2023, Wolfgang Schuster wrote: > Csikos Bela schrieb am 15.10.2023 um 15:51: > > Hello: > > > > I would like to make a long numbered itemize list, where the numbers > > increase up to three digits. > > I would like the numbered labels aligned to the right and the widest > > label's left side located at the left margin. > > I tried the below code but the 3 digit labels' left sides go into the left > > margin. How can I fix it? > > > > Code: > > > > \showframe > > \starttext > > \startitemize[n,broad][itemalign=flushright] > > \dorecurse{250}{\item } > > \stopitemize > > \stoptext > > You can use the width-key to set a value for the number, below is a example > for method > to calculate the width based on the number of items but I would use fixed > value > (e.g. width=2em) to let all items (independent of the entries) start on the > same position. I normally use the `fit` key with an appropriate value of `distance`. For example: \showframe[text][text] \starttext \startitemize[n,fit,broad][distance=0.25em,itemalign=flushright] \dorecurse{1}{\startitem xxx\stopitem} \stopitemize \page \startitemize[n,fit,broad][distance=0.25em,itemalign=flushright] \dorecurse{11}{\startitem xxx\stopitem} \stopitemize \page \startitemize[n,fit,broad][distance=0.25em,itemalign=flushright] \dorecurse{111}{\startitem xxx\stopitem} \stopitemize \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: numbered itemize list item label alignment
Csikos Bela schrieb am 15.10.2023 um 15:51: Hello: I would like to make a long numbered itemize list, where the numbers increase up to three digits. I would like the numbered labels aligned to the right and the widest label's left side located at the left margin. I tried the below code but the 3 digit labels' left sides go into the left margin. How can I fix it? Code: \showframe \starttext \startitemize[n,broad][itemalign=flushright] \dorecurse{250}{\item } \stopitemize \stoptext You can use the width-key to set a value for the number, below is a example for method to calculate the width based on the number of items but I would use fixed value (e.g. width=2em) to let all items (independent of the entries) start on the same position. \defineexpandable\ItemWidth {\ifnum\lastcountervalue[itemgroup:itemize]>99 \widthofstring{000.}% \orelse\ifnum\lastcountervalue[itemgroup:itemize]>9 \widthofstring{00.}% \else \widthofstring{0.}% \fi} \showframe[text][text] \starttext \startitemize[n][width=\ItemWidth,itemalign=flushright] \dorecurse{1}{\startitem xxx\stopitem} \stopitemize \page \startitemize[n][width=\ItemWidth,itemalign=flushright] \dorecurse{11}{\startitem xxx\stopitem} \stopitemize \page \startitemize[n][width=\ItemWidth,itemalign=flushright] \dorecurse{111}{\startitem xxx\stopitem} \stopitemize \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: numbered itemize list item label alignment
On 10/15/23 15:51, Csikos Bela wrote: > Hello: > > I would like to make a long numbered itemize list, where the numbers > increase up to three digits. > I would like the numbered labels aligned to the right and the widest > label's left side located at the left margin. > I tried the below code but the 3 digit labels' left sides go into the > left margin. How can I fix it? Hi Csikos, width is the key, such as in: \showframe\showgrid\showstruts \starttext \startitemize[n,broad][width=.125tw, itemalign=flushright] \dorecurse{250}{\item } \stopitemize \stoptext I assigned ⅛ text width to the number width to clearly display it. Just in case it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] numbered itemize list item label alignment
Hello:I would like to make a long numbered itemize list, where the numbers increase up to three digits.I would like the numbered labels aligned to the right and the widest label's left side located at the left margin.I tried the below code but the 3 digit labels' left sides go into the left margin. How can I fix it?Code:\showframe\starttext\startitemize[n,broad][itemalign=flushright]\dorecurse{250}{\item }\stopitemize\stoptextThe resulted pdf is attached as context-itemize-label-alignment.pdf.Thank you in advance,bcsikos context-itemize-label-alignment.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: colors for links
On 10/12/2023 3:14 PM, Pablo Rodriguez wrote: Hi Hans, I have the following source, which tries to resemble three kinds of links: \setupinteraction[state=start, style=, focus=standard] \def\inone#1{% \start\setupinteraction[color=darkgreen]% \enabledirectives[references.border=darkgreen]% \goto{#1}[url(#1)]\stop} \def\intwo#1{% \start\setupinteraction[color=darkred]% \enabledirectives[references.border=darkred]% \goto{#1}[url(#1)]\stop} \def\inthree#1{% \start\setupinteraction[color=darkblue]% \enabledirectives[references.border=darkblue]% \goto{#1}[url(#1)]\stop} \starttext \startTEXpage[offset=1dk, align=middle] \inone{one}\blank \intwo{two}\blank \inthree{three}\blank \stopTEXpage \chapter[one]{First chapter} \chapter[two]{Second chapter} \chapter[three]{Second chapter} \stoptext I see that the directive for link borders only allows one color for links per document. In my real-world documents, I need to make three different border links: for destinations inside the document (/GoTo), for destinations in other documents (/GoToR or /GoToE) and for external destinations (/URI). With the current document I write now, I have over a hundred links in twenty pages. Being able to visually distinguish each link helps interaction with the document (reading or even writing it). Would it be possible that \setupinteraction could have a bordercolor key, such as the color one? All is possible but not all should be done, especially not features that mostly serve a few viewers (like acrobat) and don't really relate to typesetting. That said, we can add some styling. First of all, you can use a bit of abstraction \defineinteraction[one] [color=darkgreen,style=\underbar] \defineinteraction[two] [color=darkred, style=\underbar] \defineinteraction[three][color=darkblue, style=\underbar] \def\inone#1{% \start\setinteraction[one]% \goto{#1}[url(#1)]\stop} \def\intwo#1{% \start\setinteraction[two]% \goto{#1}[url(#1)]\stop} \def\inthree#1{% \start\setinteraction[three]% \goto{#1}[url(#1)]\stop} which already might help you. To make it easier I'll add \namedgoto do that one can say: \def\inone #1{\namedgoto[#1]{#1}[url(#1)]} \def\intwo #1{\namedgoto[#1]{#1}[url(#1)]} \def\inthree#1{\namedgoto[#1]{#1}[url(#1)]} I'll also add \outline and \outlined \defineinteraction[one] [color=darkgreen,style=\outlined]% \defineinteraction[two] [color=darkred, style=\outline]% \defineinteraction[three][color=darkblue, style=\outlined]% which of course you then will wikify ... I attached an example but there is no upload (will happen when the build is running again because I can't make osx bins here). hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - oeps.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] colors for links
Hi Hans, I have the following source, which tries to resemble three kinds of links: \setupinteraction[state=start, style=, focus=standard] \def\inone#1{% \start\setupinteraction[color=darkgreen]% \enabledirectives[references.border=darkgreen]% \goto{#1}[url(#1)]\stop} \def\intwo#1{% \start\setupinteraction[color=darkred]% \enabledirectives[references.border=darkred]% \goto{#1}[url(#1)]\stop} \def\inthree#1{% \start\setupinteraction[color=darkblue]% \enabledirectives[references.border=darkblue]% \goto{#1}[url(#1)]\stop} \starttext \startTEXpage[offset=1dk, align=middle] \inone{one}\blank \intwo{two}\blank \inthree{three}\blank \stopTEXpage \chapter[one]{First chapter} \chapter[two]{Second chapter} \chapter[three]{Second chapter} \stoptext I see that the directive for link borders only allows one color for links per document. In my real-world documents, I need to make three different border links: for destinations inside the document (/GoTo), for destinations in other documents (/GoToR or /GoToE) and for external destinations (/URI). With the current document I write now, I have over a hundred links in twenty pages. Being able to visually distinguish each link helps interaction with the document (reading or even writing it). Would it be possible that \setupinteraction could have a bordercolor key, such as the color one? Many thanks for your help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Gray gradient with Metapost
Hi, I would like to obtain, if possible, a gray gradient like in the image. My code uses Metapost but maybe this is possible with Metafun. Thanks. Fabrice \starttext \startMPcode u=1.2cm; interim ahangle := 30; z0=(0,0); z1=(3u,0); z2=(3u,4u); z3=(0,4u); z4=(0.8u,4u); z5=(2.2u,4u); path rectangle; rectangle=z0--z1--z2--z3--cycle; picture X; X = image( drawoptions(withpen pencircle scaled 1.25 withcolor \MPcolor{orange}); draw (left--right) scaled 2; draw (down--up) scaled 2; drawoptions(); ); fill z0--z4--z3--cycle withcolor .5[red,green]; fill z1--z5--z2--cycle withcolor .5[red,green]; fill z0--z4--z5--z1--cycle withcolor 0.625white; draw z0--z4--z3--cycle; draw z1--z5--z2--cycle; draw rectangle; path a[]; a1 = subpath (0, 1) of rectangle shifted 10 down; a2 = subpath (3, 4) of rectangle shifted 10 left; a3 = subpath (2.26, 2.76) of rectangle shifted 13 up; drawdblarrow a1; label.bot("$30$", point 1/2 of a1); drawdblarrow a2; label.lft("$x+20$", point 1/2 of a2); drawdblarrow a3; label.top("$x$", point 1/2 of a3); draw X shifted z0; draw X shifted z1; draw X shifted z2; draw X shifted z3; draw X shifted z4; draw X shifted z5; label.ulft("B",z3); label.urt("C",z2); label.lrt("D",z1); label.llft("A",z0); label.top("E",z4); label.top("F",z5); \stopMPcode \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id} webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] How can I use a variable for a MetaPost coordinate ?
Hello list, I want to draw lines on a page. I want to pass my line coordinates as a percent of \width or \textheight, rather than as millimetres. So that if I change the page size I don't need to change the coordinates. The MWE below compiles but the pdf does not have any lines drawn on it. Is there a way of doing calculations on the coordinates for the draw using ConTexT variables like \textheight? Thank you, Peter Hopcroft -- \starttext Some text \startMPcode pickup pensquare scaled 1pt; draw (0mm,0mm)--(0mm,\textheight) withcolor red \stopMPcode More text \startMPcode pickup pensquare scaled 1pt; draw (0mm,0mm)--(0mm,50mm) scaled \numexpr\textheight/50mm\relax \stopMPcode \stoptext -- ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id} webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Problems with line numbered program listings
I'm trying to typeset some program listings with annotations alongside. I've tried both columns and tabulate but both have (different) issues: 1) Plain \typefile won't allow the line numbers to be in the text - they stay in the margin whch I don't want. 2) \typefile using a \definedtyping name does work and works in \columns as well. This is great until my listing is too long to fit on a page and then I'd rather have the column continue onto the next page but \columns balances of course. 3) \tabulate allows a single cell to continue down over the page exactly as I'd like, but the line numbers disappear altogether. (And it has to be a single cell because the program listings are in source files that I want to include using \typefile rather than re-enter to avoid typos.) You can see each of these effects with the following MWE which first needs a file called "three_lines.txt" to be created in the local directory containing the lines: one two three begin \setuplinenumbering[location=text,style=\small\tt] \starttext Location=text not working in main body \typefile[numbering=line]{three_lines.txt} But it does work if a custom typing environment is created. \definetyping[MyTyping][style=\tt] \typefile[MyTyping][numbering=line]{three_lines.txt} Still works if used in a column \startcolumns \typefile[MyTyping][numbering=line]{three_lines.txt} \column :-) \stopcolumns \blank But doesn't work if used in tabulate \starttabulate[|p|p|] \NC \typefile[MyTyping][numbering=line]{three_lines.txt} \NC No line numbers at all :-( \NR \stoptabulate \stoptext end What I'd most like is for tabulate to allow \typefile with line numbers if at all possible. — Bruce Horrocks Hampshire, UK zz.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id} webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Attempting to Generate PDF/A in LMTX
Following the instructions on https://wiki.contextgarden.net/PDF/A, I am receiving errors that the *.icc files cannot be located. I have saved the *.icc files in ~/context-osx-arm64/tex/texmf-context/colors/icc/profiles per the instructions. Here's an excerpt from the log: backend > profiles > profile specification 'default_cmyk.icc' loaded from '/Users/jinho/context-osx-arm64/tex/texmf-context/colors/icc/context/colorprofiles.xml' backend > profiles > error, couldn't locate profile 'default_cmyk.icc' backend > profiles > no default profile 'default_cmyk.icc' for colorspace 'cmyk' backend > profiles > profile specification 'default_rgb.icc' loaded from '/Users/jinho/context-osx-arm64/tex/texmf-context/colors/icc/context/colorprofiles.xml' backend > profiles > error, couldn't locate profile 'default_rgb.icc' backend > profiles > no default profile 'default_rgb.icc' for colorspace 'rgb' backend > profiles > profile specification 'default_gray.icc' loaded from '/Users/jinho/context-osx-arm64/tex/texmf-context/colors/icc/context/colorprofiles.xml' backend > profiles > error, couldn't locate profile 'default_gray.icc' backend > profiles > no default profile 'default_gray.icc' for colorspace 'gray' backend > profiles > profile specification 'ISO coated v2 300% (ECI)' loaded from '/Users/jinho/context-osx-arm64/tex/texmf-context/colors/icc/context/colorprofiles.xml' backend > profiles > error, couldn't locate profile 'ISOcoated_v2_300_eci.icc' backend > profiles > invalid output intent 'ISO Coated v2 300% (ECI)' Here is a MWE that generates these errors: setupinteraction [title=TITLE, subtitle=SUBTITLE, author=AUTHOR, keyword={{KEYWORD1, KEYWORD2}, KEYWORD3}] %% For PDF/A \setupbackend[ format={pdf/a-1b:2005}, % or pdf/a-1a:2005 profile={default_cmyk.icc,default_rgb.icc,default_gray.icc}, intent=ISO coated v2 300\letterpercent\space (ECI)] %% Tagged PDF %% method=auto ==> default tags by Adobe \setupbackend[export=yes] \setupstructure[state=start,method=auto] \starttext \chapter[chap:testing]{Testing} \input knuth \input tufte \input knuth \input tufte \input knuth \input tufte \stoptext What seems to be going wrong? Is the software looking for the *.icc profiles in a different place? Thank you! ~ Jin-Ho. -- "Ad astra per alas porci." ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Using Farad with \unit messes up feet, µ not recognised as prefix
On Tue, 3 Oct 2023 16:27:22 +0200 Marco Patzer wrote: > What about: > > \unit{10 um} > \unit{10 µm} > > Can I assign µ to mean micro (prefix)? Found it: \registerunit [prefix] [µ=micro] \starttext \unit{10 micro meter} \crlf \unit{10 µm} \stoptext Should this be the default (µ assigned to micro)? Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Using Farad with \unit messes up feet, µ not recognised as prefix
Marco Patzer schrieb am 03.10.2023 um 12:31: Hi! I struggle using the unit Farad (unit of capacitance): The unit "farad" exists. \starttext %% prints 10 10 ft \unit{10 F} \unit{20 ft} \registerunit [F=Farad] \setupunittext [Farad=F] %% prints 10 F 20 F⋅t \unit{10 F} \unit{20 ft} \stoptext When registering Farad as new unit it messes up feet. This looks like a bug to me, since “20 ft” does not contain a capital “F” and units are case-sensitive. How to use Farad correctly without messing up other units? The unit for feet is "foot" and "ft" is a combination of a prefix (femto) and a unit (tonne). You can list the individual parts in the log file with the "physics.units" tracker. To get a short unit you have to use the following method (it works because farad exists): \registerunitshortcut [F=farad] Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Using Farad with \unit messes up feet, µ not recognised as prefix
Hi! I struggle using the unit Farad (unit of capacitance): \starttext %% prints 10 10 ft \unit{10 F} \unit{20 ft} \registerunit [F=Farad] \setupunittext [Farad=F] %% prints 10 F 20 F⋅t \unit{10 F} \unit{20 ft} \stoptext When registering Farad as new unit it messes up feet. This looks like a bug to me, since “20 ft” does not contain a capital “F” and units are case-sensitive. How to use Farad correctly without messing up other units? 2nd issue: The prefix “µ” is not recognised: \starttext %% prints 10 nm 20 30 µm \unit{10 nm} \unit{20 µm} \unit{30 um} \stoptext I would expect “20 µm” to produce the correct result. Can we make “µm” also produce the same result as “um”? Marco LMTX 2023.09.04 19:15 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Frontpage and Titlepage
The following MWE is how I create my frontpage and titlepage. Is this the proper way to do so? \definemakeup [frontpage] [align=middle] \definemakeup [titlepage] \setupmakeup [titlepage] [align={right,top}, top=\vfill, pagestate=stop, style=smallbodyfont] \definealternativestyle [authorstyle] [\rm\tfb] [] \definealternativestyle [titlestyle] [\rm\bfd] [] \starttext \startmakeup [frontpage] \authorstyle {The Author} \blank \titlestyle {This is the Title} \stopmakeup \startmakeup [titlepage] \titlestyle {This is the Title} \stopmakeup \startchapter [title={Chapter Title}] \samplefile{tufte} \stopchapter \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] bibliography questions
My example is setup as advised in the manual: """ %\mainlanguage[de] \usebtxdataset[beispiel][bib_example.bib] \setupbtx[dataset=beispiel] %\usebtxdefinitions[apa] \definebtxrendering[beispiel][apa][dataset=beispiel,group=beispiele] \starttext \placelistofpublications[beispiel] \cite[authoryear] [WiFo2010] \cite[authoryear] [rattenhka] \stoptext """ But I get the error message: """ system > error: invalid parent apa for beispiel, apa defined too (best check it) system > error: invalid parent btx:apa for btx:beispiel, btx:apa defined too (best check it) """ Are these messages wrong? And why do they come from "system" and not from "publications"? My minimal example works anyway, still investigating why it doesn’t in my book. Another question: Consider: @Book {rattenhka, author = "Bettina von Arnim and Gisela von Arnim", title = "Das Leben der Hochgräfin Gritta von Rattenzuhausbeiuns", … } The authors are usually given as “Bettina and Gisela von Arnim” (mother and daughter; similar “Jacob and Wilhelm Grimm” as brothers or “Bettina and Achim von Arnim” as a couple) – is there a good solution for related authors? Hraban @Book {WiFo2010, title = "Lesetypografie", author = "Willberg, Hans Peter and Forssman, Friedrich", publisher = "Hermann Schmidt", address = "Mainz", year = "2010", language = "german", keywords = "typography", } @Book {kgdz, author = "Stephen Hawking and Leonard Mlodinow", title = "Die kürzeste Geschichte der Zeit", title:en = "A Briefer History of Time", publisher = "Rowohlt", address = "Reinbek", year = "2005", language = "german", keywords = "physics;astromy;time", } @Book {rattenhka, author = "Bettina von Arnim and Gisela von Arnim", title = "Das Leben der Hochgräfin Gritta von Rattenzuhausbeiuns", editor = "Otto Mallon", publisher = "S. Martin Fraenkel", address = "Berlin", year = "1926", language = "german", keywords = "novel;historical", } ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Bug? Text following columns at end of page goes into footer not next page
Two column text that ends near the foot of a page can push the next line into the footer rather than starting a new page. MWE for ConTeXt ver: 2023.09.26 18:19 LMTX :- \setuppapersize [A4] \showframe \starttext Knuth in knolumns \dorecurse{30}{\crlf} \startcolumns \input knuth \stopcolumns This line goes into the footer rather than the next page. \stoptext — Bruce Horrocks Hampshire, UK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: formula alignment for mathalign
Hi, On Thu, Sep 28, 2023 at 6:39 PM Aditya Mahajan wrote: > > Hi, > > The `align` parameter of `\setupformulas` is ignored in mathalign. Consider > the following MWE: > > \setupformulas[align=flushleft,leftmargin=2em] > > \starttext > \startformula > A = B > \stopformula > > vs > > \startformula \startalign > \NC A \NC B \NR > \NC A \NC B \NR > \stopalign \stopformula > \stoptext > > The first display formula is flush left, but the aligned formula is centered > on the page. This appears to be a regression compared to MkIV, where the > above example works correctly. The whole alignment mechanism was redone, and a lot focus was put on getting right placement for formula numbers and display alignment. We did not yet look into this use case, but we will. /Mikael ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] formula alignment for mathalign
Hi, The `align` parameter of `\setupformulas` is ignored in mathalign. Consider the following MWE: \setupformulas[align=flushleft,leftmargin=2em] \starttext \startformula A = B \stopformula vs \startformula \startalign \NC A \NC B \NR \NC A \NC B \NR \stopalign \stopformula \stoptext The first display formula is flush left, but the aligned formula is centered on the page. This appears to be a regression compared to MkIV, where the above example works correctly. Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: item list inside a blockquote
Pablo Rodriguez schrieb am 26.09.2023 um 20:32: On 9/26/23 12:52, gerard.degreve wrote: Hello Pablo, Just try to do this : \setupitemgroup [itemize][1] [ before={\blank[.125th]}, after={\blank[.125th]}\strut] Hi Gerard, this also works with \null, but not well with small dimensions: \showframe\showgrid\showstruts \setuppapersize[A6] \setupitemgroup [itemize][1] [ before={\blank[quarterline]}, after={\blank[quarterline]\null}] \starttext one \startblockquote \startitemize \item a. \stopitemize \stopblockquote two \stoptext I tend to think this might be a bug. The \startblockquote command removes the last skip to ensure only the space which is set by the environment appears in the output. The default method to put some space before and after the environment is to use the spacebefore and spaceafter keys. begin example \setupquotation [spacebefore=line, spaceafter=line] \starttext \samplefile{knuth} \startblockquote \samplefile{knuth-gpt} \stopblockquote \samplefile{knuthmath} \stoptext end example It would interesting to know what you're trying to achieve with your combination of itemize and blockquote. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: item list inside a blockquote
On 9/26/23 12:52, gerard.degreve wrote: > Hello Pablo, > > Just try to do this : >> \setupitemgroup >> [itemize][1] >> [ before={\blank[.125th]}, >> after={\blank[.125th]}\strut] Hi Gerard, this also works with \null, but not well with small dimensions: \showframe\showgrid\showstruts \setuppapersize[A6] \setupitemgroup [itemize][1] [ before={\blank[quarterline]}, after={\blank[quarterline]\null}] \starttext one \startblockquote \startitemize \item a. \stopitemize \stopblockquote two \stoptext I tend to think this might be a bug. Many thanks for your help again, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: item list inside a blockquote
gerard.degreve: Hello Pablo, Just try to do this : \setupitemgroup [itemize][1] [ before={\blank[.125th]}, after={\blank[.125th]}\strut] Regards, Gerard Le 25-09-23 19:26:08, Pablo Rodriguez a écrit : Dear list, I have the following sample: \setuppapersize[A6] \setupitemgroup [itemize][1] [ before={\blank[.125th]}, after={\blank[.125th]}] \starttext one \startblockquote \startitemize \item a \stopitemize \stopblockquote two \stoptext The blockquote disables the space after the list, but not before. Have I hit a bug or am I missing something? Many thanks for your help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___ -- Cet e-mail a été vérifié par le logiciel antivirus d'Avast. www.avast.com___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] item list inside a blockquote
Dear list, I have the following sample: \setuppapersize[A6] \setupitemgroup [itemize][1] [ before={\blank[.125th]}, after={\blank[.125th]}] \starttext one \startblockquote \startitemize \item a \stopitemize \stopblockquote two \stoptext The blockquote disables the space after the list, but not before. Have I hit a bug or am I missing something? Many thanks for your help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: \setupitemgroup for footnotes
Am 25.09.23 um 17:52 schrieb Pablo Rodriguez: Dear list, I have the following sample (with current latest from 2023.09.18 21:13): \setuppapersize[A6] \starttext \startsetups[forfootnote] \setupitemgroup [itemize][1] [ before={\endgraf{\ttbf[before]}\endgraf}, after={\endgraf{\ttbf [after]}\endgraf}] \stopsetups \setupnote[footnote][setups=forfootnote] \footnote{\startitemize \startitem Choose the correct answer. \startitemize \item This one \stopitemize \stopitem \stopitemize} \stoptext Excuse my ignorance, but which is the right way to get the itemize setup only for footnotes? I would use \defineitemgroup to define your own, like "footnoteitemize". https://wiki.contextgarden.net/Command/defineitemgroup Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] \setupitemgroup for footnotes
Dear list, I have the following sample (with current latest from 2023.09.18 21:13): \setuppapersize[A6] \starttext \startsetups[forfootnote] \setupitemgroup [itemize][1] [ before={\endgraf{\ttbf[before]}\endgraf}, after={\endgraf{\ttbf [after]}\endgraf}] \stopsetups \setupnote[footnote][setups=forfootnote] \footnote{\startitemize \startitem Choose the correct answer. \startitemize \item This one \stopitemize \stopitem \stopitemize} \stoptext Excuse my ignorance, but which is the right way to get the itemize setup only for footnotes? Many thanks for your help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Issue : compilation error when using mathcases with pagella fonts (and others)
On 9/24/2023 5:17 PM, Pablo Rodriguez wrote: On 9/24/23 15:49, Mikael Sundqvist wrote: Hi, Not that it helps you much, but your example works fine here, and it gives the expected result. Hi Mikael, I get exactly the same compilation error as Vicent. I tried a brand new installation (with http://lmtx.pragma-ade.nl/install-lmtx/context-linux-64.zip) and I got the same error again. Just in case it might help, Pablo PS: here is the error again: tex error > tex error on line 10 in file ./a.tex: lua error: run callback [44]: ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:56: table index is nil stack traceback: ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:56: in metamethod 'index' ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:104: in function <...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:62> [C]: in upvalue 'builders_kernel_mlisttohlist' [string "local tonut = nodes.tonut..."]:43: in function <[string "local tonut = nodes.tonut..."]:18> (...tail calls...) ...ext/tex/texmf-context/tex/context/base/mkxl/math-noa.lmt:2986: in function <...ext/tex/texmf-context/tex/context/base/mkxl/math-noa.lmt:2984> 1 \setupbodyfont[pagella] 2 3 \starttext 4 \startformula 5 \delta_{ij} = 6 \startmathcases 7 \NC 1 \NC \text{if } i = j \NR 8 \NC 0 \NC \text{otherwise} \NR 9 \stopmathcases 10 >> \stopformula 11 \stoptext i'll check it tomorrow (witk mikael who has a newer bin and first we need to test some other math things) ... i probably need some temp hack because the build farm is still down (an extra callback argument was added a while ago) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Issue : compilation error when using mathcases with pagella fonts (and others)
On 9/24/23 15:49, Mikael Sundqvist wrote: > Hi, > > Not that it helps you much, but your example works fine here, and it > gives the expected result. Hi Mikael, I get exactly the same compilation error as Vicent. I tried a brand new installation (with http://lmtx.pragma-ade.nl/install-lmtx/context-linux-64.zip) and I got the same error again. Just in case it might help, Pablo PS: here is the error again: tex error > tex error on line 10 in file ./a.tex: lua error: run callback [44]: ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:56: table index is nil stack traceback: ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:56: in metamethod 'index' ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:104: in function <...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:62> [C]: in upvalue 'builders_kernel_mlisttohlist' [string "local tonut = nodes.tonut..."]:43: in function <[string "local tonut = nodes.tonut..."]:18> (...tail calls...) ...ext/tex/texmf-context/tex/context/base/mkxl/math-noa.lmt:2986: in function <...ext/tex/texmf-context/tex/context/base/mkxl/math-noa.lmt:2984> 1 \setupbodyfont[pagella] 2 3 \starttext 4 \startformula 5 \delta_{ij} = 6 \startmathcases 7 \NC 1 \NC \text{if } i = j \NR 8 \NC 0 \NC \text{otherwise} \NR 9 \stopmathcases 10 >> \stopformula 11 \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Issue : compilation error when using mathcases with pagella fonts (and others)
Hi, Not that it helps you much, but your example works fine here, and it gives the expected result. /Mikael On Sun, Sep 24, 2023 at 1:42 PM Vincent Picard wrote: > > Hello, > > Since ConTexT last upgrade (ltmx 2023.09.18 21:13), I have a document that > won't compile with ConTexT. The problem seems to occur when using mathcases > with some ConTeXt provided fonts, including pagella. This is a minimal not > working example : > > \setupbodyfont[pagella] > > \starttext > \startformula > \delta_{ij} = > \startmathcases > \NC 1 \NC \text{if } i = j \NR > \NC 0 \NC \text{otherwise} \NR > \stopmathcases > \stopformula > \stoptext > > The error is : > run callback [44]: > ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:56: table index > is nil\nstack traceback:\n > ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:56: in metamethod > 'index'\n ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:104: in > function <...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:62>\n > [C]: in upvalue 'builders_kernel_mlisttohlist'\n [string \"local tonut = > nodes.tonut...\"]:43: in function <[string \"local tonut = > nodes.tonut...\"]:18>\n (...tail calls...)\n > ...ext/tex/texmf-context/tex/context/base/mkxl/math-noa.lmt:2986: in function > <...ext/tex/texmf-context/tex/context/base/mkxl/math-noa.lmt:2984> > > My system is : FreeBSD 64bits > > Thank you for any help. > Sincerely, > Vincent Picard > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Issue : compilation error when using mathcases with pagella fonts (and others)
Hello, Since ConTexT last upgrade (ltmx 2023.09.18 21:13), I have a document that won't compile with ConTexT. The problem seems to occur when using mathcases with some ConTeXt provided fonts, including pagella. This is a minimal not working example : \setupbodyfont[pagella] \starttext \startformula \delta_{ij} = \startmathcases \NC 1 \NC \text{if } i = j \NR \NC 0 \NC \text{otherwise} \NR \stopmathcases \stopformula \stoptext The error is : run callback [44]: ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:56: table index is nil\nstack traceback:\n ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:56: in metamethod 'index'\n ...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:104: in function <...ext/tex/texmf-context/tex/context/base/mkxl/math-fnt.lmt:62>\n [C]: in upvalue 'builders_kernel_mlisttohlist'\n [string \"local tonut = nodes.tonut...\"]:43: in function <[string \"local tonut = nodes.tonut...\"]:18>\n (...tail calls...)\n ...ext/tex/texmf-context/tex/context/base/mkxl/math-noa.lmt:2986: in function <...ext/tex/texmf-context/tex/context/base/mkxl/math-noa.lmt:2984> My system is : FreeBSD 64bits Thank you for any help. Sincerely, Vincent Picard ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Install fonts on MS Windows
Thanks a lot everybody ! Thank you all for the clarifying information! The problem has been solved using the command recommended by Pablo. All my attempts to clear the Windows font cache have failed, except for this one: mtxrun --script cache --erase && mtxrun --generate I started by copying the fonts into the \texmf-fontes\data\ directory, then I emptied the cache. Then, the following command: mtxrun --script fonts --list --pattern=didot --all works and correctly returns otf and ttf theano and gfs fonts. And thanks to Andres : your MWE compiles perfectly ! Now, I must confess that I don't know why installing new fonts in c:\windows\fonts, even after laboriously purging the Windows font cache and reloading the CTX font cache, didn't have the expected effects ... Le 24/09/2023 à 07:50, Andres Conrado Montoya a écrit : I did a test with Windows 10. Installed a fresh copy from the garden, Got the GFS Didot font from Google Fonts, and installed it system-wide (C:\Windows\fonts). After that, I ran mtxrun --script fonts --reload Then tried the pattern suggested but did not work. However, then I tried a pattern without asterisks: mtxrun --script fonts --list --pattern=didot --all This returned the font: C:\griego>mtxrun --script fonts --list --pattern=didot --all identifier familyname fontname filename subfont instances gfsdidot gfsdidot gfsdidotregular c:/windows/fonts/GFSDidot-Regular.ttf gfsdidotnormal gfsdidot gfsdidotregular c:/windows/fonts/GFSDidot-Regular.ttf gfsdidotregular gfsdidot gfsdidotregular c:/windows/fonts/GFSDidot-Regular.ttf theanodidot theanodidot theanodidotregular c:/windows/fonts/TheanoDidot-Regular.ttf theanodidotnormal theanodidot theanodidotregular c:/windows/fonts/TheanoDidot-Regular.ttf theanodidotregular theanodidot theanodidotregular c:/windows/fonts/TheanoDidot-Regular.ttf trying to render Pablo's example didn't work at first, but after i called the fonts with the name returned by mtxrun: \mainlanguage[agr] \definefontfamily[mainface][rm][gfsdidot] \definefontfamily[mainface][ss][theanodidot] \setupbodyfont[mainface] \starttext GFS Didot: \doloopoverlist{\tf, \it, \bf, \bi} {\recursestring\input aristotle-grc\par} \ss Theano Didot: \input aristotle-grc \stoptext Everything compiles correctly, and the font is used. Since it's only a single font file with no variants, you don´t get italics, bold etc. But the font is being used. -- Andrés Conrado Montoya Andi Kú andresconr...@gmail.com http://sesentaycuatro.com http://messier87.com http://chiquitico.org Los fines no justifican los medios, porque la medida verdadera de nuestro carácter está dada por los medios que estamos dispuestos a utilizar, no por los fines que proclamamos. “You develop an instant global consciousness, a people orientation, an intense dissatisfaction with the state of the world, and a compulsion to do something about it. From out there on the moon, international politics look so petty. You want to grab a politician by the scruff of the neck and drag him a quarter of a million miles out and say, ‘Look at that, you son of a bitch.’” — Apollo 14 astronaut Edgar Mitchell ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist :ntg-context@ntg.nl /https://www.ntg.nl/mailman/listinfo/ntg-context webpage :https://www.pragma-ade.nl /http://context.aanhet.net archive :https://bitbucket.org/phg/context-mirror/commits/ wiki :https://contextgarden.net ___ -- Jean-Pierre Delange Ancients "Few discoveries are more irritating than those which expose the pedigree of ideas". Lord Acton ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Install fonts on MS Windows
I did a test with Windows 10. Installed a fresh copy from the garden, Got the GFS Didot font from Google Fonts, and installed it system-wide (C:\Windows\fonts). After that, I ran mtxrun --script fonts --reload Then tried the pattern suggested but did not work. However, then I tried a pattern without asterisks: mtxrun --script fonts --list --pattern=didot --all This returned the font: C:\griego>mtxrun --script fonts --list --pattern=didot --all identifier familynamefontname filename subfont instances gfsdidot gfsdidot gfsdidotregular c:/windows/fonts/GFSDidot-Regular.ttf gfsdidotnormal gfsdidot gfsdidotregular c:/windows/fonts/GFSDidot-Regular.ttf gfsdidotregular gfsdidot gfsdidotregular c:/windows/fonts/GFSDidot-Regular.ttf theanodidot theanodidot theanodidotregular c:/windows/fonts/TheanoDidot-Regular.ttf theanodidotnormaltheanodidot theanodidotregular c:/windows/fonts/TheanoDidot-Regular.ttf theanodidotregular theanodidot theanodidotregular c:/windows/fonts/TheanoDidot-Regular.ttf trying to render Pablo's example didn't work at first, but after i called the fonts with the name returned by mtxrun: \mainlanguage[agr] \definefontfamily[mainface][rm][gfsdidot] \definefontfamily[mainface][ss][theanodidot] \setupbodyfont[mainface] \starttext GFS Didot: \doloopoverlist{\tf, \it, \bf, \bi} {\recursestring\input aristotle-grc\par} \ss Theano Didot: \input aristotle-grc \stoptext Everything compiles correctly, and the font is used. Since it's only a single font file with no variants, you don´t get italics, bold etc. But the font is being used. -- Andrés Conrado Montoya Andi Kú andresconr...@gmail.com http://sesentaycuatro.com http://messier87.com http://chiquitico.org Los fines no justifican los medios, porque la medida verdadera de nuestro carácter está dada por los medios que estamos dispuestos a utilizar, no por los fines que proclamamos. “You develop an instant global consciousness, a people orientation, an intense dissatisfaction with the state of the world, and a compulsion to do something about it. From out there on the moon, international politics look so petty. You want to grab a politician by the scruff of the neck and drag him a quarter of a million miles out and say, ‘Look at that, you son of a bitch.’” — Apollo 14 astronaut Edgar Mitchell ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Install fonts on MS Windows
On 9/23/23 14:40, Jean-Pierre Delange wrote: > Dear list, > I have a very simple question, perhaps too simple... > I've installed CTX on MSWindows x64, but I can't use the fonts I've > installed, despite the command: set > OSFONTDIR=c:\windows\fonts;c:\windows\users\adeimantos\context\texmf\fonts. Dear Jean-Pierre, only if you don’t have no way to install fonts on the OS directory for fonts (%WINDIR%\Fonts in Windows), I would use (in that order): 1. %USERPROFILE%\texmf\texmf-fonts\, or as last option 2. [context-dir]\tex\texmf-local\texmf-fonts\ Excuse me if this is obvious to you, %USERPROFILE% is a Windows variable (Windows variables, once defined, are invoked enclosed in percent signs [such as in %variable%] and they are case-insensitive). %USERPROFILE% in Windows is $HOME in Unix. [context-dir] is no variable. It means the path were you have your ConTeXt distribution installed (in case you have a ConTeXt only distribution, and not TeX Live installed [I mean, a full text distribution). BTW, do you really have a directory C:\Windows\Users\adeimantos? Sorry, but I think it reads C:\Users\adeimantos (actually, this would be the value of the Windows variable %USERPROFILE% when you are logged in). [More on Windows variables, https://ss64.com/nt/syntax-variables.html.] > I cleared the Windows font cache, restarted the machine, then reloaded > with the command : > mtxrun --script fonts --reload I think it is better the following: mtxrun --script cache --erase && mtxrun --generate It erases the whole cache, which will be generated in your next ConTeXt run. > A search for the fonts I had installed (theano didot and gfs didot) gave > no results with : > > mtxrun --script fonts --list --pattern=*gfs* --all. I think this would do the trick. Compile the following source: \mainlanguage[agr] \definefontfamily[mainface][rm][GFS Didot] \definefontfamily[mainface][ss][Theano Didot] \setupbodyfont[mainface] \starttext \doloopoverlist{\tf, \it, \bf, \bi} {\recursestring\input aristotle-grc\par} \ss\input aristotle-grc \stoptext So you will see whether ConTeXt is able to read the fonts or not (if they are embedded in the output PDF document or not). > I admit that I don't know in which directory it is best to install the > fonts for optimum performance. If you install the fonts in %WINDIR%\Fonts (Windows font directory), the will be available for any program. In some cases, this is important, even when using only with ConTeXt. If you need only in TeX, %USERPROFILE%\texmf\texmf-fonts\ would be a good option. But even if you choose the third option above (numbered as two), you don’t need to set the OSFONTDIR variable. On Windows and macOS, the OS font directory is set by ConTeXt itself. The other two directories are also defined. BTW, where have you copied both fonts? Just in case it might help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: stackrel in context?
Hi, On Thu, Sep 21, 2023 at 4:34 PM Hans Hagen wrote: > > On 9/21/2023 2:40 PM, Aditya Mahajan wrote: > > On Thu, 21 Sep 2023, Hans Hagen wrote: > > > >> a teaser for Aditya: > >> > >> \definemathstackers[toprel][top][mathclass=\mathrelationcode] > >> \definemathstackers[topbin][top][mathclass=\mathbinarycode] > >> > >> \definemathextensible[toprel][frownedupon]["2322] > >> \definemathextensible[topbin][frowned]["2322] > >> > >> \starttext > >> $x \frownedupon{4} y + \frowned{!} z = 10$ > >> \stoptext > > > > Interesting, but I think that the OP wanted to use \frown as an accent, > \definemathaccent[topfake][top][offset=auto] > > \definemathtopaccent[topfake][frowned]["2322] > > \starttext > $ x + \frowned{4} = 10$ > \stoptext > > when you add in math-acc the offset option after the alignsymbol option > > \ifcstok{\mathaccentparameter\c!alignsymbol}\v!yes > \s!nooverflow\space > \fi > \ifcstok{\mathaccentparameter\c!offset}\v!auto > \s!base\space > \fi > > and someplace > > \definesystemconstant {base} > > (a patching exercise) > > Hans Nice with offset=auto. It is not clear to me what the intent/meaning is of the original example, but one can also try the 23DC (can extend as \overparent): \definemathtopaccent[topfake][frowned]["2322] \definemathtopaccent[topfake][Frowned]["23DC] \starttext $ x + \frowned{4} = 10$ $ x + \Frowned{4} = 10$ $ x + \Frowned{} = 10$ $ x + \overparent{4} = 10$ $ x + \overparent{} = 10$ \stoptext /Mikael ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] page floats don’t work in columnsets
I had no luck with page floats in columnsets; according to the manual they should work. Hraban \setuppapersize[A5,landscape] \useMPlibrary[dum] \definecolumnset[Two][n=2] \starttext \startcolumnset[Two] \dorecurse{5}{1\recurselevel\samplefile{lorem}\par} \startplacefigure[location=page,title={my caption}]% \externalfigure[dummy][width=2\textwidth,height=.95\textheight]% \stopplacefigure \dorecurse{5}{2\recurselevel\samplefile{lorem}\par} \stopcolumnset \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___