Re: [NTG-context] Can modes be used for content control?
On 11/17/2021 12:25 AM, Idris Samawi Hamid ادريس سماوي حامد via ntg-context wrote: Dear gang, For creating/authoring content in ConTeXt: Can modes or the like be used for content control? For example, someone wants to write at least two versions of a book managed from a single file. So, e.g., we may have a) abridged content b) unabridged content - includes a) c) abridged content + translation d) unabridged content + translation [:] One can author and organize this in XML - pre-ConteXt - but perhaps one prefers to write in ConTeXt (take advantage of shortcuts etc.). So maybe \defineparagraphs[unabridged] \defineparagraphs[abridged] \defineparagraphs[translation] Then one authors the complete work in a single project, but you can produce a variety of versions, depending on the mode chosen: \definemode[unabridged] etc. Can one do this in context? If so, does anyone have some working example of how to do it? Might even be worth a MyWay if not too unwieldy.. Thank you in advance! see tests files in blocks path of test suite ... one of the oldest mechanisms in context (as we needed it for on source multiple output in educational documents) 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 / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Can modes be used for content control?
Hi Aditya, Many thanks; see below: On Tue, 16 Nov 2021 17:23:59 -0700, Aditya Mahajan via ntg-context wrote: On Tue, 16 Nov 2021, Idris Samawi Hamid ادريس سماوي حامد via ntg-context wrote: Dear gang, For creating/authoring content in ConTeXt: Can modes or the like be used for content control? For example, someone wants to write at least two versions of a book managed from a single file. So, e.g., we may have a) abridged content b) unabridged content - includes a) c) abridged content + translation d) unabridged content + translation [:] One can author and organize this in XML - pre-ConteXt - but perhaps one prefers to write in ConTeXt (take advantage of shortcuts etc.). So maybe \defineparagraphs[unabridged] \defineparagraphs[abridged] \defineparagraphs[translation] Then one authors the complete work in a single project, but you can produce a variety of versions, depending on the mode chosen: \definemode[unabridged] etc. Can one do this in context? Yes! This is what I do (for solutions in homework assignments): \definebuffer[solution][local=yes,nested=yes] \startmode[solution] \defineenumeration[solution][fancy setup...] \stopmode Then, in the main tex file: \startsolution ... \stopsolution By default, gives the version without solution. Compile with --mode=solution to get the version with solution. The same thing should work in your case by defining two modes: unabridged and translation. And then use --mode=unabridged,translate etc to get multiple modes. Here's a working sample: === % \definebuffer[unabridged] % \definebuffer[abridged] \setupwhitespace[big] \starttext \startmode[unabridged] \input knuth \startblockquote \input ward \stopblockquote % \startmode[abridged] % \input knuth % \stopmode \stopmode \startmode[abridged] \input knuth \stopmode % \startmode[abridged] % \input zapf % \stopmode \stoptext === Unfortunately - as pointed out on the wiki - modes cannot be nested. Furthermore, each mode is unique and there is apparently no inheritance/continuance. So using this method appears to be quite unwieldy for book-length projects. What is needed is something like this \startmode[abridged] \input knuth \startmode[unabridged] \startblockquote \input ward \stopblockquote \stopmode \input zapf \stopmode That is not supported, so need to find another method - assuming there even is one. Otherwise will have to consider XML authoring and process the selected tags in ConTeXt.. Best wishes Idris -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Can modes be used for content control?
On Tue, 16 Nov 2021, Idris Samawi Hamid ادريس سماوي حامد via ntg-context wrote: > Dear gang, > > For creating/authoring content in ConTeXt: Can modes or the like be used > for content control? For example, someone wants to write at least two > versions of a book managed from a single file. So, e.g., we may have > > a) abridged content > b) unabridged content - includes a) > c) abridged content + translation > d) unabridged content + translation > [:] > > One can author and organize this in XML - pre-ConteXt - but perhaps one > prefers to write in ConTeXt (take advantage of shortcuts etc.). So maybe > > \defineparagraphs[unabridged] > \defineparagraphs[abridged] > \defineparagraphs[translation] > > Then one authors the complete work in a single project, but you can > produce a variety of versions, depending on the mode chosen: > > \definemode[unabridged] > etc. > > Can one do this in context? Yes! This is what I do (for solutions in homework assignments): \definebuffer[solution][local=yes,nested=yes] \startmode[solution] \defineenumeration[solution][fancy setup...] \stopmode Then, in the main tex file: \startsolution ... \stopsolution By default, gives the version without solution. Compile with --mode=solution to get the version with solution. The same thing should work in your case by defining two modes: unabridged and translation. And then use --mode=unabridged,translate etc to get multiple modes. Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Can modes be used for content control?
Dear gang, For creating/authoring content in ConTeXt: Can modes or the like be used for content control? For example, someone wants to write at least two versions of a book managed from a single file. So, e.g., we may have a) abridged content b) unabridged content - includes a) c) abridged content + translation d) unabridged content + translation [:] One can author and organize this in XML - pre-ConteXt - but perhaps one prefers to write in ConTeXt (take advantage of shortcuts etc.). So maybe \defineparagraphs[unabridged] \defineparagraphs[abridged] \defineparagraphs[translation] Then one authors the complete work in a single project, but you can produce a variety of versions, depending on the mode chosen: \definemode[unabridged] etc. Can one do this in context? If so, does anyone have some working example of how to do it? Might even be worth a MyWay if not too unwieldy.. Thank you in advance! Best wishes Idris -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Checking for a macro in a string without expanding it
I'm not sure if my mind is twisted enough! I can follow how Jairo's answer works, and that does what I need it to, but it's not as clear to me what the last two TeX-only approaches are doing at a low level. Perhaps more importantly, I should clarify that for my purposes, the \MyOuter macro is the \currentbtxrighttext macro, which is defined in a separate module that I'd prefer not to modify. I want to be able to detect and parse the parameters of a \loc macro that a user can specify in a citation as follows: ``` \cite[lefttext={See}, righttext={\loc[vol=8,p=223] for further details}][clementinehomilies] ``` Because the locator parameters may need to be parenthesized or formatted differently depending on the category of the bibliography entry, they should be typeset separately from the plain part of the righttext. This is why I'd like to be able to parse the parameters and then expand the \loc macro itself as empty when the righttext is typeset. Joey On Tue, Nov 16, 2021 at 4:19 PM Hans Hagen via ntg-context < ntg-context@ntg.nl> wrote: > On 11/16/2021 9:09 PM, Jairo A. del Rio via ntg-context wrote: > > If I understand it correctly, you may need something like this...? > > > > % Protection is key > > \protected\def\inner[#1]{\empty} > > % \outer is (or was) already defined in \CONTEXT > > % Please use another name > > \def\Outer{\inner[123] and \inner[some text] etc.} > > \startluacode > > local implement = interfaces.implement > > local argument = tokens.scanners.argument > > local function parseinner() > >local r = {} > >local str = argument() > >str = str:gsub("\\inner%s*(%b[])",function(s)r[#r+1] = > s:sub(2,#s-1)end) > >context(table.concat(r," ")) -- Change " " by another spacer if needed > > end > > implement{name = "parseinner", public = true, actions = parseinner} > > \stopluacode > > \starttext > > \parseinner{\Outer} > > \stoptext > > > > However, this will only work with very simple cases (no nesting, etc.). > > Hope this helps. > well, if we start talking weird code ... > > \starttext > > \tolerant\def\MyInnerOuter#1\MyInner[#2]#3\MyDone\ignorearguments{#2} > > \def\MyOuter#1{\MyInnerOuter#1\MyDone\ignorearguments} > > whatever: \MyOuter{\MyInner[oeps]}\par > whatever: \MyOuter{\InnerMy[oeps]}\par > > \edef\ItWorksA{\MyOuter{\MyInner[oeps]}} > \edef\ItWorksB{\MyOuter{\InnerMy[oeps]}} > > whatever: \meaningless\ItWorksA\par > whatever: \meaningless\ItWorksB\par > > \stoptext > > (1) we're tolerant so no problem when no match > (2) the ignore hack quits scanning because tex will keep looking > > it's pretty fast and needs no lua magic, only a twisted mind > > 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 / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] SimpleSlides and Visual counters
Hi Aditya, Thank you for your attention and your kind reply. I am sending a setup file with an example of presentation, which shows the issue with LMTX while with mkiv the result is fine. Actually as you can see in the setup file, I have slightly modified the visula counter in order for it to be interactive (clicking in the center of the visula counter gives a jump to the previous location…). Best regards: Otared presentation.tex Description: Binary data conf-pre-setup.tex Description: Binary data > On 16 Nov 2021, at 18:34, Aditya Mahajan via ntg-context > wrote: > > On Mon, 15 Nov 2021, Otared Kavian via ntg-context wrote: > > Hi Otared, > >> It seems that the visual counter in SimpleSlides module (the version I have >> from ConTeXt Garden is from 2014) does not work fine with the latest LMTX. >> Is the issue is known ? If so, is there a new version of SimpleSlides in >> which the issue has been fixed ? > > I haven't looked at simpleslides in over a decade! The module did use some > low-level macros, which are unlikely to work with LMTX without change. > > It could also be a bug with visualcounter module. I haven't tested in with > LMTX (I still use MkIV for most of my presentations). If you can post a > minimal example, I could take a look. > > Thanks, > Aditya > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Checking for a macro in a string without expanding it
On 11/16/2021 9:09 PM, Jairo A. del Rio via ntg-context wrote: If I understand it correctly, you may need something like this...? % Protection is key \protected\def\inner[#1]{\empty} % \outer is (or was) already defined in \CONTEXT % Please use another name \def\Outer{\inner[123] and \inner[some text] etc.} \startluacode local implement = interfaces.implement local argument = tokens.scanners.argument local function parseinner() local r = {} local str = argument() str = str:gsub("\\inner%s*(%b[])",function(s)r[#r+1] = s:sub(2,#s-1)end) context(table.concat(r," ")) -- Change " " by another spacer if needed end implement{name = "parseinner", public = true, actions = parseinner} \stopluacode \starttext \parseinner{\Outer} \stoptext However, this will only work with very simple cases (no nesting, etc.). Hope this helps. well, if we start talking weird code ... \starttext \tolerant\def\MyInnerOuter#1\MyInner[#2]#3\MyDone\ignorearguments{#2} \def\MyOuter#1{\MyInnerOuter#1\MyDone\ignorearguments} whatever: \MyOuter{\MyInner[oeps]}\par whatever: \MyOuter{\InnerMy[oeps]}\par \edef\ItWorksA{\MyOuter{\MyInner[oeps]}} \edef\ItWorksB{\MyOuter{\InnerMy[oeps]}} whatever: \meaningless\ItWorksA\par whatever: \meaningless\ItWorksB\par \stoptext (1) we're tolerant so no problem when no match (2) the ignore hack quits scanning because tex will keep looking it's pretty fast and needs no lua magic, only a twisted mind 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 / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Checking for a macro in a string without expanding it
On 11/16/2021 8:22 PM, Joey McCollum via ntg-context wrote: As the subject of this question suggests, this is really more of a question about expansion control (a topic that is still a bit obscure to me). Suppose I have a macro \inner that expects a single argument or an assignment of parameters in brackets. For my purposes, I don't want this macro to do anything when it is typeset, so I'll just define it as empty: ``` \def\inner[#1]\empty ``` Now suppose I have another macro \outer that invokes this macro with some specific input and sets some plain text after it: ``` \def\outer{\inner[123] etc.} ``` What I'd like to do is parse the argument of \inner in \outer. I was hoping that a string search in Lua would work, but I'm not having any luck. A minimal (non)-working example is included below: ``` \def\inner[#1]\empty \def\outer{\inner[123] etc.} \startluacode local userdata = userdata or {} function userdata.parseinner(str) local innerparams = "" if string.find(str, "\\inner(%b[])") then i, j = string.find(str, "\\inner(%b[])") innerparams = string.sub(str, i+1, j-1) -- we just want the content inside the brackets end context(innerparams) return end \stopluacode \def\parseinner#1{\ctxlua{userdata.parseinner([==[#1]==])}} \starttext Testing:\blank \parseinner{\outer} \stoptext ``` My problem is that when I pass \outer to the \parseinner macro, it gets fully expanded, so there isn't anything left to match "\\inner%b[]". Is there a way to expand \outer when I pass it to the \parseinner macro without also expanding the \inner macro inside it? Or is there some other preferred way of doing this? One can always abuse native tex: \starttext \def\MyOuter#1% {\beginlocalcontrol % hides the next \let\Indeed\empty \def\MyInner[##1]{\gdef\Indeed{##1}}% \setbox\scratchbox\hpack{#1}% \endlocalcontrol % but only if needed \Indeed} whatever: \MyOuter{\MyInner[oeps]}% \edef\ItWorks{\MyOuter{\MyInner[oeps]}} whatever: \meaningless\ItWorks \stoptext -- - 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 / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Checking for a macro in a string without expanding it
If I understand it correctly, you may need something like this...? % Protection is key \protected\def\inner[#1]{\empty} % \outer is (or was) already defined in \CONTEXT % Please use another name \def\Outer{\inner[123] and \inner[some text] etc.} \startluacode local implement = interfaces.implement local argument = tokens.scanners.argument local function parseinner() local r = {} local str = argument() str = str:gsub("\\inner%s*(%b[])",function(s)r[#r+1] = s:sub(2,#s-1)end) context(table.concat(r," ")) -- Change " " by another spacer if needed end implement{name = "parseinner", public = true, actions = parseinner} \stopluacode \starttext \parseinner{\Outer} \stoptext However, this will only work with very simple cases (no nesting, etc.). Hope this helps. Best regards, Jairo El mar, 16 de nov. de 2021 a la(s) 14:22, Joey McCollum via ntg-context ( ntg-context@ntg.nl) escribió: > As the subject of this question suggests, this is really more of a > question about expansion control (a topic that is still a bit obscure to > me). Suppose I have a macro \inner that expects a single argument or an > assignment of parameters in brackets. For my purposes, I don't want this > macro to do anything when it is typeset, so I'll just define it as empty: > > ``` > \def\inner[#1]\empty > ``` > > Now suppose I have another macro \outer that invokes this macro with some > specific input and sets some plain text after it: > > ``` > \def\outer{\inner[123] etc.} > ``` > > What I'd like to do is parse the argument of \inner in \outer. I was > hoping that a string search in Lua would work, but I'm not having any luck. > A minimal (non)-working example is included below: > > ``` > > \def\inner[#1]\empty > > \def\outer{\inner[123] etc.} > > > \startluacode > > local userdata = userdata or {} > > function userdata.parseinner(str) > > local innerparams = "" > > if string.find(str, "\\inner(%b[])") then > > i, j = string.find(str, "\\inner(%b[])") > > innerparams = string.sub(str, i+1, j-1) -- we just want the content > inside the brackets > > end > > context(innerparams) > > return > > end > > \stopluacode > > \def\parseinner#1{\ctxlua{userdata.parseinner([==[#1]==])}} > > > \starttext > > Testing:\blank > > \parseinner{\outer} > > \stoptext > ``` > > My problem is that when I pass \outer to the \parseinner macro, it gets > fully expanded, so there isn't anything left to match "\\inner%b[]". Is > there a way to expand \outer when I pass it to the \parseinner macro > without also expanding the \inner macro inside it? Or is there some other > preferred way of doing this? > > Joey > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Checking for a macro in a string without expanding it
As the subject of this question suggests, this is really more of a question about expansion control (a topic that is still a bit obscure to me). Suppose I have a macro \inner that expects a single argument or an assignment of parameters in brackets. For my purposes, I don't want this macro to do anything when it is typeset, so I'll just define it as empty: ``` \def\inner[#1]\empty ``` Now suppose I have another macro \outer that invokes this macro with some specific input and sets some plain text after it: ``` \def\outer{\inner[123] etc.} ``` What I'd like to do is parse the argument of \inner in \outer. I was hoping that a string search in Lua would work, but I'm not having any luck. A minimal (non)-working example is included below: ``` \def\inner[#1]\empty \def\outer{\inner[123] etc.} \startluacode local userdata = userdata or {} function userdata.parseinner(str) local innerparams = "" if string.find(str, "\\inner(%b[])") then i, j = string.find(str, "\\inner(%b[])") innerparams = string.sub(str, i+1, j-1) -- we just want the content inside the brackets end context(innerparams) return end \stopluacode \def\parseinner#1{\ctxlua{userdata.parseinner([==[#1]==])}} \starttext Testing:\blank \parseinner{\outer} \stoptext ``` My problem is that when I pass \outer to the \parseinner macro, it gets fully expanded, so there isn't anything left to match "\\inner%b[]". Is there a way to expand \outer when I pass it to the \parseinner macro without also expanding the \inner macro inside it? Or is there some other preferred way of doing this? Joey ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] new upload, new trickery
On 11/16/2021 2:52 PM, Marcus Vinicius Mesquita via ntg-context wrote: Hi, Hans I tried to run your first example, but ConTeXt throws an error and complains that \resetleftparbox was never defined. Using version: 2021.11.13 it evolved a bit (see low level manual) or typo-lbx \resetlocalbox[left] etc as we have installable boxes (that can individually be set and reset) 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 / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] SimpleSlides and Visual counters
On Mon, 15 Nov 2021, Otared Kavian via ntg-context wrote: Hi Otared, > It seems that the visual counter in SimpleSlides module (the version I have > from ConTeXt Garden is from 2014) does not work fine with the latest LMTX. > Is the issue is known ? If so, is there a new version of SimpleSlides in > which the issue has been fixed ? I haven't looked at simpleslides in over a decade! The module did use some low-level macros, which are unlikely to work with LMTX without change. It could also be a bug with visualcounter module. I haven't tested in with LMTX (I still use MkIV for most of my presentations). If you can post a minimal example, I could take a look. Thanks, Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] unknown script
On Tue, 16 Nov 2021, skyhorse--- via ntg-context wrote: > > OS: Linux (Ubuntu 20.04.3) > /opt/context-lmtx and all directories and files in it are owned by user > and not root. > > I've had this problem before but forgot how to deal with it and neglected to > make a not of it. > I deleted all old context files and did a fresh install of context-lmtx > without su priveledges today. When attempting to typeset a lmtx source file I > get an 'unknown script' error. > > Here's what pops up on my display screen: > > $ context simple-example.lmtx > resolvers | resolving | configuration files already identified > resolvers | resolving | loading configuration file > 'selfautoparent:/texmf/web2c/texmfcnf.lua' > resolvers | resolving | > resolvers | resolving | locating list of '/opt/context-lmtx/tex/texmf' > (runtime) (tree:opt/context-lmtx/tex/texmf) > resolvers | methods | resolving, method 'locators', how 'uri', handler > 'tree', argument 'tree:opt/context-lmtx/tex/texmf' > resolvers | trees | locator '/opt/context-lmtx/tex/texmf' found > resolvers | resolving | hash '/opt/context-lmtx/tex/texmf' appended > resolvers | resolving | > resolvers | methods | resolving, method 'generators', how 'uri', > handler 'file', argument '/opt/context-lmtx/tex/texmf' > resolvers | expansions | using cached scan of path > '/opt/context-lmtx/tex/texmf', branch '/opt/context-lmtx/tex/texmf' > resolvers | methods | resolving, method 'generators', how 'uri', > handler 'file', argument '/opt/context-lmtx/tex/texmf' > resolvers | expansions | using cached scan of path > '/opt/context-lmtx/tex/texmf', branch '/opt/context-lmtx/tex/texmf' > resolvers | resolving | > resolvers | resolving | not saving runtime tree > '/opt/context-lmtx/tex/texmf' > resolvers | resolving | not saving runtime tree > '/opt/context-lmtx/tex/texmf' > resolvers | resolving | remembered file 'mtx-context.lua' > resolvers | resolving | remembered file 'mtx-contexts.lua' > resolvers | resolving | remembered file 'mtx-context.lua' > resolvers | resolving | remembered file 'mtx-t-context.lua' > resolvers | resolving | remembered file 'mtx-t-contexts.lua' > resolvers | resolving | remembered file 'mtx-t-context.lua' > resolvers | resolving | remembered file 'context.lua' > mtxrun | unknown script 'context.lua' or 'mtx-context.lua' > > # END > > Can anyone shed some light on how this should be handled? mtxrun --generate Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] unknown script
OS: Linux (Ubuntu 20.04.3) /opt/context-lmtx and all directories and files in it are owned by user and not root. I've had this problem before but forgot how to deal with it and neglected to make a not of it. I deleted all old context files and did a fresh install of context-lmtx without su priveledges today. When attempting to typeset a lmtx source file I get an 'unknown script' error. Here's what pops up on my display screen: $ context simple-example.lmtx resolvers | resolving | configuration files already identified resolvers | resolving | loading configuration file 'selfautoparent:/texmf/web2c/texmfcnf.lua' resolvers | resolving | resolvers | resolving | locating list of '/opt/context-lmtx/tex/texmf' (runtime) (tree:opt/context-lmtx/tex/texmf) resolvers | methods | resolving, method 'locators', how 'uri', handler 'tree', argument 'tree:opt/context-lmtx/tex/texmf' resolvers | trees | locator '/opt/context-lmtx/tex/texmf' found resolvers | resolving | hash '/opt/context-lmtx/tex/texmf' appended resolvers | resolving | resolvers | methods | resolving, method 'generators', how 'uri', handler 'file', argument '/opt/context-lmtx/tex/texmf' resolvers | expansions | using cached scan of path '/opt/context-lmtx/tex/texmf', branch '/opt/context-lmtx/tex/texmf' resolvers | methods | resolving, method 'generators', how 'uri', handler 'file', argument '/opt/context-lmtx/tex/texmf' resolvers | expansions | using cached scan of path '/opt/context-lmtx/tex/texmf', branch '/opt/context-lmtx/tex/texmf' resolvers | resolving | resolvers | resolving | not saving runtime tree '/opt/context-lmtx/tex/texmf' resolvers | resolving | not saving runtime tree '/opt/context-lmtx/tex/texmf' resolvers | resolving | remembered file 'mtx-context.lua' resolvers | resolving | remembered file 'mtx-contexts.lua' resolvers | resolving | remembered file 'mtx-context.lua' resolvers | resolving | remembered file 'mtx-t-context.lua' resolvers | resolving | remembered file 'mtx-t-contexts.lua' resolvers | resolving | remembered file 'mtx-t-context.lua' resolvers | resolving | remembered file 'context.lua' mtxrun | unknown script 'context.lua' or 'mtx-context.lua' # END Can anyone shed some light on how this should be handled? Thanks - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] new upload, new trickery
Hi, Hans I tried to run your first example, but ConTeXt throws an error and complains that \resetleftparbox was never defined. Using version: 2021.11.13 Regards Marcus Vinicius On Thu, Oct 28, 2021 at 6:24 AM Hans Hagen via ntg-context < ntg-context@ntg.nl> wrote: > Hi, > > Among the 'can they be made better' candidates in the engine are > \vadjust and \local[left|right]box primitives that are not really used > in context (okay, vadjust is used in mkii). > > The \vadjust vertical injector can be illustrated with > > \starttext > \ignorespaces\input tufte \removeunwantedspaces > we want a break before this line \vadjust pre {\break}% > \ignorespaces\input tufte \removeunwantedspaces > > \page > > \ignorespaces\input tufte \removeunwantedspaces > we want seperate lines now \leftparbox{\vadjust post {\break}}% > \ignorespaces\input tufte \removeunwantedspaces > \resetleftparbox{} > \stoptext > > It's a signal that injects something in a vertical list without > interupting the horizontal text flow. One can inject before (pre) or > after (post which is default). New is that we can also influence the > order: after vs before preceding \vadjust in the same line. Also new is > that deeply nested adjustments can migrate (so the hole los: marks, > inserts and vadjust are now in sync) which is demonstrated with the next > example: > > \starttext > \showstruts > \input tufte \removeunwantedspaces\space > \localleftbox par {% > \hbox to 0pt{% >\llap{L}% >\vadjust{\strut\blackrule[width=1cm,color=red]}% >\hbox{\vadjust pre{\strut\blackrule[width=1cm,color=green]}}% > }\hss > }% > \localrightbox par {}% > \input tufte \removeunwantedspaces\space > \vadjust pre{\strut BEFORE 1}% > \vadjust pre{\strut BEFORE 2}% > \vadjust before {\strut AFTER 1}% > \vadjust before {\strut AFTER 2}% > \ignorespaces > \input tufte > \stoptext > > Indeed it looks bad (ugly) but it illustrates the idea. What makes > vadjust sort of useless for content is that it messes up spacing (but if > there is real demand and usage i can sort that out at some point, maybe > some new options or so). Thsi example also brings us to local boxes: > > \showframe > > \starttext > > \showmakeup[hbox] > > \startnarrower[2*left] \raggedleft > {\localleftbox par {L1}\input tufte \par} > \stopnarrower > \blank > > \startnarrower[2*middle] \raggedcenter > {\localrightbox par {R1}\input tufte \par} > \stopnarrower > \blank > > \stoptext > > New is the par keyword that forces the setting to be applied from the > first line downards (fyio: these commands, when display set registers, > when inline they set registers and inject a node). Watch out: one needs > to use grouping in order not to bleed into other mechanisms. > > Also new is that we can query the content of these registers using \the, > as in: > > \dorecurse{10}{ > \showboxes > \localleftbox{\ruledhbox {\smallinfofont\setstrut\strut[L #1.0]}}% > \localleftbox{\ruledhbox {\smallinfofont\setstrut\strut[L > #1.1]}\the\localleftbox}% > \localleftbox{\ruledhbox {\smallinfofont\setstrut\strut[L > #1.2]}\the\localleftbox}% > \localleftbox{\ruledhbox {\smallinfofont\setstrut\strut[L > #1.3]}\the\localleftbox}% > % > \localrightbox{\ruledhbox > {\smallinfofont\setstrut\strut[R #1.0]}}% > > \localrightbox{\the\localrightbox\ruledhbox{\smallinfofont\setstrut\strut[R > > #1.1]}}% > > \localrightbox{\the\localrightbox\ruledhbox{\smallinfofont\setstrut\strut[R > > #1.2]}}% > \localrightbox{\the\localrightbox\ruledhbox{\smallinfofont[R #1.3]}}% > % \localrightbox{}% > \samplefile{tufte} > } > > Flushing permits us to append and prepend but it's still ugly so that is > why we now have a new interface (context layer on top of engine): > > \dorecurse{10}{ > \showboxes > % > \resetleftparbox > \resetrightparbox > % > \prependleftparbox {\ruledhbox{\smallinfofont\setstrut\strut[L > #1.0]}}% > \prependleftparbox {\ruledhbox{\smallinfofont\setstrut\strut[L > #1.1]}}% > \prependleftparbox {\ruledhbox{\smallinfofont\setstrut\strut[L > #1.2]}}% > \prependleftparbox {\ruledhbox{\smallinfofont\setstrut\strut[L > #1.3]}}% > % > \appendrightparbox{\ruledhbox{\smallinfofont\setstrut\strut[R #1.0]}}% > \appendrightparbox{\ruledhbox{\smallinfofont\setstrut\strut[R #1.1]}}% > \appendrightparbox{\ruledhbox{\smallinfofont\setstrut\strut[R #1.2]}}% > \appendrightparbox{\ruledhbox{\smallinfofont[R #1.3]}}% > % > \samplefile{tufte} > } > > But as this is not really user friendly, there is more: a mechanism for > hooking in handlers. > > \definelocalboxes >[linenumber] >[command=\LeftNumber, > location=left, > width=3em, > style=\bs, > color=darkred] > > \definelocalboxes >[linenumbertwo] >[linenumber] >
Re: [NTG-context] Footnotes in margins
Thank you Hraban and Taco for the help. Tricky indeed. Regards Marcus Vinicius On Tue, Nov 16, 2021 at 8:57 AM Marcus Vinicius Mesquita < marcusvinicius.mesqu...@gmail.com> wrote: > Dear list, > > When running the MWE below, the first footnote does not appear. > What am I missing? > > \starttext > \inmargin{Foo\footnote{Foo 1.}}Foo\footnote{Foo 2.} > \stoptext > > ConTeXt version: 2021.11.13 > > Regards > > Marcus Vinicius > -- > Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o > corpo nem seus membros, por ser descanso da alma, primavera do coração, > distração do aflito, entretenimento do solitário, e viático do viajante. > > Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik) > -- Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo nem seus membros, por ser descanso da alma, primavera do coração, distração do aflito, entretenimento do solitário, e viático do viajante. Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] new upload
Hi Hans, Thank you for the new upload and the rewriting of the math fonts stuff, thanks also to Mikael S. I did several tests on real size math projects and did not notice important issues. The two issues I noticed, show up mainly with LucidaOT, and are explained in the following example: \setupbodyfont[lucidaot] \definemathstackers[MySymbol] [voffset=-1.4\mathexheight, % -.8\mathexheight hoffset=\zeropoint, mathclass=ord, topoffset=.3\mathemwidth, % poor man's italic correction middlecommand=\mathematics] \define[1]\interior{\mathover[MySymbol]{176}{#1}} %2218 U+00B0 \definemathcommand [Argmin] [limop] {\mfunctionlabeltext{ArgMin}} \definemathcommand [liminfbar] [limop] {\underline{\mfunctionlabeltext{lim}}} \definemathcommand [limsupbar] [limop] {\overline{\mfunctionlabeltext{lim}}} \starttext If $A \subset {\Bbb R}$ is a set, its interior is denoted by $\interior{A}$. Can one have the circle over $A$ slightly bigger (probbaly this is font dependent)? The built-in commands $\liminf$ and $\limsup$ do not work properly with LucidaOT (I tried other fonts and there they are fine): \startformula x_{n} := (-1)^n, \quad\mbox{then} \quad \liminf_{n \geq 0}x_{n} = -1, \quad \limsup_{n\geq 0} x_{n}= +1. \stopformula The commands defined above, \type{\liminfbar} and \type{\limsupbar}, behave correctly in all fonts I tested: \startformula x_{n} := (-1)^n, \quad\mbox{then} \quad \liminfbar_{n \geq 0}x_{n} = -1, \quad \limsupbar_{n\geq 0}x_{n} = +1, \stopformula but not the command \type{\Argmin} (which does not show Argmin in any font…) \startformula \Argmin_{x\in {\Bbb R}} (x^2 - x + 1) = {1 \over 2}. \stopformula \stoptext Best regards: Otared > On 13 Nov 2021, at 21:19, Hans Hagen via ntg-context > wrote: > > Hi, > > I uploaded a new lmtx versions. It mostly concerns new math lfg file > functionality (and control) that Mikael Sundqvist and I are currently working > on so there might be subtle differences in math, which is, unless there are > bugs, intentional and for the best. At some point there will be additional > test files in the distribution and a chapter on fonts in the math manual (the > deadline is next years ctx meeting). > > If you have wishes wrt fonts you can tell us and we'll take them into account > (if possible) but we need proper (real) minimal examples, and not for only > one font as we're looking at: > > cambria (the reference font, very little tweaking needed) > modern (which has some properties different from other gyre fonts) > modernlatin (the boldened aka bachotex version) > dejavu (a gyre font but different from other gyre fonts) > pagella (a gyre font, all have subtle differences) > schola (a gyre font, all have subtle differences) > termes (a gyre font, all have subtle differences) > bonum (a gyre font, all have subtle differences) > lucida (commercial but rather cheap from tug) > xits(is that one still used?) > libertinus (a mixed bag) > stix-two(a mixed bag) > asana (we might drop it because of quality reasons) > ebgaramond (this one is quite cambria conforming) > minion (tricky because commercial and not generally available) > > Maybe later the newlatin modern will get a lfg too but it's beta and we > 'modernlatin' anyway which uses our normal lm lgf file as it's A runtime > derived font and therefore fully compatible. > > The bold (heavy) math fonts also are dealt with automagically. > > For practical reasons we might freeze fonts in the distribution and only > update when explicitly checked for changes (and/or I might cook up version > support in the lfg file assuming version checking is doable as often version > strings are somewhat messy). We're not that bound to conventions (in the > perspective of tex usage) and can "fix" them once and for all (read: we can > divert from how these fonts are currently tuned for usage and expectations in > e.g. latex and plain tex) so feel free to suggest esthetical pleasing > options. If needed we can add variants (for which we can extend the lfg > format). We also have plenty of yet unused (detailed) control in the engine. > We can for instance have specific parameter sets / finetuning defined in the > lfg files too but I don't know how useful and in demand that is (Mikael is > looking into that). > > (I'm sure Aditya has some wishes. We'll deal with Euler later as that's a > virtual mix and virtual opentype might be redone later because we can simply > matters a bit due to the fact that we have some more and better trickery wrt > virtual fonts now.) > > More in due time (as it's a tedious and somewhat boring job that demands lots > of testing and investigation), > > Hans > > - > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands >
Re: [NTG-context] Footnotes in margins
Hi, Like Hraban said, inserts are generally tricky and they tend to disappear when used inside other elements like floating objects / boxes / tables. However, ConTeXt has an easy way out at least for your case: \starttext \startpostponingnotes \inmargin{Foo\footnote{Foo 1.}}Foo\footnote{Foo 2.} \stoppostponingnotes \stoptext Best wishes, Taco > On 16 Nov 2021, at 12:57, Marcus Vinicius Mesquita via ntg-context > wrote: > > Dear list, > > When running the MWE below, the first footnote does not appear. > What am I missing? > > \starttext > \inmargin{Foo\footnote{Foo 1.}}Foo\footnote{Foo 2.} > \stoptext — Taco Hoekwater E: t...@bittext.nl genderfluid (all pronouns) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Footnotes in margins
> Am 16.11.2021 um 12:57 schrieb Marcus Vinicius Mesquita via ntg-context > : > > Dear list, > > When running the MWE below, the first footnote does not appear. > What am I missing? > > \starttext > \inmargin{Foo\footnote{Foo 1.}}Foo\footnote{Foo 2.} > \stoptext Footnotes are "inserts", and those are apparently tricky... The other way round (marginals from footnotes) I was told to use scope=local: \footnote{footnote\inmargin[scope=local]{margin note from footnote}} Don’t know if that helps. Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Footnotes in margins
Dear list, When running the MWE below, the first footnote does not appear. What am I missing? \starttext \inmargin{Foo\footnote{Foo 1.}}Foo\footnote{Foo 2.} \stoptext ConTeXt version: 2021.11.13 Regards Marcus Vinicius -- Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo nem seus membros, por ser descanso da alma, primavera do coração, distração do aflito, entretenimento do solitário, e viático do viajante. Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] space handling in \type
On 11/16/2021 10:53 AM, Henning Hraban Ramm via ntg-context wrote: Hi, \starttext \quotation{\type{\CONTEXT\ }} \stoptext gives “\CONTEXT \” i.e. the space moved. Why? Bug? no, side effect of catcodes ... when you use \type it will change catcodes (sort of) and when tex serializes a \cs it will add a space (ok, it could remove it as it progresses but that's now how tex works) when you pass \type as argument there is no catcode juggling but you can cheat \def\foo#1{#1} \foo{\type[compact=all]{\test\test\test}} should work but i noticesd only for simple cases so i'll adapt it a bit (after all, it's off by default) naybe when i'm bored i'll cook up something else (at the engine level that is) 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 / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] space handling in \type
Hi, \starttext \quotation{\type{\CONTEXT\ }} \stoptext gives “\CONTEXT \” i.e. the space moved. Why? Bug? Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___