Re: [NTG-context] next beta
On 3/20/2013 5:36 PM, Jonathan Barchi wrote: Just to be clear: CT provides an alternate method to colorize the text, instead of using the standard \color[foo]{bar} - right? There is already a section on using the \color command to colorize the text, so I want to make sure I'm adding this correctly as a complementary mechanism, or fix it if I misunderstood. indeed, a quick way to color a whole column Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Including section number in reference broken
Am 17.03.2013 um 09:37 schrieb Steffen Wolfrum cont...@st.estfiles.de: Hi, in October 2011 Marco asked how to get an output like this: I Foo A Bar subsection I.A The example he posted (see below) came to this result: I Foo A Bar subsection A Then Wolfgang added this line: \setupreferencestructureprefix[default][prefixsegments=2:*] But running this advice with todays beta does not have any effect one Marcos original example, and it does not lead to the desired ouput. Is this broken now? This happens because the definition of \currentreferencedefault has changed and the settings from \setupreferencestructureprefix are ignored. When I change the definition from \def\currentreferencedefault {\ctxcommand{filterdefaultreference()}} to (this is the code from 2011 adapted to the current version) \def\currentreferencedefault {\ctxcommand{filterreference(\s!default,\ctxcommand{getcurrentprefixspec(\s!default)})}} I get the section number as prefix in the reference. Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Including section number in reference broken
Hi, in October 2011 Marco asked how to get an output like this: I Foo A Bar subsection I.A The example he posted (see below) came to this result: I Foo A Bar subsection A Then Wolfgang added this line: \setupreferencestructureprefix[default][prefixsegments=2:*] But running this advice with todays beta does not have any effect one Marcos original example, and it does not lead to the desired ouput. Is this broken now? Steffen % \definestructureconversionset [myset] [ Romannumerals, Romannumerals, Romannumerals, Character, ] [numbers] \setuphead [sectionconversionset=myset] \setuphead [subsection] [sectionsegments=subsection] \starttext \startsection [title=Foo] \startsubsection [title=Bar, reference=bar] \stopsubsection \in{subsection}[bar] \stopsection \stoptext % ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Include section number in reference
Am 13.10.2011 um 22:48 schrieb Wolfgang Schuster: Am 13.10.2011 um 22:36 schrieb Marco: Does anyone have an idea? What I do at the moment is that I manually reference my sections. But I'm convinced, there's a neat solution for that. \setupreferencestructureprefix[default][prefixsegments=2:*] Wolfgang If I run Marcos example (as seen below), it gives: I Foo A Bar subsection A But how do we get I Foo A Bar subsection I.A ?? Steffen --- \definestructureconversionset [myset] [ Romannumerals, Romannumerals, Romannumerals, Character, ] [numbers] \setuphead [sectionconversionset=myset] \setuphead [subsection] [sectionsegments=subsection] \setupreferencestructureprefix[default][prefixsegments=1:*] \startsection [title=Foo] \startsubsection [title=Bar, reference=bar] \stopsubsection \in{subsection}[bar] \stopsection ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] new trickery
On Fri, Mar 15, 2013 at 4:35 AM, Hans Hagen pra...@wxs.nl wrote: On 3/15/2013 5:18 AM, Idris Samawi Hamid ادريس سماوي حامد wrote: On Thu, 14 Mar 2013 20:08:38 -0600, Idris Samawi Hamid ادريس سماوي حامد isha...@colostate.edu wrote: To round it off I guess we need a replacement for \subfs as well. Hmm, it seems that \subfs functionality is built in through the same mechanism. Will study this some more... yes, but there in successive calls the last one counts \addff{x} \addff{y} \addff{z} - z is used on top of the current font's set \feature{x} \feature{y} \feature{y} - all are used on top we might end up with replacing \addff etc by one mechanisms \feature{+someset} : add \feature{-someset} : subtract \feature{=someset} : replace I like this proposal for its use of only a single command with the add/remove/reset in the args. If \feature ends up being too generic, maybe \fontfeature or \fontfeatureset instead? To keep things more in-line with current ConTeXt syntax, you could do something like the following: \feature{add=foo} \feature{subtract=bar}(or sub, remove, etc.) \feature{reset,add=baz} Which would also allow, e.g., \feature{add=bar,remove=baz} similar to how we're used to using key:value pairs in so many arguments, and being able to combine them in one function call. Jon Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] new trickery
On 3/15/2013 6:16 PM, Jonathan Barchi wrote: On Fri, Mar 15, 2013 at 4:35 AM, Hans Hagen pra...@wxs.nl wrote: On 3/15/2013 5:18 AM, Idris Samawi Hamid ادريس سماوي حامد wrote: On Thu, 14 Mar 2013 20:08:38 -0600, Idris Samawi Hamid ادريس سماوي حامد isha...@colostate.edu wrote: To round it off I guess we need a replacement for \subfs as well. Hmm, it seems that \subfs functionality is built in through the same mechanism. Will study this some more... yes, but there in successive calls the last one counts \addff{x} \addff{y} \addff{z} - z is used on top of the current font's set \feature{x} \feature{y} \feature{y} - all are used on top we might end up with replacing \addff etc by one mechanisms \feature{+someset} : add \feature{-someset} : subtract \feature{=someset} : replace I like this proposal for its use of only a single command with the add/remove/reset in the args. If \feature ends up being too generic, maybe \fontfeature or \fontfeatureset instead? To keep things more in-line with current ConTeXt syntax, you could do something like the following: \feature{add=foo} \feature{subtract=bar}(or sub, remove, etc.) \feature{reset,add=baz} Which would also allow, e.g., \feature{add=bar,remove=baz} I'd like to avoid parsing as much as possible here as these are state changers. So, I made: \addfeature [f:mine] \feature[more][f:mine] \feature[+] [f:mine] \subtractfeature[f:mine] \feature[less][f:mine] \feature[-] [f:mine] \replacefeature [f:mine] \feature[new] [f:mine] \feature[=] [f:mine] \revivefeature [f:mine] \feature[old] [f:mine] \feature[default][f:mine] \resetfeature\feature[reset] so there are several ways to achieve the same (and one can use {} instead of []) similar to how we're used to using key:value pairs in so many arguments, and being able to combine them in one function call. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Reusing MP graphics
On 3/11/2013 8:20 PM, Marco Patzer wrote: Hi, I have two questions concerning MP graphics. What's going on here? The “abcdefghi” text is not displayed in the second graphic and the “A” is stretched to match the size of the first graphic. Can someone explain why this happens and if this is expected? \startreusableMPgraphic{foo} draw textext(abcdefghi); picture p; p := currentpicture; \stopreusableMPgraphic \startreusableMPgraphic{bar} addto currentpicture also p; %% not printed draw textext(A); %% distorted \stopreusableMPgraphic \starttext \reuseMPgraphic{foo} \reuseMPgraphic{bar} \stoptext Does \includeMPgraphic only work with useMPgraphics (in contrast to reusableMPgraphic)? %% works with useMPgraphics, though \startreusableMPgraphic{alpha} draw textext(abcdefghi); \stopreusableMPgraphic \startreusableMPgraphic{beta} \includeMPgraphic{alpha} draw textext(A); %% not printed \stopreusableMPgraphic \starttext \reuseMPgraphic{alpha} \reuseMPgraphic{beta} \stoptext For each graphic context will remember the text picture. so, in your case, the stored p in the first graphic has a reference to a text picture (index 1) but it's the one created in the second graphic (also index 1). There are no persistent text pictures (yet). Hans -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] reStructuredText module
Philipp Gesang wrote: Hi Bill. ···date: 2013-03-11, Monday···from: Bill Meahan··· Am I correct in thinking the rst module does not process the class and container directives? When I wrote the module I was working with the reST spec [0] and the syntax reference [1]. It’s been a while, but afair I implemented the spec completely (with the limitations described in the manual). It does not, to my knowledge, define the directives you mention and I don’t know what they’re supposed to do. (Btw. like much of the spec, “container” and “class” sound suspiciously HTML-specific. If that is true, they address one output markup which happens to be -- not Context! I might find the time to add a simple wrapper for the container thingy (to boxes or framed?). However, I doubt that it’s possible to replicate the behavior of HTML divs + CSS without a larger effort [2]. In this case it might be preferable to have docutils generate some XML and directly typeset the result with Context.) Best regards Philipp Hi Philip The .class and .container direectives are certainly there with *ML in mind but I think there might be analog situatins in ConTeXt. .. class:: classname blah, blah, blah exists to stick a class name on the following element for styling with an external stylesheet of some sort. CSS/CSS3 are probably the primary examles but other XML-bases markus apply just as well .. class::classname blab, blab, blab could yield p class=classnameblab, blab, blab/p h2 class=classnameblab. blab, blab/h2 or anything else that can take a class name attribute. .. container:: containername Foo, bar, baz bunch of stuff yields div class=containername foo, bar, baz bunch of stuff /div I would think ,, class:: ought to map quite well in ConTeXt: \setupsomething [classname] [attributelist] \startclassname Whatever \stopclassname for suitable values of something .. container:: probably maps to something like \frame[containername] although frames as such cannot cross page boundaries. Perhaps there is (or could be) a more suitable construct. I'm trying to be exemplary not directive. :) ConTeXt environment files are certainly analogus to CSS files and are used with the same end goals in mind. styling markup elements through class= or equivalent is rapidly becoming the order of the day for a wide variety of documents. Certainly (X)HTML, epub2, epub3, ODT, DOCX and an increasing horde of others are either there or heading there very soon. Am I way off base here? -- Bill Meahan Westland, Michigan USA ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] reStructuredText module
···date: 2013-03-12, Tuesday···from: Bill Meahan··· Philipp Gesang wrote: ···date: 2013-03-11, Monday···from: Bill Meahan··· Am I correct in thinking the rst module does not process the class and container directives? When I wrote the module I was working with the reST spec [0] and the syntax reference [1]. It’s been a while, but afair I implemented the spec completely (with the limitations described in the manual). It does not, to my knowledge, define the directives you mention and I don’t know what they’re supposed to do. (Btw. like much of the spec, “container” and “class” sound suspiciously HTML-specific. If that is true, they address one output markup which happens to be -- not Context! I might find the time to add a simple wrapper for the container thingy (to boxes or framed?). However, I doubt that it’s possible to replicate the behavior of HTML divs + CSS without a larger effort [2]. In this case it might be preferable to have docutils generate some XML and directly typeset the result with Context.) Best regards Philipp The .class and .container direectives are certainly there with *ML in mind but I think there might be analog situatins in ConTeXt. .. class:: classname blah, blah, blah exists to stick a class name on the following element for styling with an external stylesheet of some sort. CSS/CSS3 are probably the primary examles but other XML-bases markus apply just as well .. class::classname blab, blab, blab could yield p class=classnameblab, blab, blab/p h2 class=classnameblab. blab, blab/h2 or anything else that can take a class name attribute. From its description [0], the “class” directive appears to be next to meaningless outside an HTML context. It’s supposed to set “classes”. The doctree spec [1] explicitly states that “The classes attribute's contents should be ignorable.” To my knowledge, the closest thing in Context to CSS classes is the “setups=” parameter. All macros don’t accept it, though, so I can’t think of a general way of handling it. The list of macros where it applies would have to be hardcoded ... Docutils’ latex2 writer -- the reference implementation, mind you -- btw. doesn’t take the “class” directive seriously at all: it handles paragraphs but ignores it e.g. for section heads. .. container:: containername Foo, bar, baz bunch of stuff yields div class=containername foo, bar, baz bunch of stuff /div .. container:: probably maps to something like \frame[containername] although frames as such cannot cross page boundaries. Perhaps there is (or could be) a more suitable construct. I'm trying to be exemplary not directive. :) Fyi [2]: “container” is docutils for “div”. How’s a “div” supposed to look? That depends on your browser (not the spec!), and the HTML version being used (XHTML 1.1 for python2-docutils). What does that mean for non-HTML targets? Apparently nothing: again, docutils ignore the directive when writing LaTeX (and man pages, for that matter). Nevertheless, I added some code to handle container directives: at the moment they simply map to macros of the same name. Existence of the macro is tested for at runtime, so you can place the definitions in your preamble. Example: · This is a paragraph. .. container:: xyzzy whatever foo **bar** baz This is another paragraph. · This will generate the output: · \startparagraph This is a paragraph. \stopparagraph \ifcsname xyzzy\endcsname% \csname xyzzy\endcsname% {whatever foo {\sc bar} baz}% \else {whatever foo {\sc bar} baz}% \fi \startparagraph This is another paragraph. \stopparagraph · So if there’s no \xyzzy, the contents are treated as a simple group. Unnamed containers default to \framed. Let me know what you think. The code is at: https://bitbucket.org/phg/context-rst/get/0df50df9c8fb.zip ConTeXt environment files are certainly analogus to CSS files and are used with the same end goals in mind. styling markup elements through class= or equivalent is rapidly becoming the order of the day for a wide variety of documents. Certainly (X)HTML, epub2, epub3, ODT, DOCX and an increasing horde of others are either there or heading there very soon. Sure. I have no problem with that as long as it stays implementation-agnostic. Thanks for the feedback. Philipp [0] http://docutils.sourceforge.net/docs/ref/rst/directives.html#class [1] http://docutils.sourceforge.net/docs/ref/doctree.html#classes [2] http://docutils.sourceforge.net/docs/ref/rst/directives.html#container -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [NTG-context] reStructuredText module
On Tue, 12 Mar 2013, Philipp Gesang wrote: Nevertheless, I added some code to handle container directives: at the moment they simply map to macros of the same name. Existence of the macro is tested for at runtime, so you can place the definitions in your preamble. Example: · This is a paragraph. .. container:: xyzzy whatever foo **bar** baz This is another paragraph. · This will generate the output: · \startparagraph This is a paragraph. \stopparagraph \ifcsname xyzzy\endcsname% \csname xyzzy\endcsname% {whatever foo {\sc bar} baz}% \else {whatever foo {\sc bar} baz}% \fi \startparagraph This is another paragraph. \stopparagraph · A better way to handle this is to provide macros \startRSTcontainer ... \stopRSTcontainer and translate the above to \startRSTcontainer[xyzzy][...settings ] \stopRSTcontainer It should be responsiblility of the document author to make sure that the containers work correctly. Depending on what containers are supposed to do (I have not read the links posted in this thread), providing such a container might be as simple as \let\startRSTcontainer=\startframedtext \let\stopRSTcontainer=\stopframedtext or \let\startRSTcontainer=\startparagraph \let\stopRSTcontainer=\stopparagraph 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Reusing MP graphics
Hi, I have two questions concerning MP graphics. What's going on here? The “abcdefghi” text is not displayed in the second graphic and the “A” is stretched to match the size of the first graphic. Can someone explain why this happens and if this is expected? \startreusableMPgraphic{foo} draw textext(abcdefghi); picture p; p := currentpicture; \stopreusableMPgraphic \startreusableMPgraphic{bar} addto currentpicture also p; %% not printed draw textext(A); %% distorted \stopreusableMPgraphic \starttext \reuseMPgraphic{foo} \reuseMPgraphic{bar} \stoptext Does \includeMPgraphic only work with useMPgraphics (in contrast to reusableMPgraphic)? %% works with useMPgraphics, though \startreusableMPgraphic{alpha} draw textext(abcdefghi); \stopreusableMPgraphic \startreusableMPgraphic{beta} \includeMPgraphic{alpha} draw textext(A); %% not printed \stopreusableMPgraphic \starttext \reuseMPgraphic{alpha} \reuseMPgraphic{beta} \stoptext Marco signature.asc Description: Digital signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] vertical position in itemize and math
Hi, I have two problems with vertical position, one in itemize and one in math. The example below show them both. \starttext \startitemize[n] \item \startitemize[a][left={},right={)},stopper=] \item Bla bla $\theta = \arctan\bigl(\frac{\bar{y}^2}{\bar{x}^2}\bigr)$ % comment this line out to see the problem disappear \stopitemize \stopitemize Let \startformula A=I-2\frac{NN^T}{N^TN}\,N=\frac{1}{9}X. \stopformula \stoptext The first one is the vertical position of the a) and the following formula. This is pushed down (because of the formula it seems). What if I want the a) aligned with the 1.? (I wrote about this problem some time ago, and it got solved, but that time no math was included) The second one is the division line in \frac{NN^T}{N^TN} that look pushed down to me. I'm not sure how it should be, but my guess is aligned with the minus sign or so. All this with the latest ConTeXt suite. /Mikael ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A trouble with setupbodyfontenvironment
On 2013–03–01 Alasdair McAndrew wrote: Do I have to include a special module here? No. I tested some versions between 2011.11.29 23:11 and 2013.02.26 00:17 and it worked for me. Which version are you using? \definehighlight is nothing which was recent added. \setupbodyfontenvironment [default] [em=slantedred] \definehighlight [slantedred] [style=slanted, color=red] \starttext foo {\em bar} \stoptext You cannot update, you can try this instead of \definehighlight: \definealternativestyle [slantedred] [{\slanted\color[red]}] Marco signature.asc Description: Digital signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A trouble with setupbodyfontenvironment
Actually, maybe my version is a bit old: context --version returns 2011.05.18 18:04. I'll try to update it. (I'm using Ubuntu 12.04, but when I tried to update using apt-get the system told me that I had the latest version). In the meantime I'll try your alternative. Thanks! On Fri, Mar 1, 2013 at 12:40 AM, Marco Patzer home...@lavabit.com wrote: On 2013–03–01 Alasdair McAndrew wrote: Do I have to include a special module here? No. I tested some versions between 2011.11.29 23:11 and 2013.02.26 00:17 and it worked for me. Which version are you using? \definehighlight is nothing which was recent added. \setupbodyfontenvironment [default] [em=slantedred] \definehighlight [slantedred] [style=slanted, color=red] \starttext foo {\em bar} \stoptext You cannot update, you can try this instead of \definehighlight: \definealternativestyle [slantedred] [{\slanted\color[red]}] Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] footnotes what happened?
Hi Hans! ···date: 2013-02-24, Sunday···from: Meer, H. van der··· What has happened to \setupfootnotes? It is an alias for \setupnote[footnote]. \setupfootnotes defines [textcolor=] although in the wiki just below this the example has [color=] instead. The “color” key belongs in \setupnotation, while “textcolor” as part of \setupnote determines the appearance of the footnote number/symbol. There is a wiki section[0] on that difference. Example: %% \setupfootnotes - \setupnote[footnote][...=...] \setupfootnotes[ textstyle=bold, textcolor=red, ] \setupnotation[footnote][ color=green, style=italic, ] \starttext foo \footnote{bar} baz \stoptext [0] http://wiki.contextgarden.net/Unexpected_behavior#Footnotes:_The_Difference_between_.5Csetupnotation_and_.5Csetupnote Regards Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpx86ljqya63.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to make all heads \ss?
Hi Devendra! ···date: 2013-02-22, Friday···from: Devendra Ghate··· A slightly more verbose alternative which I have been using is: \definehead [chapter] [section] \setuphead [chapter] [section] [style=\ss] \setuphead [chapter] [style=\tfb] \setuphead [section] [style=\tfx] \starttext \chapter{Chapter} \section{Section} \stoptext Is this not recommended? With \definehead[chapter][section] you set the structurelevel of \section to that of \chapter, essentially creating a synonym with a slightly different style. This is guaranteed to mess up your lists (e.g. toc). To verify that, execute this snippet: \definehead[chapter][section] \starttext \chapter{foo} \section{bar} \chapter{baz} \stoptext Observe that \section and \chapter now share a counter. Btw. to avoid confusion better create your own set of macros (\definehead[myexperimentalsection][section]) instead of overriding pre-defined functionality. Hth Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpaq2sZ6nzX0.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] new tricks in beta
Hi Aditya, I made a mathstyle mechanism ... used in fences first: \starttext \startTEXpage[offset=1ex] \def\TestMe#1% {\NC \ttbf #1 \NC \ruledhbox{$\setupmathstyle[#1]x + x_j^2 + x_i^{e^2} + \frac{1}{x}$} \NC \ruledhbox{$\setupmathstyle[#1,small]x + x_j^2 + x_i^{e^2} + \frac{1}{x}$} \NC \NR} \starttabulate[|l|r|l|] \HL \NC \NC \NC \ttbf ...,small \NC \NR \HL \TestMe{text} \TestMe{text,cramped} \TestMe{script} \TestMe{script,cramped} \TestMe{scriptscript} \TestMe{scriptscript,cramped} \TestMe{display} \TestMe{display,cramped} \HL \stoptabulate \stopTEXpage \startTEXpage $x\begingroup\setupmathstyle[script]x\endgroup x$ \par $x{\setupmathstyle[script]x}x$ \par $x\startmathstyle[script]x\stopmathstyle x$ \stopTEXpage \definemathfence [scriptbracket] [bracket] [command=yes,color=red,mathstyle=script] \definemathfence [smallbracket] [bracket] [command=yes,color=green,mathstyle=small] \definemathfence [normalbracket] [bracket] [command=yes,color=blue] \startTEXpage[offset=1ex] \startbuffer test $a\frac{1}{normal}\scriptbracket{\frac{1}{script}}\normalbracket{\frac{1}{normal}}\smallbracket{\frac{1}{small}}c$ test \par \stopbuffer \getbuffer \setupmathfences [color=red] \getbuffer \stopTEXpage \stoptext \starttext \definemathfence [fancybracket] [bracket] [command=yes,color=blue] test $|x|$ test \par test $||x||$ test (okay) \par test $a\left|\frac{1}{b}\right|c$ test \par test $a\left||\frac{1}{b}\right||c$ test (not okay) \par \startbuffer test $a\fenced[bar]{\frac{1}{b}}c$ test \par test $a\fenced[doublebar]{\frac{1}{b}}c$ test \par test $a\fenced[bracket]{\frac{1}{b}}c$ test \par test $a\fancybracket{\frac{1}{b}}c$ test \par \stopbuffer \getbuffer \setupmathfences [color=red] \getbuffer \stoptext Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \| should give two || and not one
On Tue, Feb 19, 2013 at 10:29 AM, Hans Hagen pra...@wxs.nl wrote: On 2/19/2013 8:36 AM, Keith J. Schultz wrote: Hi All, In a way, it is correct that for compatibility reasons and and convert it is good to keep the old syntax. Yet, ConTeXt is suppose to be more natural. I consider the \{ \} \| etc to be escapes for tex characters. In fact, if one wants || in math then it's more natural to support || directly. Personally, I find some of the names used in TeX and LaTeX often hard to find. Whenever, I needed a function or symbol I to often go look it up. I mean that \vert and \Vert are still cryptic. They can stand for abs, for all in, etc. .. a next step (already partially done) is that we organize the names in dictionaries as in open math (a bit of work) Me, I prefer names that reflect the their functions, me too and i wonder if we should have proper names as well i.e. use verbose names as default (in char-def.lua) and define the short ones as synonyms (in a tex file) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ Fine. In principal I've nothing against typing || for double bars (even though people moving from TeX/LaTeX probably will be used to | for one bar and \| for two bars). Some questions: * Can one expect to get the right (that is the same as \Vert gives) spacing by typing || (two bars) in ConTeXt in the future? * Sometimes one would like to write absoulte value of z times absolute value of w, i.e. |z| times |w|. What if one writes |z||w|, will the double bar in the middle be equivalent to \Vert? (That is not wanted) * Will it be possible to write \Bigl|| and \Bigr|| to scale both bars to other sizes? * What if one would like to have three bars with the same spacing between the bars as in \Vert? /Mikael ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \| should give two || and not one
Hi Mikeal, Am 19.02.2013 um 10:50 schrieb Mikael P. Sundqvist mic...@gmail.com: On Tue, Feb 19, 2013 at 10:29 AM, Hans Hagen pra...@wxs.nl wrote: [snip, snip] a next step (already partially done) is that we organize the names in dictionaries as in open math (a bit of work) Me, I prefer names that reflect the their functions, me too and i wonder if we should have proper names as well i.e. use verbose names as default (in char-def.lua) and define the short ones as synonyms (in a tex file) Hans [snip, snip] Fine. In principal I've nothing against typing || for double bars (even though people moving from TeX/LaTeX probably will be used to | for one bar and \| for two bars). Some questions: * Can one expect to get the right (that is the same as \Vert gives) spacing by typing || (two bars) in ConTeXt in the future? I think we need to find a between input shortcuts and feasiblity. One could just use unicode 02016 and \Vert. In unicodemath you also have \Vvert for three bars. * Sometimes one would like to write absoulte value of z times absolute value of w, i.e. |z| times |w|. What if one writes |z||w|, will the double bar in the middle be equivalent to \Vert? (That is not wanted) The proper way to lay this out is with a little whitspace between the to values, so input should be |z| |w| and not as |z||w| ! * Will it be possible to write \Bigl|| and \Bigr|| to scale both bars to other sizes? * What if one would like to have three bars with the same spacing between the bars as in \Vert? See above! regards Keith. ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \| should give two || and not one
On Tue, Feb 19, 2013 at 10:50 AM, Mikael P. Sundqvist mic...@gmail.com wrote: On Tue, Feb 19, 2013 at 10:29 AM, Hans Hagen pra...@wxs.nl wrote: On 2/19/2013 8:36 AM, Keith J. Schultz wrote: Fine. In principal I've nothing against typing || for double bars (even though people moving from TeX/LaTeX probably will be used to | for one bar and \| for two bars). Some questions: hm I mean a single ‖ (unicode 2012, DOUBLE VERTICAL LINE) , not two ||, i.e. a single unicode 0007C VERTICAL LINE inserted two times. -- luigi ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \| should give two || and not one
On Tue, Feb 19, 2013 at 10:29 AM, Hans Hagen wrote: On 2/19/2013 8:36 AM, Keith J. Schultz wrote: Hi All, In a way, it is correct that for compatibility reasons and and convert it is good to keep the old syntax. Yet, ConTeXt is suppose to be more natural. I consider the \{ \} \| etc to be escapes for tex characters. In fact, if one wants || in math then it's more natural to support || directly. Except that braces actually need an escape, while bars don't. I don't see any advantage of \| representing a single vertical bar, it only breaks compatibility and helps confuse those who used \| in other flavours of TeX. There is a nice thread on SX: http://tex.stackexchange.com/questions/498/mid-vert-lvert-rvert As others have already written, one should use the appropriate unicode character, not two bars. (Two bars are a separate symbol - I guess that you probably don't want to recognise two subsequent bars are replace them with a different glyph?) And even then there is a problem with typographical conventions: whether the symbol is used as left/right delimiter, as a binary operator, ... Mojca ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] beta
This is experimental in upcoming beta: \starttext \definemathfence [fancybracket] [bracket] [command=yes,color=blue] test $|x|$ test \par test $||x||$ test (replaced) \par test $a\left|\frac{1}{b}\right|c$ test \par test $a\left||\frac{1}{b}\right||c$ test (kept) \par \startbuffer test $a\fenced[bar]{\frac{1}{b}}c$ test \par test $a\fenced[doublebar]{\frac{1}{b}}c$ test \par test $a\fenced[bracket]{\frac{1}{b}}c$ test \par test $a\fancybracket{\frac{1}{b}}c$ test \par \stopbuffer \getbuffer \setupmathfences [color=red] \getbuffer \stoptext - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] beta
On 2/19/2013 8:19 PM, Aditya Mahajan wrote: On Tue, 19 Feb 2013, Hans Hagen wrote: This is experimental in upcoming beta: \starttext \definemathfence [fancybracket] [bracket] [command=yes,color=blue] Some feature requests: 1. Can we choose asymmetric fences, for example bra and ket notation in quantum physics: \bra{x} = \lvert x \rangle \ket{x} = \langle x \rvert by default we have this defined \definemathfence [parenthesis] [\c!left=0028,\c!right=0029] \definemathfence [bracket] [\c!left=005B,\c!right=005D] \definemathfence [braces] [\c!left=007B,\c!right=007D] \definemathfence [bar] [\c!left=007C,\c!right=007C] \definemathfence [doublebar] [\c!left=2016,\c!right=2016] to which I'll add: \definemathfence [angle] [\c!left=003C,\c!right=003E] so, you can define \definemathfence [bra] [left=007C,right=003E,command=yes] \definemathfence [ket] [left=003C,right=007C,command=yes] (the command=yes defines the command) \bra{x} = \lvert x \rangle 2. Add scaling so that \fancybracket{...} = \left\{ ... \right\} is already there 3. Add mathstyle key (I think that we need to slowly add this to all math comamnds) mathstyle=text|display|script|scriptscript|cramped ok, later as we probably need some adaptive relative mechanism .. basics already there the auto matching code will also be redone Hans -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] # sign in footnotes impossible ?
Hi Thomas! ···date: 2013-02-15, Friday···from: thomas··· Dear list, how can i put a normal # sign (as part of a \type{} environment) in a footnote ? Until now i got or \# or nothing. Have you tried encapsulation in a buffer? \starttext \startbuffer[containshash]\type{#bar}\stopbuffer foo\footnote{\getbuffer[containshash]} baz \stoptext Works here. Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpM1UfCjSPIV.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Vertical alignment in combinations?
On 2013–02–15 Mari Voipio wrote: Today I feel like a total ConTeXt dummy... As long as it's only today you're much better off than me ;) The problem: I have 3*1 combination where the end graphics are the same size, but the middle graphic is much shorter. With a standard \startcombination\stopcombination I can easily get all three side-by-side, but they are bottom-aligned while I'd need them middle-aligned. How about this: \useMPlibrary [dum] \setupcombinations [location=middle] \starttext \startcombination[3*1] \startcontent \externalfigure\stopcontent \startcaption Foo\stopcaption \startcontent \externalfigure[.][height=2cm] \stopcontent \startcaption Bar\stopcaption \startcontent \externalfigure\stopcontent \startcaption FooBar \stopcaption \stopcombination \stoptext Marco signature.asc Description: Digital signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] # sign in footnotes impossible ?
On 2013–02–15 thomas wrote: how can i put a normal # sign (as part of a \type{} environment) in a footnote ? Until now i got or \# or nothing. Please look at the attached example and log-output. It works for \type if you use \asciimode but \starttyping fails even with \asciimode. Philipps buffer solution seems to work with either version. \asciimode \starttext %% works \startfootnote foo \type{#bar} \stopfootnote %% fails %% \startfootnote %% foo %% \starttyping %%#bar %% \stoptyping %% \stopfootnote \stoptext Marco signature.asc Description: Digital signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Processing MP graphics without interference
Hi, I have MetaPost graphics that are generated by an external program. Each graphic is an individual file and the code is enclosed by beginfig(1) … endfig; end The beginfig argument is always “1”, it does not increment. Including the graphics using MPrun fails, since the first figure's “end” stops the MetaPost run: \startMPrun{foo} beginfig(1); fill fullcircle scaled 1cm withcolor blue; endfig; end; %% prevents the second graph from being processed \stopMPrun \startMPrun{bar} beginfig(1); fill unitsquare scaled 2cm withcolor red; endfig; end; \stopMPrun \starttext foo: \externalfigure[mprun:foo.1] bar: \externalfigure[mprun:bar.1] %% not shown \stoptext I want to avoid preprocessing the generated MP graphics, if possible (stripping the “end”s). What is the best way to deal with these graphics? Marco signature.asc Description: Digital signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Processing MP graphics without interference
On Fri, 1 Feb 2013, Marco Patzer wrote: Hi, I have MetaPost graphics that are generated by an external program. Each graphic is an individual file and the code is enclosed by beginfig(1) … endfig; end The beginfig argument is always “1”, it does not increment. Including the graphics using MPrun fails, since the first figure's “end” stops the MetaPost run: \startMPrun{foo} beginfig(1); fill fullcircle scaled 1cm withcolor blue; endfig; end; %% prevents the second graph from being processed \stopMPrun \startMPrun{bar} beginfig(1); fill unitsquare scaled 2cm withcolor red; endfig; end; \stopMPrun \starttext foo: \externalfigure[mprun:foo.1] bar: \externalfigure[mprun:bar.1] %% not shown \stoptext I want to avoid preprocessing the generated MP graphics, if possible (stripping the “end”s). What is the best way to deal with these graphics? (Untested), something like: let normalend=end; let end=relax; % Don't know the MP equiv. ... ... let end=normalend; 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] PDF Bookmarks
I would like to create PDF bookmarks in my ConTeXt document, but I do not want my document arranged in normal chapter/sections. I know that I can do \setupinteraction[state=start] \placebookmarks[chapter,section,subsection][chapter,section] \setupinteractionscreen[option=bookmark] and then in my document I can do \chapter{Foo} In this case, my PDF bookmark appears as 1 Foo. Furthermore, in the document itself, the chapter heading shows as 1 Foo. I would like the bookmark to just appear as Foo and I do not want ANY chapter/section headings when I issue the \chapter{Foo} or \section{Bar} commands. That is, in the document, I would like those commands to basically JUST create the bookmarks and have the bookmarks omit the chapter/section number. Troy ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] PDF Bookmarks
On Jan 26, 2013, at 1:01 PM, Troy Henderson thend...@gmail.com wrote: I would like to create PDF bookmarks in my ConTeXt document, but I do not want my document arranged in normal chapter/sections. I know that I can do \setupinteraction[state=start] \placebookmarks[chapter,section,subsection][chapter,section] \setupinteractionscreen[option=bookmark] and then in my document I can do \chapter{Foo} In this case, my PDF bookmark appears as 1 Foo. Furthermore, in the document itself, the chapter heading shows as 1 Foo. I would like the bookmark to just appear as Foo and I do not want ANY chapter/section headings when I issue the \chapter{Foo} or \section{Bar} commands. That is, in the document, I would like those commands to basically JUST create the bookmarks and have the bookmarks omit the chapter/section number. Troy Try this: \setuphead[chapter,section,subsection][number=no,placehead=no] This e-mail message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message (including any attachments) is strictly prohibited. If you have received this message in error, please contact the sender by reply e-mail message and destroy all copies of the original message (including attachments). ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Annotation module fails
Hi Wolfgang et al. The following example fails with (virtual://annotation.noname.1) ! Undefined control sequence. \usemodule [annotation] \defineannotation [foo] \starttext \startfoo Bar \stopfoo \stoptext current version: 2013.01.21 18:18 %D \module %D [ file=t-annotation, %D version=2013.01.18, Marco signature.asc Description: Digital signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Annotation module fails
Am 22.01.2013 um 13:56 schrieb Marco Patzer home...@lavabit.com: Hi Wolfgang et al. The following example fails with (virtual://annotation.noname.1) ! Undefined control sequence. \usemodule [annotation] \defineannotation [foo] \starttext \startfoo Bar \stopfoo \stoptext I put a new version online. Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Simple question: how do I get the filename in the footer
···date: 2013-01-20, Sunday···from: Gerben Wierda··· On 20 Jan 2013, at 12:57, Philipp Gesang wrote: Hi Gerben, ···date: 2013-01-20, Sunday···from: Gerben Wierda··· how do I get the filename (full path not needed) in the footer of my document? I want it there while writing the book and remove it in the final stages. I am using MKII (TeXLive 2011 still) if the name of the main file suffices, then the TeX command \jobname is what you are looking for. Thanks but that is not the one. Because I use the standard project setup, and the job is always to typeset the file prd_book.tex, but I want the chapter file names (e.g. chapter1.tex) in the footer. So, prd_book contains: \startbodymatter \component chapter1 \component chapter2 \component chapter3 \stopbodymatter And I want chapter1.tex (maybe full path) in the footer. If the component identifier matches the file name (e.g. if you use the asterisk instead of a name), you can use \currentcomponent. So the main file foo.tex would look like: \setuppagenumbering[location=] %% footer:main file-component file \setupfootertexts[pagenumber][{\jobname-\currentcomponent}] \startproduct * \input ward \page \component bar \stopproduct And bar.tex: \startcomponent * \input knuth \page \stopcomponent Hth Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpDiZWb_os7E.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Simple question: how do I get the filename in the footer
On 20 Jan 2013, at 16:09, Philipp Gesang wrote: ···date: 2013-01-20, Sunday···from: Gerben Wierda··· On 20 Jan 2013, at 12:57, Philipp Gesang wrote: Hi Gerben, ···date: 2013-01-20, Sunday···from: Gerben Wierda··· how do I get the filename (full path not needed) in the footer of my document? I want it there while writing the book and remove it in the final stages. I am using MKII (TeXLive 2011 still) if the name of the main file suffices, then the TeX command \jobname is what you are looking for. Thanks but that is not the one. Because I use the standard project setup, and the job is always to typeset the file prd_book.tex, but I want the chapter file names (e.g. chapter1.tex) in the footer. So, prd_book contains: \startbodymatter \component chapter1 \component chapter2 \component chapter3 \stopbodymatter And I want chapter1.tex (maybe full path) in the footer. If the component identifier matches the file name (e.g. if you use the asterisk instead of a name), you can use \currentcomponent. So the main file foo.tex would look like: \setuppagenumbering[location=] %% footer:main file-component file \setupfootertexts[pagenumber][{\jobname-\currentcomponent}] \startproduct * \input ward \page \component bar \stopproduct And bar.tex: \startcomponent * \input knuth \page \stopcomponent Hi Philipp, that runs into the problem that the file name might contain characters that TeX does not like, e.g. underscore. Is there a command to catch that? (./c_loosely.tex ! Missing $ inserted. inserted text $ to be read again _ \currentcomponent -c_ loosely Thanks, G Hth Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Simple question: how do I get the filename in the footer
Am 20.01.2013 um 18:06 schrieb Gerben Wierda gerben.wie...@rna.nl: On 20 Jan 2013, at 16:09, Philipp Gesang wrote: ···date: 2013-01-20, Sunday···from: Gerben Wierda··· On 20 Jan 2013, at 12:57, Philipp Gesang wrote: Hi Gerben, ···date: 2013-01-20, Sunday···from: Gerben Wierda··· how do I get the filename (full path not needed) in the footer of my document? I want it there while writing the book and remove it in the final stages. I am using MKII (TeXLive 2011 still) if the name of the main file suffices, then the TeX command \jobname is what you are looking for. Thanks but that is not the one. Because I use the standard project setup, and the job is always to typeset the file prd_book.tex, but I want the chapter file names (e.g. chapter1.tex) in the footer. So, prd_book contains: \startbodymatter \component chapter1 \component chapter2 \component chapter3 \stopbodymatter And I want chapter1.tex (maybe full path) in the footer. If the component identifier matches the file name (e.g. if you use the asterisk instead of a name), you can use \currentcomponent. So the main file foo.tex would look like: \setuppagenumbering[location=] %% footer:main file-component file \setupfootertexts[pagenumber][{\jobname-\currentcomponent}] \startproduct * \input ward \page \component bar \stopproduct And bar.tex: \startcomponent * \input knuth \page \stopcomponent Hi Philipp, that runs into the problem that the file name might contain characters that TeX does not like, e.g. underscore. Is there a command to catch that? You can add the \nonknuthmode to your document which makes _ and ^ normal characters for text mode. Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Simple question: how do I get the filename in the footer
On 20 Jan 2013, at 18:34, Wolfgang Schuster wrote: Am 20.01.2013 um 18:06 schrieb Gerben Wierda gerben.wie...@rna.nl: On 20 Jan 2013, at 16:09, Philipp Gesang wrote: ···date: 2013-01-20, Sunday···from: Gerben Wierda··· On 20 Jan 2013, at 12:57, Philipp Gesang wrote: Hi Gerben, ···date: 2013-01-20, Sunday···from: Gerben Wierda··· how do I get the filename (full path not needed) in the footer of my document? I want it there while writing the book and remove it in the final stages. I am using MKII (TeXLive 2011 still) if the name of the main file suffices, then the TeX command \jobname is what you are looking for. Thanks but that is not the one. Because I use the standard project setup, and the job is always to typeset the file prd_book.tex, but I want the chapter file names (e.g. chapter1.tex) in the footer. So, prd_book contains: \startbodymatter \component chapter1 \component chapter2 \component chapter3 \stopbodymatter And I want chapter1.tex (maybe full path) in the footer. If the component identifier matches the file name (e.g. if you use the asterisk instead of a name), you can use \currentcomponent. So the main file foo.tex would look like: \setuppagenumbering[location=] %% footer:main file-component file \setupfootertexts[pagenumber][{\jobname-\currentcomponent}] \startproduct * \input ward \page \component bar \stopproduct And bar.tex: \startcomponent * \input knuth \page \stopcomponent Hi Philipp, that runs into the problem that the file name might contain characters that TeX does not like, e.g. underscore. Is there a command to catch that? You can add the \nonknuthmode to your document which makes _ and ^ normal characters for text mode. Is that limited to a {}-scope? And more importantly, that catches ^ and _, but what about whitespace etc. Isn;t there a true verbatim that I can use on a macro like \currentcomponent? Something along the lines of \verbatimexpand{\currentcomponent}? G Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Layers, overlays
Hello, I'd like to ask two questions which appeared on topic Layer vs. overlay. Q1: What does \tightlayer[...] exactly do? (No item on wiki.) Q2: Why some layer properties are specified on \definelayer (beforetext: width=\overlaywidth,height=\overlayheight) and some during overlay setups (beforetext: preset=righttop)? - Related code given before: \starttext \definelayer [beforetext][width=\overlaywidth,height=\overlayheight] \defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext]}] \startsetups[beforetext] \setlayer[beforetext][preset=righttop] {\framed[width=2in]{foo}} \stopsetups bar \stoptext TIA. Best regards, Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Error markers for invalid section references
Hi, in the final stage of a document I always run a grep for ?? and on the document to find invalid references and missing bibliography entries. However, in documents that do not have a section number the references to the number are also wrong, they need to be references to the name instead of the number. In this case no error marker is printed and AFAIK not even a hint in the log file. The correct way is to use \about instead of \in. Here's an example: \setuphead [section] [number=no] \starttext \startsectionlevel [title=Alpha] See section \in[invalid]. \par %% prints ?? See section \in[sec:bar]. \par %% prints nothing See section \about[sec:bar]. %% correct reference \startsectionlevel [title=Foo] \stopsectionlevel \startsectionlevel [title=Bar, reference=sec:bar] \stopsectionlevel \stopsectionlevel \stoptext The wrong \in[invalid] reference receives an easy to find error marker and an entry in the log file. The wrong entry \in[sec:bar] is hard to find. Is there a way to add ?? for those cases as well? Marco signature.asc Description: Digital signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Place an annotation before it is defined
On 2013–01–07 Hans Hagen wrote: buffers (or blocks) Buffers apparently can't be used before the content is defined, but it works for blocks (I never used them). Test: \defineblock [bar] \starttext buf: \getbuffer[foo] BBB \startbuffer[foo] buf: AAA \stopbuffer \useblocks [bar] DDD \beginbar block: CCC \endbar \stoptext Is there a reason why the blocks favour begin/end instead of start/stop? Looks weird somehow. Marco signature.asc Description: Digital signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Error markers for invalid section references
On 1/7/2013 1:02 PM, Marco Patzer wrote: Hi, in the final stage of a document I always run a grep for ?? and on the document to find invalid references and missing bibliography entries. However, in documents that do not have a section number the references to the number are also wrong, they need to be references to the name instead of the number. In this case no error marker is printed and AFAIK not even a hint in the log file. The correct way is to use \about instead of \in. Here's an example: \setuphead [section] [number=no] \starttext \startsectionlevel [title=Alpha] See section \in[invalid]. \par %% prints ?? See section \in[sec:bar]. \par %% prints nothing See section \about[sec:bar]. %% correct reference \startsectionlevel [title=Foo] \stopsectionlevel \startsectionlevel [title=Bar, reference=sec:bar] \stopsectionlevel \stopsectionlevel \stoptext The wrong \in[invalid] reference receives an easy to find error marker and an entry in the log file. The wrong entry \in[sec:bar] is hard to find. Is there a way to add ?? for those cases as well? I'll print an !! although it might become optional at some point if I find that it has unwanted side effects. Hans -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Place an annotation before it is defined
Am 07.01.2013 um 22:49 schrieb Marco Patzer home...@lavabit.com: On 2013–01–07 Hans Hagen wrote: buffers (or blocks) Buffers apparently can't be used before the content is defined, but it works for blocks (I never used them). Test: \defineblock [bar] \starttext buf: \getbuffer[foo] BBB \startbuffer[foo] buf: AAA \stopbuffer \useblocks [bar] DDD \beginbar block: CCC \endbar \stoptext Is there a reason why the blocks favour begin/end instead of start/stop? Looks weird somehow. Blocks use begin/end to allow the same name for the environment as other commands, e.g. for exams: \defineblock[question] \defineblock[answer] \hideblocks[answer] \defineenumeration[question] \defineenumeration[answer] \starttext \chapter{Questions} % Show only the question blocks \beginquestion \startquestion First question. \stopquestion \endquestion \beginanswer \startasnwer Answer to the first question. \stopanswer \endanswer \chapter{Answers} % Show the question with the corresponding answer \useblocks[question,answer] \stoptext Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Place an annotation before it is defined
On 1/7/2013 10:49 PM, Marco Patzer wrote: On 2013–01–07 Hans Hagen wrote: buffers (or blocks) Buffers apparently can't be used before the content is defined, but it works for blocks (I never used them). Test: \defineblock [bar] \starttext buf: \getbuffer[foo] BBB \startbuffer[foo] buf: AAA \stopbuffer \useblocks [bar] DDD \beginbar block: CCC \endbar \stoptext Is there a reason why the blocks favour begin/end instead of start/stop? Looks weird somehow. (1) nicer symmetry checks (matching begin/end start/stop) (2) more visible in complex docs (3) it was first needed for \beginquestion \startquestion ... \stopquestion \endquestion etc Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Place an annotation before it is defined
Hello Wolfgang, Last example is not working! I have installed last version of standalone version... Jaroslav Hajtmar Here is this example ... \defineblock[question] \defineblock[answer] \hideblocks[answer] \defineenumeration[question] \defineenumeration[answer] \starttext \chapter{Questions} % Show only the question blocks \beginquestion \startquestion First question. \stopquestion \endquestion \beginanswer \startasnwer Answer to the first question. \stopanswer \endanswer \chapter{Answers} % Show the question with the corresponding answer \useblocks[question,answer] \stoptext Dne 7.1.2013 22:57, Wolfgang Schuster napsal(a): Am 07.01.2013 um 22:49 schrieb Marco Patzer home...@lavabit.com: On 2013–01–07 Hans Hagen wrote: buffers (or blocks) Buffers apparently can't be used before the content is defined, but it works for blocks (I never used them). Test: \defineblock [bar] \starttext buf: \getbuffer[foo] BBB \startbuffer[foo] buf: AAA \stopbuffer \useblocks [bar] DDD \beginbar block: CCC \endbar \stoptext Is there a reason why the blocks favour begin/end instead of start/stop? Looks weird somehow. Blocks use begin/end to allow the same name for the environment as other commands, e.g. for exams: \defineblock[question] \defineblock[answer] \hideblocks[answer] \defineenumeration[question] \defineenumeration[answer] \starttext \chapter{Questions} % Show only the question blocks \beginquestion \startquestion First question. \stopquestion \endquestion \beginanswer \startasnwer Answer to the first question. \stopanswer \endanswer \chapter{Answers} % Show the question with the corresponding answer \useblocks[question,answer] \stoptext Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] hbar (and probably some other symbols) doesn't work in latest beta
On 1/4/2013 7:51 AM, Otared Kavian wrote: Dear Michael and Dalyoung, In order to test again and reproduce the problem you encounter I removed my texmf-cache and typeset the example: here is what I observe. --- with \enablemode[lmmath] the \hbar appears and is a math italic « h » with a bar in the top third of the vertical part of the letter --- without \enablemode[lmmath] the \hbar appears and is a roman « h » with a bar in the top third of the vertical part of the letter Your error message seems to indicate some character in texgyretermesmath-regular is not found and points to the file mkiv-base.map is this file present on your context tree? On my installation the file exists but there is no mention of texgyretermesmath-regular… So I am clueless about the issue because all three of us we have updated to LuaTeX, Version beta-0.74.0-2012122517 (rev 4541), ConTeXt ver: 2013.01.02 18:19 MKIV on Mac OS X Mountain Lion. Best regards: OK On 3 janv. 2013, at 15:26, Jeong Dal hak...@me.com wrote: Dear Michael and Otared, After updating ConTeXt to the latest version(2013.01.02.) and run the sample code. \starttext $\hbar$ \stoptext But I also got empty page. If I add either \setupbodyfont[xits] or \enablemode[lmmath], \hbar appeared. I also use Mac OSX mountain lion 64bit, luatex beta 0.74. In the log file, I found the message Missing character:… % … fonts typescripts unknown: library 'loc' (/Users/graph/ConTeXt/tex/texmf-context/tex/context/base/type-imp-texgyre.mkiv){/Users/graph/ConTeXt/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map} … … Missing character: There is no ħ (U+0127) in font texgyretermesmath-regular! backend xmp using file '/Users/graph/ConTeXt/tex/texmf-context/tex/context/base/lpdf-pdx.xml' … % I think that Otared doesn't have this kind of message. Do you have any idea to fix this? It looks like hbar (LATIN SMALL LETTER H WITH STROKE 0x127) is not in the math fonts. I don't know the reason. Is it a often used math / physics symbol? If so, it probably should end up in the math fonts. (I could load a merged copy of the math font with a regular one but rather not.) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] hbar (and probably some other symbols) doesn't work in latest beta
Dear Michael and Dalyoung, In order to test again and reproduce the problem you encounter I removed my texmf-cache and typeset the example: here is what I observe. --- with \enablemode[lmmath] the \hbar appears and is a math italic « h » with a bar in the top third of the vertical part of the letter --- without \enablemode[lmmath] the \hbar appears and is a roman « h » with a bar in the top third of the vertical part of the letter Your error message seems to indicate some character in texgyretermesmath-regular is not found and points to the file mkiv-base.map is this file present on your context tree? On my installation the file exists but there is no mention of texgyretermesmath-regular… So I am clueless about the issue because all three of us we have updated to LuaTeX, Version beta-0.74.0-2012122517 (rev 4541), ConTeXt ver: 2013.01.02 18:19 MKIV on Mac OS X Mountain Lion. Best regards: OK On 3 janv. 2013, at 15:26, Jeong Dal hak...@me.com wrote: Dear Michael and Otared, After updating ConTeXt to the latest version(2013.01.02.) and run the sample code. \starttext $\hbar$ \stoptext But I also got empty page. If I add either \setupbodyfont[xits] or \enablemode[lmmath], \hbar appeared. I also use Mac OSX mountain lion 64bit, luatex beta 0.74. In the log file, I found the message Missing character:… % … fonts typescripts unknown: library 'loc' (/Users/graph/ConTeXt/tex/texmf-context/tex/context/base/type-imp-texgyre.mkiv){/Users/graph/ConTeXt/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map} … … Missing character: There is no ħ (U+0127) in font texgyretermesmath-regular! backend xmp using file '/Users/graph/ConTeXt/tex/texmf-context/tex/context/base/lpdf-pdx.xml' … % I think that Otared doesn't have this kind of message. Do you have any idea to fix this? Thank you. Best regards, Dalyoung ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Section Header and Enumerations
I would like for my section headers to have the following format: Section 1 -- First Section Section 2 -- Second Section ... and I would also like for enumeration lists, for example \startitemize[n] \item Foo \item Bar \stopitemize to look like 1-1 Foo 1-2 Bar where the 1- is the section number in which the itemize resides. Thanks, Troy Henderson ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Section Header and Enumerations
Am 10.12.2012 um 16:26 schrieb Troy Henderson thend...@gmail.com: I would like for my section headers to have the following format: Section 1 -- First Section Section 2 -- Second Section ... and I would also like for enumeration lists, for example \startitemize[n] \item Foo \item Bar \stopitemize to look like 1-1 Foo 1-2 Bar where the 1- is the section number in which the itemize resides. Provide a minimal example next time. \setuplabeltext[section=Section~] \setuphead [section] [sectionstopper=~–~, distance=0pt] \setupitemgroup [itemize] [prefix=yes, width=2em] \starttext \section{First Section} \startitemize[n] \item Foo \item Bar \stopitemize \section{Second Section} \startitemize[n] \item Foo \item Bar \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 / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Lettrines MKIV
Does the lettrine module not work with MKIV? The following setup was taken directly from the module documentation. Sorry for the extra text but I wanted to try and make sure there were at least five lines of output. If I remove all setups and just use the defaults, I don't get the error message but the output is messed up. Same behavior with either TeXLive 2012 or the 06-DEC-2012 beta. Xubuntu 12.04 i386 Minimal example \usemodule[lettrine] \setuplettrine[T] [Findent=0.2em,Nindent=0.2em,Oversize=0.05em,Hang=0.15em,Lines=4] \starttext \lettrine{T}{he moon was full his heart was empty}. Dear Juliet was not in her balcony. Romeo contemplated the scene, though about it a bit and decided he needed a drink. In the bar he met Larissa, one of the wantons who hung out there. Five vodka martinis later she looked just like Juliet to Romeo. Of course, the fat, bald and hairy man tending the bar looked like Juliet, too. A night with Larissa left Romeo with the clap. No wonder he tried to kill himself! \stoptext Error message: ! Missing number, treated as zero. system tex error on line 7 in file lettrinetest.tex: Missing number, treated as zero ... 1 \usemodule[lettrine] 2 \setuplettrine[T] 3 [Findent=0.2em,Nindent=0.2em,Oversize=0.05em,Hang=0.15em,Lines=4] 4 5 \starttext 6 7 \lettrine{T}{he moon was full his heart was empty}. Dear 8 Juliet was not in her balcony. Romeo contemplated the scene, 9 though about it a bit and decided he needed a drink. In the bar -- Bill Meahan Westland, Michigan USA ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Start\Stop with Wolfgangs Annotation Module
2012-11-30 H. Özoguz: Hi, Im using Wolfgangs annotation module and have defined an annotation: \defineannotation[bigquote] with some setups. Now \bigquote{...} works correctly. But I want for big annotations \startbigquote \stopbigquote, how to do that? First: Create a minimal running example. Then we can just mark the code in the email, press a button and have the PDF opened. You'll more likely get responses if you make it as easy as possible to deal with your problem. This works here: \usemodule [annotation] \defineannotation [bigquote] [style=bold] \starttext \bigquote{Foo} \startbigquote Bar \stopbigquote \stoptext Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Start\Stop with Wolfgangs Annotation Module
Am 30.11.2012 13:52, schrieb ntg-context-requ...@ntg.nl: First: Create a minimal running example. Then we can just mark the code in the email, press a button and have the PDF opened. You'll more likely get responses if you make it as easy as possible to deal with your problem. This works here: \usemodule [annotation] \defineannotation [bigquote] [style=bold] \starttext \bigquote{Foo} \startbigquote Bar \stopbigquote \stoptext I have no idea, why it did not work, now it works! Sorry, must be a small mistake by me. I know you opinion on Minexamples, and in most cases you are right, but not for every question, I think. But nevertheless I will add one of course, if it might help. Thanks you. Huseyin ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] underbar/margin text
On Tue, Nov 20, 2012 at 2:07 PM, Daniel Schopper daniel.schop...@aon.atwrote: Dear all, sorry to have to ask again, but I haven't been able to find a solution to this by now… Is there no way to prevent underlining in marginal notes when it is inside an underlined group? It shouldn’t be too difficult as it does work with footnotes, but I have no clue where to start… \starttext \underbar{% Test Test Test\footnote{footnote}~Test Test Test\par Test\inleft{marginal} Test Test Test Test Test \par } \stoptext Any help is very much appreciated! Daniel ___ maybe it can help you, considering that underbar is a controversial typographic style, to separate text at the margin from the rest \starttext \underbar{% Test Test Test\footnote{footnote}~Test Test Test\par Test\inleft{marginal} Test Test Test Test Test \par } \startbar[underbar] Test Test Test\footnote{footnote}~Test Test Test\par Test% \stopbar% \inleft{marginal}% \startbar[underbar] Test Test Test Test Test \par \stopbar %\setupbars[unit=mm,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank %\setupbars[unit=ex,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank %\setupbars[unit=pt,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank %\setupbars[unit=pt,rulethickness=10pt] bar\startbar[underbar]foo\stopbar bar \stoptext -- luigi ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] images and text stacked in the margin
2012-11-12 Andy Thomas: I am still struggling to achieve the page layout/look that I am trying to get. For an image of the desired page spread please look here: https://dl.dropbox.com/u/9089117/tufte-spread.png How about this: \useMPlibrary [dum] \setuplayout [width=10cm, rightmargin=5cm] \setupmargindata [inouter] [location=outer, stack=continue] \definefloat [marginfigure] [marginfigures] [figure] \setupfloat [marginfigure] [default=margin] \definefloat [margintext] [margintexts] \setupfloat [margintext] [default=margin] \setupcaption [margintext] [location=none] \starttext \input knuth \startplacemarginfigure [title=Foo] \externalfigure [dum] [width=\rightmarginwidth] \stopplacemarginfigure \startplacemargintext \input ward \stopplacemargintext \input knuth \startplacemarginfigure [title=Bar] \externalfigure [dum] [width=\rightmarginwidth] \stopplacemarginfigure \stoptext You need to put the \placemargintext at the beginning of a paragraph, otherwise it will cause an unwanted break. Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Annotation module broken
Hi Wolfgang, the annotation module broke within the last few betas. \usemodule [annotation] \starttext \startannotation {Foo} Bar \stopannotation \stoptext Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Annotation module broken
Am 11.11.2012 um 13:18 schrieb Marco Patzer home...@lavabit.com: Hi Wolfgang, the annotation module broke within the last few betas. \usemodule [annotation] \starttext \startannotation {Foo} Bar \stopannotation \stoptext Fixed. Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Presets in collectors
Hi! Is there a reason that presets don't work with collectors? Collectors are based on layers and that's what presets are made for, right? Bug or feature? \definecollector [mycollector] [width=\textwidth] \setcollector [mycollector] {\framed[width=5cm,height=2cm]{Foo}} \setcollector [mycollector] [preset=rightbottom]%% not recognized %% [corner={right, bottom}, %% works %% location={left, top}] {\framed{Bar}} \flushcollector [mycollector] \starttext\null\stoptext Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \chapter{} vs \startchapter..\stopchapter
2012-11-08 Bill Meahan: I note there are two different ways of handling a chapter: The traditional \chapter{mytitle} \startchapter[title=mytitle, ownnumber=N ..] blah \stopchapter Is there any difference or advantage/disadvatage to using one method or the other? With the start…stop syntax you can easily apply different options to the individual structure elements or add additional information. The \chapter syntax is less verbose but less flexible. But it has at least one caveat that I know: The insidesection key of \setuphead does not work. Other than the source code, is there anything that lists the keys for \startchapter somewhere? Keys that I know about: \startchapter[ label=..., title=..., marking=..., list=..., bookmark=..., reference=... ] \stopchapter You can also add an additional pair of brackets with custom settings: \startchapter [title={First chapter}] [foo=bar] \stopchapter In the setups this information is accessible as: \structureuservariable{foo} It's not documented in even the most recent command reference. Welcome to ConTeXt :) Be the first of your friends to add this information to the wiki. Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A problem with autopunctuation
Am 03.11.2012 um 21:15 schrieb Marcin Borkowski mb...@wmi.amu.edu.pl: Dnia 2012-11-03, o godz. 14:04:30 Andres Conrado ela...@chiquitico.org napisał(a): In dont't really know why you think it should render differently. Everything TeX is supposed to ignore white spaces in math, AFAIK. Yep, but that's no TeX! Take a look at math-ini.mkiv, lines 873nn. And what do you think the example will tell us? \starttext \enablemathpunctuation $(1,2) (1, 2) (1{,}2) \hbox{foo, not bar}$ \stoptext Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A problem with autopunctuation
Dnia 2012-11-04, o godz. 11:04:52 Wolfgang Schuster wolfgang.schus...@gmail.com napisał(a): Am 03.11.2012 um 21:15 schrieb Marcin Borkowski mb...@wmi.amu.edu.pl: Dnia 2012-11-03, o godz. 14:04:30 Andres Conrado ela...@chiquitico.org napisał(a): In dont't really know why you think it should render differently. Everything TeX is supposed to ignore white spaces in math, AFAIK. Yep, but that's no TeX! Take a look at math-ini.mkiv, lines 873nn. And what do you think the example will tell us? \starttext \enablemathpunctuation $(1,2) (1, 2) (1{,}2) \hbox{foo, not bar}$ \stoptext Wolfgang Well, I *would* expect (1,2) to produce no space after the comma, and (1, 2) to produce a thin space. But I may be wrong; in any case, they seem to do exactly the same, which doesn't make much sense to me. Also, I wrote about this some time ago on TeX.SE (http://tex.stackexchange.com/questions/52524/autopunctuation-not-working-properly), and Aditya suggested posting here - which I (finally) did. Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Underbar quotation
Hello, in the following example the space before the leading quotation mark (between 'f' and 'g') is not colored: \definebar[MyBar][color=green,rulethickness=2.8,order=background,offset=1.5,continue=yes] \starttext \MyBar{Abc def \quotation{ghi}.} \stoptext How to make the bar color the uncolored space as well? TIA. Best regards, Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 t-Bar.mkiv Description: Binary data t-Bar.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 / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] font features in beta
Hi all, this works in TL but not minimals: · \definefontfeature[textfigures] [onum=yes] \definefontfeature[texligatures] [tlig=yes] \starttext \addff{textfigures} 1234567890 \addff{texligatures} foo---bar \stoptext · With Context as of today and Luatex from minimals, I get lining figures and a triple dash. Did I miss something? Philipp pgpBsCxgSsChV.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] font features in beta
On 17-10-2012 16:08, Philipp Gesang wrote: Hi all, this works in TL but not minimals: · \definefontfeature[textfigures] [onum=yes] \definefontfeature[texligatures] [tlig=yes] \starttext \addff{textfigures} 1234567890 \addff{texligatures} foo---bar \stoptext · With Context as of today and Luatex from minimals, I get lining figures and a triple dash. Did I miss something? just a missing comma in a lua file, i'll upload an update Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Issues with the legend mechanism
Hi, I discovered some issues with the legend mechanism. 1) A newline after \startplacelegend fails: \starttext \startplacelegend \startcontent Foo \stopcontent \startcaption Bar \stopcaption \stopplacelegend \stoptext 2) location != top | bottom throws “Infinite glue shrinkage found in a paragraph”: \starttext \startplacelegend [location=left] \startcontent Foo \stopcontent \startcaption Bar \stopcaption \stopplacelegend \stoptext 3) tabulate inside the content fails when not boxed: \starttext \startplacelegend [location=left] \startcontent \starttabulate \NC Alpha \NC Beta \NC\NR \stoptabulate \stopcontent \startcaption Bar \stopcaption \stopplacelegend \stoptext Just reporting, nothing which needs to be fixed before EuroTeX. Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Issues with the legend mechanism
Am 04.10.2012 um 14:00 schrieb Marco Patzer home...@lavabit.com: Hi, I discovered some issues with the legend mechanism. 1) A newline after \startplacelegend fails: \starttext \startplacelegend \startcontent Foo \stopcontent \startcaption Bar \stopcaption \stopplacelegend \stoptext 2) location != top | bottom throws “Infinite glue shrinkage found in a paragraph”: \starttext \startplacelegend [location=left] \startcontent Foo \stopcontent \startcaption Bar \stopcaption \stopplacelegend \stoptext pack-com.mkiv (replace \hss with \vss): \setvalue{\??pairedboxalign\v!middle}% 4 {\let\pack_pairedboxes_align_l\hss \let\pack_pairedboxes_align_r\hss - \let\pack_pairedboxes_align_t\hss - \let\pack_pairedboxes_align_b\hss} + \let\pack_pairedboxes_align_t\vss + \let\pack_pairedboxes_align_b\vss} 3) tabulate inside the content fails when not boxed: \starttext \startplacelegend [location=left] \startcontent \starttabulate \NC Alpha \NC Beta \NC\NR \stoptabulate \stopcontent \startcaption Bar \stopcaption \stopplacelegend \stoptext You can place the tabulate environment only with the second group of the legend, it doesn’t matter when you change the position of \startcaption and \startcontent because because both commands are synonyms for \bgroup. Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \define a command with square-bracket arguments
2012-09-27 Sietse Brouwer sbbrou...@gmail.com: Hi Sietse, As I understand it, \define[2] is preferred over \def#1#2 because it refuses to overwrite existing commands. \define overwrites existing commands with pleasure. In contrast to \def it prints a message to the log file: “\mycommand is already defined”. Can I use \define, or a related command, to define a command that takes square-bracket arguments, like so: \mycommand[...][...] \def\mycommand {\dodoubleempty\domycommand} \def\domycommand [#1][#2] {first: #1, second: #2} \mycommand [foo] [bar] \mycommand [foo][bar] \mycommand [foo] Question for the others: What's the difference of \dodoubleargument and \dodoubleempty? I expected \dodoubleargument to throw an error since the arguments are supposed to be mandatory. Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] [typo-mar.mkiv] \dosetupstrut - \setupstrut
\dosetupstrut is undefined in mkiv. Hence in typo-mar.mkiv, line 246: - \dosetupstrut[\currentmargindatastrut]% + \setupstrut[\currentmargindatastrut]% Test document: ··· \starttext \setupmargindata[inleftmargin][strut=no] \inleftmargin{\ifvmode yes\else no\fi} bar \stoptext \endinput ··· Best regards Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpe7FM6zlYrU.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] [.tuc] oddity when storing a table
···date: 2012-09-16, Sunday···from: Hans Hagen··· On 16-9-2012 19:17, Philipp Gesang wrote: Bug? no, feature. job variables are just key/values and accessible at the tex end (you store 'works too' in 'bar') Ok, I wasn’t aware of this restriction. if you want arbitrary data to be stores you need to used datasets, as explained in http://wiki.contextgarden.net/Command/definedataset Hmm, the wiki only covers the TeX macro interface whilst I am mainly concerned with passing stuff right from the Lua end. From my reading of core-dat.lua I gather that there is not really a way to dump any Lua table (array or hash or mixed) via datasets. Except directly writing to “tobesaved”. ··· \starttext \startluacode local n, t, d = job.datasets.setdata{ name = not enough!!!11!1! grr!, delay = interfaces.variables.no, data = a=b,c=d,1=foo,2=bar,nested={second={third=whatever}}, } job.datasets.tobesaved.works_for_me = { this = { does = { work, for, nested = { tables, !, {{}} } } } } table.print(job.datasets.getdata(works_for_me, this), this) \stopluacode \stoptext ··· I hesitate to wikify the latter, though. Philipp - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgp8jN9jbGCnC.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] [.tuc] oddity when storing a table
On 17-9-2012 23:13, Philipp Gesang wrote: ···date: 2012-09-16, Sunday···from: Hans Hagen··· On 16-9-2012 19:17, Philipp Gesang wrote: Bug? no, feature. job variables are just key/values and accessible at the tex end (you store 'works too' in 'bar') Ok, I wasn’t aware of this restriction. if you want arbitrary data to be stores you need to used datasets, as explained in http://wiki.contextgarden.net/Command/definedataset Hmm, the wiki only covers the TeX macro interface whilst I am mainly concerned with passing stuff right from the Lua end. From my reading of core-dat.lua I gather that there is not really a way to dump any Lua table (array or hash or mixed) via datasets. Except directly writing to “tobesaved”. And that is indeed somewhat nasty; I'll add a 'convert' key to the settings so that you can set raw data at the Lua end. (I'll send you a Lua file for testing) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] [.tuc] oddity when storing a table
Hi all, I can’t explain the following behavior of the .tuc writer. When passed a nested hash, context fails on the second pass if the array part of the first nesting depth is empty: ··· %% the commented lines work \startluacode job.variables.tobesaved.foo = { bar = { } } -- job.variables.tobesaved.foo = { works now, bar = { } } -- job.variables.tobesaved.foo = { bar = works too } \stopluacode \starttext foo \stoptext ··· I get this error: ··· ! LuaTeX error ...text/tex/texmf-context/tex/context/base/cldf-ini.lua:410: no string to print stack traceback: [C]: in function 'flush' ...text/tex/texmf-context/tex/context/base/cldf-ini.lua:410: in function ...text/tex/texmf-context/tex/context/base/cldf-ini.lua:360 (tail call): ? ...text/tex/texmf-context/tex/context/base/core-uti.lua:112: in function 'initializer' ...text/tex/texmf-context/tex/context/base/core-uti.lua:200: in function 'load' ...text/tex/texmf-context/tex/context/base/core-uti.lua:66: in function 'initialize' main ctx instance:1: in main chunk. system tex error on line 1 in file /home/phg/context/tex/texmf-context/tex/context/base/cont-yes.mkiv: LuaTeX error ... ··· Bug? Regards Philipp pgpU2Xa6DgoT6.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] [.tuc] oddity when storing a table
On 16-9-2012 19:17, Philipp Gesang wrote: Hi all, I can’t explain the following behavior of the .tuc writer. When passed a nested hash, context fails on the second pass if the array part of the first nesting depth is empty: ··· %% the commented lines work \startluacode job.variables.tobesaved.foo = { bar = { } } -- job.variables.tobesaved.foo = { works now, bar = { } } -- job.variables.tobesaved.foo = { bar = works too } \stopluacode \starttext foo \stoptext ··· I get this error: ··· ! LuaTeX error ...text/tex/texmf-context/tex/context/base/cldf-ini.lua:410: no string to print stack traceback: [C]: in function 'flush' ...text/tex/texmf-context/tex/context/base/cldf-ini.lua:410: in function ...text/tex/texmf-context/tex/context/base/cldf-ini.lua:360 (tail call): ? ...text/tex/texmf-context/tex/context/base/core-uti.lua:112: in function 'initializer' ...text/tex/texmf-context/tex/context/base/core-uti.lua:200: in function 'load' ...text/tex/texmf-context/tex/context/base/core-uti.lua:66: in function 'initialize' main ctx instance:1: in main chunk. system tex error on line 1 in file /home/phg/context/tex/texmf-context/tex/context/base/cont-yes.mkiv: LuaTeX error ... ··· Bug? no, feature. job variables are just key/values and accessible at the tex end (you store 'works too' in 'bar') if you want arbitrary data to be stores you need to used datasets, as explained in http://wiki.contextgarden.net/Command/definedataset - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Referring to multiple elements
Hi, how can I refer to multiple elements at the same time? \starttext \startplacefigure [title=foo, reference=alpha] \stopplacefigure \startplacefigure [title=bar, reference=beta] \stopplacefigure \startplacefigure [title=bar, reference=gamma] \stopplacefigure \in{figure}[alpha,beta,gamma] \stoptext This outputs “figure 1”. What I'd like to have is “figure 1-3”. Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Referring to multiple elements
Hi Marco, I do not know if there is a solution to this. The following would work for your example: \in{figure}[alpha]--\in[gamma] Of course this is a quite rigid solution, that does not safeguard against changes in figure order...So probably not what you were looking for. Cheers, Andreas Am Sep 13, 2012 um 12:15 PM schrieb Marco Patzer: Hi, how can I refer to multiple elements at the same time? \starttext \startplacefigure [title=foo, reference=alpha] \stopplacefigure \startplacefigure [title=bar, reference=beta] \stopplacefigure \startplacefigure [title=bar, reference=gamma] \stopplacefigure \in{figure}[alpha,beta,gamma] \stoptext This outputs “figure 1”. What I'd like to have is “figure 1-3”. Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Include chapter number in figure numbering
Hi, how do I include the chapter number in the figure numbering? The following example used to produce (as of November 2011) “Figure 1.1”. A current beta yields merely “Figure 1”. \starttext \startchapter [title=Foo] \startplacefigure [title=Bar] \stopplacefigure \stopchapter \stoptext Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Include chapter number in figure numbering
Marco Patzer wrote: how do I include the chapter number in the figure numbering? Untested: \setupcaptions[prefixsegment=chapter] or \setupcaption[figure][prefixsegment=chapter] should both work. (The former should affect table captions, too.) Slightly more at http://wiki.contextgarden.net/Command/setupcaptions Which is not the first place one would look, admittedly, although it's logical once you realize it. This requires some crosslinks from some pages describing \placefigure-related things, I think. Cheers, Sietse The following example used to produce (as of November 2011) “Figure 1.1”. A current beta yields merely “Figure 1”. \starttext \startchapter [title=Foo] \startplacefigure [title=Bar] \stopplacefigure \stopchapter \stoptext Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Diagonal rule in table (was: Divided cells and bullet points in tables)
Hi Malte, 1. The top left cell is divided in two by a diagonal line with separate text into each triangle This should get you started: http://article.gmane.org/gmane.comp.tex.context/67721 That solution is very hackish and the result ugly. Here is a more clean solution. It has (at least ) one caveat: Because the first tabulate column is set in paragraph mode, it will eat up as much space as *possible*, in contrast to occupying as much space as *necessary*. That is why the width of the column has to be set explicitly. \startuseMPgraphic{DiagonalRule} rulethickness := \frameddimension{rulethickness}; drawoptions( withpen pencircle scaled rulethickness withcolor \MPcolor{\framedparameter{framecolor}}); pair leftcorner, rightcorner; leftcorner := (rulethickness, \overlayheight-rulethickness); rightcorner := (\overlaywidth-rulethickness, rulethickness); draw leftcorner -- rightcorner; \stopuseMPgraphic \defineoverlay [DiagonalRule] [\useMPgraphic{DiagonalRule}] \define[2]\DiagonalLabel{% \setuptabulate [after={\blank[\frameddimension{offset}]}] \starttabulate [|p|r|] \NC\NC #2 \NC\NR \NC #1 \NC\NC\NR \stoptabulate } \starttext \setupTABLE [1] [width=2cm] \bTABLE \bTR \bTD [background=DiagonalRule] \DiagonalLabel{Foo}{Bar} \eTD \bTD Second \eTD \bTD Third \eTD \eTR \bTR \bTD Alpha \eTD \bTD Beta \eTD \bTD Gamma \eTD \eTR \eTABLE \stoptext Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to know in which page I'm?
Am 21.08.2012 um 01:56 schrieb john Culleton j...@wexfordpress.com: On Mon, 20 Aug 2012 23:09:11 +0200 Wolfgang Schuster wolfgang.schus...@gmail.com wrote: Am 20.08.2012 um 22:41 schrieb Xan dxpubl...@telefonica.net: Hi, I want to print a message depending if the page is even or odd. In pseudocode: \if \inpage.\iseven { This page is even } \else { This page is odd } How can I do that in ConTeXt? http://www.ntg.nl/pipermail/ntg-context/2012/067632.html Wolfgang Will the plain text way still work? \ifodd\pageno foo \else bar \fi This works only correct when used used in the page header or footer texts which are added after the page is finished and then you can use context’s \doifoddpageelse command. When used in the running text the test can fail when you have a text which ends at the top of the page which was processed by tex when it was on the previous page and the output was moved to the next page because there wasn’t enough space. Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to know in which page I'm?
On Mon, 20 Aug 2012 23:09:11 +0200 Wolfgang Schuster wolfgang.schus...@gmail.com wrote: Am 20.08.2012 um 22:41 schrieb Xan dxpubl...@telefonica.net: Hi, I want to print a message depending if the page is even or odd. In pseudocode: \if \inpage.\iseven { This page is even } \else { This page is odd } How can I do that in ConTeXt? http://www.ntg.nl/pipermail/ntg-context/2012/067632.html Wolfgang Will the plain text way still work? \ifodd\pageno foo \else bar \fi -- John Culleton ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Bug in \startitemize[randomize]
On 4-8-2012 17:22, Aditya Mahajan wrote: Hi, \startitemize[randomize] does not randomize properly (one entry at random is gobbled and another is repeated in its place). I guess that this is because of an off-by-one error somewhere. Example (from: http://tex.stackexchange.com/a/65662/323) \defineitemgroup[institm] \setupinstitm[1][text, random] \setupinstitm[1][symbol=2, indentnext=no, intro=yes] \starttext \startTEXpage[offset=5mm] \bold{Contributions} \startinstitm \startitem Foo Pvt Ltd {\sc nsw} \stopitem \startitem Bar Pvt Ltd {\sc vic} \stopitem \startitem Baz Pvt Ltd {\sc abc} \stopitem \stopinstitm \stopTEXpage \stoptext an \if going wild du eto a lack of \relax'ing \unexpanded\def\getrandomcount #1#2#3% {#1=\ctxcommand{getrandomcounta(\number#2,\number#3)}\relax} - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Bug in \startitemize[randomize]
Hi, \startitemize[randomize] does not randomize properly (one entry at random is gobbled and another is repeated in its place). I guess that this is because of an off-by-one error somewhere. Example (from: http://tex.stackexchange.com/a/65662/323) \defineitemgroup[institm] \setupinstitm[1][text, random] \setupinstitm[1][symbol=2, indentnext=no, intro=yes] \starttext \startTEXpage[offset=5mm] \bold{Contributions} \startinstitm \startitem Foo Pvt Ltd {\sc nsw} \stopitem \startitem Bar Pvt Ltd {\sc vic} \stopitem \startitem Baz Pvt Ltd {\sc abc} \stopitem \stopinstitm \stopTEXpage \stoptext 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Added licensing information to PDF
Hi :-) I am trying to switch from LaTeX to ConTeXt and I'd like to add licensing information to the generated PDF, just like what the hyperxmp package would do for LaTeX. Something like this: \setupinteraction[ title={My Title}, author={Tobias Mueller}, keyword={foo bar baz}, pdfcopyright={This work is licensed to the public under the Creative Commons Attribution-Non-Commercial-Share Alike 3.0 Germany License.}, pdflicenseurl={http://creativecommons.org/licenses/by-nc-sa/3.0/de/} ] \starttext Hello, World! \stoptext Thanks! Tobi ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Added licensing information to PDF
Hi Tobias, ···date: 2012-07-31, Tuesday···from: Tobias Mueller··· I am trying to switch from LaTeX to ConTeXt and I'd like to add licensing information to the generated PDF, just like what the hyperxmp package would do for LaTeX. you can include XMP files with one line: \setupbackend[xmpfile=metadata.xmp] Of course, the XMP needs to be generated beforehand. I was using the export functionality at http://wiki.creativecommons.org for this, but maybe Context can do the conversion for you already? Hth Philipp Something like this: \setupinteraction[ title={My Title}, author={Tobias Mueller}, keyword={foo bar baz}, pdfcopyright={This work is licensed to the public under the Creative Commons Attribution-Non-Commercial-Share Alike 3.0 Germany License.}, pdflicenseurl={http://creativecommons.org/licenses/by-nc-sa/3.0/de/} ] \starttext Hello, World! \stoptext Thanks! Tobi ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpKEBiuTKAox.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Added licensing information to PDF
Am 01.08.2012 09:21, schrieb Philipp Gesang: Hi Tobias, ···date: 2012-07-31, Tuesday···from: Tobias Mueller··· I am trying to switch from LaTeX to ConTeXt and I'd like to add licensing information to the generated PDF, just like what the hyperxmp package would do for LaTeX. you can include XMP files with one line: \setupbackend[xmpfile=metadata.xmp] You can also use some low level commands here (with the risk that names change or they vanish some time). The risk in this case is very low. Read the documentation about XMP from Adobe and you will exactly know why. :-D Add something like this after \setupinteraction|\setupbackend (they also add info to the XMP blob). \startluacode -- keep the order -- mark as copyrighted material lpdf.injectxmpinfo(xml://rdf:RDF,rdf:Description rdf:about='' xmlns:xmpRights='http://ns.adobe.com/xap/1.0/rights/'xmpRights:MarkedTrue/xmpRights:Marked/rdf:Description,false) -- url for copyright information lpdf.insertxmpinfo(xml://rdf:Description/xmpRights:Marked,xmpRights:WebStatementhttp://www.yoururl.com/xmpRights:WebStatement,false) \stopluacode The adding is also limited to a predefined list of values. See lpdf-xmp.lua ('mapping') for the details. Best wishes, Peter Of course, the XMP needs to be generated beforehand. I was using the export functionality at http://wiki.creativecommons.org for this, but maybe Context can do the conversion for you already? Hth Philipp Something like this: \setupinteraction[ title={My Title}, author={Tobias Mueller}, keyword={foo bar baz}, pdfcopyright={This work is licensed to the public under the Creative Commons Attribution-Non-Commercial-Share Alike 3.0 Germany License.}, pdflicenseurl={http://creativecommons.org/licenses/by-nc-sa/3.0/de/} ] \starttext Hello, World! \stoptext Thanks! Tobi ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] simpleslides help needed
Hans and Wolfgang, Thanks, as always, for the prompt replies. Does this mean that I need to focus on the typescript mechanism rather than simplefonts? Wolfgang, that was also the point I wanted to clarify since from my earlier reading of the manual's section on Choosing on your own fonts, the example pointed to using typescripts. However, from the Aditya's posting I was encouraged that I could use (my) default method of relying on simplefonts. One last question stemming from the Jean-Luc Dumont's article on effective communications: is there a way to turn off the interaction bar in the slides. I am using the simple 'Shaded' style where the interaction bars are displayed as small circles along the bottom. Regards. On 12-07-18 03:42 AM, Hans Hagen wrote: On 18-7-2012 02:41, Pavneet Arora wrote: also doesn't seem to work at all. I get what I believe to be Latin Modern Sans across the board. I have resorted to using one of the default fonts via the module switch for now, but would like to customize the font selection to my taste. Just using (without any additional definitions): \setupbodyfont[dejavu,10pt] works, as there is a type-imp-dejavu typescript. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - -- - - Pavneet Arora Waroc Fine Audio + Custom Home Cinema www.waroc.com 416.937.WAROC (9276) ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Local TOC after each chapter title (was: Re: Need help)
On 2012-07-18 Shiv Shankar Dayal shivshankar.da...@gmail.com wrote: Hi Shiv! For your next posts please ∙ Provide a meaningful subject, not just “Need help”. E.g. “Local TOC after each chapter title” ∙ Provide a MWE, a minimal *working* example. A small code snippet that compiles and demonstrates you problem. That way you increase the chance of getting an answer by magnitudes. ∙ Be specific! “Does not work” doesn't say much. State clearly what you expect and what you got instead. E.g. TOC does not show up on the page, leads to compilation error: “Undefined control sequence”, TOC is not centred, etc. I want a local TOC after each chapter title. How about this: \setuphead [chapter] [after=\placecontent] \starttext \startchapter [title=Foo] \startsection [title=First A] \input knuth \stopsection \startsection [title=First B] \input knuth \stopsection \stopchapter \startchapter [title=Bar] \startsection [title=Second A] \input knuth \stopsection \startsection [title=Second B] \input knuth \stopsection \input zapf \stopchapter \stoptext Marco ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] simpleslides help needed
On Wed, 18 Jul 2012, Pavneet Arora wrote: Thanks, as always, for the prompt replies. Does this mean that I need to focus on the typescript mechanism rather than simplefonts? In principle both should work with simpleslides module though I never tested it with simplefonts. Wolfgang, that was also the point I wanted to clarify since from my earlier reading of the manual's section on Choosing on your own fonts, the example pointed to using typescripts. However, from the Aditya's posting I was encouraged that I could use (my) default method of relying on simplefonts. ConTeXt comes with typescripts for lot of the commonly used fonts. Earlier, you had to use \usetypescript[dejavu] \setupbodyfont[dejavu] to use an existing typescript. Since a year or more now, the first line is not needed. You can just use \setupbodyfont[dejavu] and context will run \usetypescript[...] if a typescript is not already loaded. One last question stemming from the Jean-Luc Dumont's article on effective communications: is there a way to turn off the interaction bar in the slides. I am using the simple 'Shaded' style where the interaction bars are displayed as small circles along the bottom. The simpleslides module is not designed for configurability. Sorry. The best solution is to copy the Shaded style to another file and remove the code for the bottom bar. Thomas and I were working on a more extensible version of simpleslides, but haven't had the time to finish it. 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] setupbars
... OK - On Tue, 10 Jul 2012 00:16:08 +0200, Hans Hagen pra...@wxs.nl wrote: actually it does accept more units but they were pretty small (needed an 1/u) anyhow, in the next beta we can do \starttext \setupbars[unit=mm,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank \setupbars[unit=ex,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank \setupbars[unit=pt,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank \setupbars[unit=pt,rulethickness=10pt] bar\startbar[underbar]foo\stopbar bar\blank \stoptext Although it's meaningless, what would \setupbars[unit=mm,rulethickness=10pt] bar\startbar[underbar]foo\stopbar bar\blank ^^ ^^ produce? Will the following setups be valid in the next beta? \setupbars[rulethickness=1mm] \setupbars[rulethickness=1cm] \setupbars[rulethickness=1in] \setupbars[rulethickness=1ex] \setupbars[rulethickness=1pt] \setupbars[rulethickness=1bp] Best regards, Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] setupbars
On 10-7-2012 15:25, Procházka Lukáš Ing. - Pontex s. r. o. wrote: ... OK - On Tue, 10 Jul 2012 00:16:08 +0200, Hans Hagen pra...@wxs.nl wrote: actually it does accept more units but they were pretty small (needed an 1/u) anyhow, in the next beta we can do \starttext \setupbars[unit=mm,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank \setupbars[unit=ex,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank \setupbars[unit=pt,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank \setupbars[unit=pt,rulethickness=10pt] bar\startbar[underbar]foo\stopbar bar\blank \stoptext Although it's meaningless, what would \setupbars[unit=mm,rulethickness=10pt] bar\startbar[underbar]foo\stopbar bar\blank ^^ ^^ produce? Will the following setups be valid in the next beta? \setupbars[rulethickness=1mm] \setupbars[rulethickness=1cm] \setupbars[rulethickness=1in] \setupbars[rulethickness=1ex] \setupbars[rulethickness=1pt] \setupbars[rulethickness=1bp] the unit is uses for consistent stacking of nested bars; in the case of a unit with rulethickness that one is used for the rules, otherwise the general unit is applied to the rulethickness Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] beta
···date: 2012-07-09, Monday···from: Hans Hagen··· On 9-7-2012 20:59, Meer, H. van der wrote: This new beta crashed here immidiately: how new? keep in mind that the garden needs to sync as well I can confirm this for 2012.07.09 20:28. Minimal example: ··· \setuphead [section] [ page=yes, header=sectiontext, ] \definetext [sectiontext] [header] [foo] [bar] \starttext \startsection[title=Foo] \input dawkins \stopsection \stoptext \endinput ··· But I can’t tell if this code requires a rewrite with the new functionality. Regards Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpaK2jiM6LpB.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] beta
On 9-7-2012 21:44, Philipp Gesang wrote: ···date: 2012-07-09, Monday···from: Hans Hagen··· On 9-7-2012 20:59, Meer, H. van der wrote: This new beta crashed here immidiately: how new? keep in mind that the garden needs to sync as well I can confirm this for 2012.07.09 20:28. Minimal example: ··· \setuphead [section] [ page=yes, header=sectiontext, ] \definetext [sectiontext] [header] [foo] [bar] \starttext \startsection[title=Foo] \input dawkins \stopsection \stoptext \endinput ··· But I can’t tell if this code requires a rewrite with the new functionality. fixed in next upload - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] setupbars
On 9-7-2012 09:26, Wolfgang Schuster wrote: Am 09.07.2012 um 09:09 schrieb Meer, H. van der: There is still an issue here. \setupbars[unit=mm,rulethickness=1] AB\startbar[underbar]CD\stopbar EF\crlf \setupbars[unit=ex,rulethickness=1] AB\startbar[underbar]CD\stopbar EF\crlf \setupbars[unit=pt,rulethickness=1] AB\startbar[underbar]CD\stopbar EF\crlf The first and third setup do not give an underbar, the second does. Question: why does ex qualify as a dimension unit but pt and mm do not? Sounds strange. If I want an underbar exactly 1mm or 3pt's thick, why isn't that made possible? Doing the math myself is no option, becaus ex will not be known beforehand. The underlying Lua code accepts only “ex” and “em” as valid options for the “unit” key but I would also vote to accept either “pt”, “mm” etc. as unit value or to allow “rulethickness=…pt”. actually it does accept more units but they were pretty small (needed an 1/u) anyhow, in the next beta we can do \starttext \setupbars[unit=mm,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank \setupbars[unit=ex,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank \setupbars[unit=pt,rulethickness=1] bar\startbar[underbar]foo\stopbar bar\blank \setupbars[unit=pt,rulethickness=10pt] bar\startbar[underbar]foo\stopbar bar\blank \stoptext but someone has do document it - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] List without bullets
Hi, You can customize the symbol appearing in your items, and set it to nothing… \definesymbol[NoSymbol][{}] \definesymbol[MySymbol][{$\heartsuit$}] \starttext \startitemize[Nosymbol] \item foo \item bar \item baz \stopitemize \startitemize[MySymbol,packed] \item foo \item bar \item baz \stopitemize \stoptext Best regards: OK On 30 juin 2012, at 00:49, Gilbert Houtekamer wrote: Hi, I am would like to make \startitemize list with \head that has no bullets, e.g. Topic My text for topic Another Topic Text for another topic. With \startitemize and \head I get bullets before Topic and Another Topic, how can get rid of these? Thanks! Gilbert Houtekamer ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] setupinteraction and macroexpansion
Am 19.06.2012 um 10:59 schrieb Andreas Schneider: On Tuesday, June 19, 2012, at 10:42 Wolfgang Schuster wrote: Am 19.06.2012 um 10:39 schrieb Andreas Schneider: Hello, I'm a bit lost with macro expansion here. I try to use some macros to set the title (and subject) of the PDF document. The attached minimal example shows what I want to achieve. I tried def, edef, gdef, define, explicit expand, expandoneafter, etc. etc. without any success. Whatever I do, the title field in the PDF metadata always contains the raw \date... command instead of the formatted date. Any suggestions? You can’t use \date (or any other unexpandable command) in an expandable context. Wolfgang Hmm I see, so \date is simply not possible for that case. Ok, thanks for explaining that I wasn't aware (until now) that commands can be unexpandable. To explain it in a simple way: Commands which can be used in \edef\comecommand{…} are expandable and commands which fail in \edef are unexpandable. It’s also important to know that commands with optional arguments are always unexpandable because the underlying mechanism to check for the optional bracket, brace etc. can’t be used in \edef, you can also make a expandable command (e.g. \def\foo{FOO}) unexpandable by adding \unexpanded in front of the \def (e.g. \unexpanded\def\bar{BAR}). Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Strange page breaks
Hello, the attached example causes very strange page breaks. 1. The subsubsubject is the last line on the first page. That doesn't look very nice. 2. The xtable is broken although the whole table fits on that page. Is there anything I (or you? :-)) can do about these two problems? #This is LuaTeX, Version beta-0.70.2-2012052100 (TeX Live 2012/W32TeX) #ConTeXt ver: 2012.05.24 19:36 MKIV fmt: 2012.6.18 int: english/english -- Best Regards, Andreas\starttext \dorecurse{36}{some text some text some text some text some text\crlf} \subsubsubject{Some Table} \placefigure[split,force,here,none]{}{ \startxtable[header=repeat] \startxtablehead \startxrow \startxcell Col1 \stopxcell \startxcell Col2 \stopxcell \startxcell Col3 \stopxcell \stopxrow \stopxtablehead \startxtablebody \startxrow \startxcell foo \stopxcell \startxcell bar \stopxcell \startxcell \stopxcell \stopxrow \startxrow \startxcell test \stopxcell \startxcell test \stopxcell \startxcell test \stopxcell \stopxrow \stopxtablebody \stopxtable} \stoptext pgpoW0a5TUCC3.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \box0 to Lua
Ahoj! ···date: 2012-06-18, Monday···from: Procházka Lukáš Ing. - Pontex s. r. o.··· On Mon, 18 Jun 2012 16:56:56 +0200, Jaroslav Hajtmar hajt...@gyza.cz wrote: Ahoj... To bych ti rekl ... :-) tex.box[0].height ... To ale získáš jen výšku boxu, ne? Co když ten hbox chceš vysázet Luou na nějakou šířku? Na to budeš potřebovat node.hpack() (luatexref-t.pdf, s. 95). ···8··· \starttext foo \startluacode local newnode = node.new(node.idglyph) newnode.char = unicode.utf8.bytex newnode.font = font.current() -- won’t work before \starttext newnode.lang = tex.language --- second arg to node.hpack is width int local hbox= node.hpack(newnode, 2*newnode.width) node.write(hbox) \stopluacode bar \stoptext ···8··· The first argument is the head of a node list, the second can be the width in sp (or “spread”). See Patrick’s excellent tutorial: http://wiki.luatex.org/index.php/TeX_without_TeX to get started with node fun. (The \boxn registers are accessible as tex.box, see page 112 in the luatex manual.) Philipp L. J. Dne 18.6.2012 16:53, Procházka Lukáš Ing. - Pontex s. r. o. napsal(a): Hello, (my apologies if this message is duplicated - our mail server was out-of-order some time) how to call \box0 and \hbox to3cm{abc} by Lua? \startluacode context[[\box0]] % OK but a nicer way preferred, so keep on trying - context.box(0) % Error context.box{0} % Error context.box0 % Error context.hbox({to = cm}, abc) % Error \stopluacode TIA. Best regards, Lukas ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpRiHOKS9Ih4.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] labeltext assignment
Hi all, there appears to be something special about how the key-value list works with \setuplabeltext: ··· \setuplabeltext [ foo=bar, %% - comma not allowed here? % foo=bar %% - works ] \starttext \labeltext{foo} \stoptext ··· Normally the trailing comma causes no trouble, but here it won’t even compile. Best regards Philipp pgp72risoTbZn.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] labeltext assignment
On 11-6-2012 10:01, Philipp Gesang wrote: Hi all, there appears to be something special about how the key-value list works with \setuplabeltext: ··· \setuplabeltext [ foo=bar, %% - comma not allowed here? % foo=bar %% - works ] \starttext \labeltext{foo} \stoptext ··· Normally the trailing comma causes no trouble, but here it won’t even compile. indeed a slightly different parser is used here - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] labeltext assignment
Hi Hans! ···date: 2012-06-11, Monday···from: Hans Hagen··· On 11-6-2012 10:01, Philipp Gesang wrote: Hi all, there appears to be something special about how the key-value list works with \setuplabeltext: ··· \setuplabeltext [ foo=bar, %% - comma not allowed here? % foo=bar %% - works ] \starttext \labeltext{foo} \stoptext ··· Normally the trailing comma causes no trouble, but here it won’t even compile. indeed a slightly different parser is used here I’ll watch out for these cases, then. Regards Philipp - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgp82VyPU6mph.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] labeltext assignment
Am 11.06.2012 um 21:06 schrieb Philipp Gesang: Hi Hans! ···date: 2012-06-11, Monday···from: Hans Hagen··· On 11-6-2012 10:01, Philipp Gesang wrote: Hi all, there appears to be something special about how the key-value list works with \setuplabeltext: ··· \setuplabeltext [ foo=bar, %% - comma not allowed here? % foo=bar %% - works ] \starttext \labeltext{foo} \stoptext ··· Normally the trailing comma causes no trouble, but here it won’t even compile. indeed a slightly different parser is used here I’ll watch out for these cases, then. \definepalet has a similar problem because it uses also a custom parser. Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Exceptions to assignment syntax [was: Re: labeltext assignment]
Hi Wolfgang! ···date: 2012-06-11, Monday···from: Wolfgang Schuster··· Am 11.06.2012 um 21:06 schrieb Philipp Gesang: Hi Hans! ···date: 2012-06-11, Monday···from: Hans Hagen··· On 11-6-2012 10:01, Philipp Gesang wrote: Hi all, there appears to be something special about how the key-value list works with \setuplabeltext: ··· \setuplabeltext [ foo=bar, %% - comma not allowed here? % foo=bar %% - works ] \starttext \labeltext{foo} \stoptext ··· Normally the trailing comma causes no trouble, but here it won’t even compile. indeed a slightly different parser is used here I’ll watch out for these cases, then. \definepalet has a similar problem because it uses also a custom parser. Dear others, please contribute if you know about further setups whose parameters behave in a non-standard way. As this is quite counterintuitive, I’d like to wikify any known exceptions somewhere over here: http://wiki.contextgarden.net/From_LaTeX_to_ConTeXt#Optional_Arguments_and_Setups Thanks Philipp Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgprCApaJVao5.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] expansion and \processaction
Hi all, my goal is a macro \definestates[foo][...,...] which takes a comma list and creates a monadic macro \foo[n]. \foo[n] should return either the nth item or, if (n list length), a default. I thought the right tools were \processcommalist to generate the mapping n-list item, as well as \processaction to retrieve the items. But naively I didn’t consider expansion ... My code so far: ··8 \unprotect \def\definestates{\dodoubleempty\do_define_states} \def\do_define_states[#1][#2]{% \expandafter\edef\csname#1_states\endcsname{% \nstates0 %% this is supposed to be expanded so we employ the \raw... variety \rawprocesscommalist[#2]\add_one_state% unknown=\dummystate,% default=\dummystate,% }% \do_do_define_states{#1}% } \let\dummystate\empty \newcount\nstates \unexpanded\def\add_one_state#1{% \advance\nstates\plusone \the\nstates=#1,% } \def\do_do_define_states#1{% \expandafter\def\csname#1\endcsname {\expandafter\dosingleempty\csname do_#1\endcsname}% \expandafter\def\csname do_#1\endcsname[##1]{% \iffirstargument % [DBG] cmd:#1, state:##1\par \edef\currentstates{\csname#1_states\endcsname}% %% At this point \currentstates should yield the whole mapping so %% we can use it with \processaction. But ... % \show\currentstates % \currentstates\par %% ... here it still contains %%\nstates 0 \rawprocesscommalist [foo,bar,baz] ... %% and the next directive has an empty result: \rawprocessaction[##1][\currentstates]% \fi }% } \protect \starttext \definestates[mystates][foo,bar,baz] %% At this point I’d like \mystates_states to contain (literally) %% “1=foo,2=bar,3=baz,unknown=,default=,” %% so the following command \mystates[1] % - foo %% would be equivalent to %%\processaction[1][1=foo,2=bar,3=baz,unknown=,default=,] \mystates[2] % - bar \mystates[42] % - dummy \stoptext ··8 My question: How can I use \[raw]processcommalist in an expanded definition? How can I get \[raw]processcommalist to operate on the expansion of its second argument? Does this even make sense? If not, what is the proper way? I’d be grateful for any advice Philipp PS: Yeah, I could use Lua for it but that’s not the question. pgp5Wf43R83vs.pgp Description: PGP signature ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] expansion and \processaction
Am 07.06.2012 um 14:05 schrieb Philipp Gesang: Hi all, my goal is a macro \definestates[foo][...,...] which takes a comma list and creates a monadic macro \foo[n]. \foo[n] should return either the nth item or, if (n list length), a default. I thought the right tools were \processcommalist to generate the mapping n-list item, as well as \processaction to retrieve the items. But naively I didn’t consider expansion ... My code so far: ··8 \unprotect \def\definestates{\dodoubleempty\do_define_states} \def\do_define_states[#1][#2]{% \expandafter\edef\csname#1_states\endcsname{% \nstates0 %% this is supposed to be expanded so we employ the \raw... variety \rawprocesscommalist[#2]\add_one_state% unknown=\dummystate,% default=\dummystate,% }% \do_do_define_states{#1}% } \let\dummystate\empty \newcount\nstates \unexpanded\def\add_one_state#1{% \advance\nstates\plusone \the\nstates=#1,% } \def\do_do_define_states#1{% \expandafter\def\csname#1\endcsname {\expandafter\dosingleempty\csname do_#1\endcsname}% \expandafter\def\csname do_#1\endcsname[##1]{% \iffirstargument % [DBG] cmd:#1, state:##1\par \edef\currentstates{\csname#1_states\endcsname}% %% At this point \currentstates should yield the whole mapping so %% we can use it with \processaction. But ... % \show\currentstates % \currentstates\par %% ... here it still contains %%\nstates 0 \rawprocesscommalist [foo,bar,baz] ... %% and the next directive has an empty result: \rawprocessaction[##1][\currentstates]% \fi }% } \protect \starttext \definestates[mystates][foo,bar,baz] %% At this point I’d like \mystates_states to contain (literally) %% “1=foo,2=bar,3=baz,unknown=,default=,” %% so the following command \mystates[1] % - foo %% would be equivalent to %%\processaction[1][1=foo,2=bar,3=baz,unknown=,default=,] \mystates[2] % - bar \mystates[42] % - dummy \stoptext ··8 My question: How can I use \[raw]processcommalist in an expanded definition? How can I get \[raw]processcommalist to operate on the expansion of its second argument? Does this even make sense? If not, what is the proper way? \unprotect \unexpanded\def\definestates {\dodoubleargument\definestates_indeed} \def\definestates_indeed[#1][#2]% {\setuevalue{#1}{\states_entry[#2]}} \unexpanded\def\states_entry {\dodoubleargument\states_entry_indeed} \def\states_entry_indeed[#1][#2]% {\getcommalistsize[#1]% \ifnum#2\commalistsize {\tttf NO ENTRY!}% \else \getfromcommalist[#1][#2]\commalistelement \fi} \protect \starttext \definestates[mystates][foo,bar,baz] \starttabulate \NC 2 \EQ \mystates [2] \NC\NR \NC 42 \EQ \mystates[42] \NC\NR \stoptabulate \stoptext Wolfgang ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___