[NTG-context] Missing space between numbers in \showcolor (MkIV only)
\starttext \showcolor[rgb] \stoptext Numbers are next to each other. In MkII (with \setupcolors[state=start]) it looks OK. Regards. Vedran Miletić ___ 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] Letters in the first level head instead of numbers
Am 25.02.2011 um 14:14 schrieb Procházka Lukáš Ing. - Pontex s. r. o.: > Hello, > > maybe already questioned in the past, but I cannot find the answer: > > How to change the numbering style for a particular head (e.g. section) from > numbers (1, 2...) to letters (A, B...) - which option and value > (http://wiki.contextgarden.net/Reference/en/setuphead)? % old method %\setuphead[chapter][conversion=Character] % new method \definestructureconversionset[myconversion][numbers,Characters][numbers] \setupheads[sectionconversionset=myconversion] \starttext \chapter{Knuth} \input knuth \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] Letters in the first level head instead of numbers
Hello, maybe already questioned in the past, but I cannot find the answer: How to change the numbering style for a particular head (e.g. section) from numbers (1, 2...) to letters (A, B...) - which option and value (http://wiki.contextgarden.net/Reference/en/setuphead)? Thank you in advance. Kind 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] [t-vim] Line numbers
On 23-2-2011 5:54, Marco wrote: On 2011-02-23 Aditya Mahajan wrote: [...] I do not think that either of these options is worth the trouble. No, definitely not. I am not sure what you want. Do you want [...] context --purgeall This will probably be difficult to implement, since the complete directory tree has to be scanned to find xyz-externalfilter-abc-X.___ remains. However you can register to-be-cleaned-up temp files with luatex.registertempfile(name) (namespace might change at some point) 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] [t-vim] Line numbers
On Wed, 23 Feb 2011, Marco wrote: On 2011-02-23 Aditya Mahajan wrote: Actually, `context --purgeall` deteles all the files with .tmp and .md5 extension in the current directory. Only the .vimout files remain. Does it on your system? Not on mine. If I compile the example posted earlier in the thread and execute context --purgeall afterwards, the files t-externalfilter-CON-0.tmp.md5 and t.tex.md5 still remain. You are right. Only the .tmp files are removed. @Hans: Can I somehow "register" temporary files that will be later removed by `context --purgeall`? 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] [t-vim] Line numbers
On 2011-02-23 Aditya Mahajan wrote: > Actually, `context --purgeall` deteles all the files with .tmp and .md5 > extension in the current directory. Only the .vimout files remain. Does it on your system? Not on mine. If I compile the example posted earlier in the thread and execute context --purgeall afterwards, the files t-externalfilter-CON-0.tmp.md5 and t.tex.md5 still remain. > Why not simply run `context --purgeall` (no filename)? See above. Regards 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] [t-vim] Line numbers
On Wed, 23 Feb 2011, Marco wrote: Do you want [...] context --purgeall This will probably be difficult to implement, since the complete directory tree has to be scanned to find xyz-externalfilter-abc-X.___ remains. Actually, `context --purgeall` deteles all the files with .tmp and .md5 extension in the current directory. Only the .vimout files remain. However context --purgeall filename should remove all temporary files belonging to the document like filename-externalfilter-CON-0.tmp % not removed filename-externalfilter-CON-0.tmp.md5 % not removed filename-externalfilter-CON-0.vimout % not removed So after the project is done one can run context --purgeall filename to get a clean directory structure without having to archive 30 temporary files. Why not simply run `context --purgeall` (no filename)? I will check how to ensure that .vimout files are also removed. The t-gnuplot module does something similar. So, perhaps I can borrow code from that. 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] [t-vim] Line numbers
On 2011-02-23 Aditya Mahajan wrote: > [...] > I do not think that either of these options is worth the trouble. No, definitely not. > I am not sure what you want. > Do you want > [...] > context --purgeall This will probably be difficult to implement, since the complete directory tree has to be scanned to find xyz-externalfilter-abc-X.___ remains. However context --purgeall filename should remove all temporary files belonging to the document like filename-externalfilter-CON-0.tmp % not removed filename-externalfilter-CON-0.tmp.md5 % not removed filename-externalfilter-CON-0.vimout % not removed So after the project is done one can run context --purgeall filename to get a clean directory structure without having to archive 30 temporary files. Regards 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] [t-vim] Line numbers
On Wed, 23 Feb 2011, Marco wrote: So, the easiest solution is to move (or perhaps simlink) the file to the temporary directory. Then you can include the file tmp/t.tex and the md5 hash will be created in the tmp directory. It will probably work, but is not a nice solution in my opinion. It looks strange that the document includes files from the tmp directory. From a tmp directory I expect to be able to delete the content without any effects. I do not make that assumption in t-vim. Currently there is no way to specify the output directory to mtxrun --ifchanged. So, the only way that I can implement this feature is to either manually copy the input file, or manually copy the md5 file. I do not think that either of these options is worth the trouble. Is it possible to convince the context script to remove the temporary stuff when called with the --purgeall option? I will look into that. I guess that the easiest way out is that, instead of using .vimout extension, I use .tmp extension. Then, all the temporary files will be removed by --purgeall. I don't think so. AFAIK --purgeall only deletes .tmp files with the basename as the document itself. I think it would make sense to convince --purgeall to be more grabby and to remove all .tmp files in the working dir + all files in the »directory« dir (here tmp). But I'm not sure about possible displeasing side effects, though. I am not sure what you want. Do you want context --purge filename to remove all the temp files that t-vim creates, or do you want context --purgeall to delete all the files created by t-vim that reside in the current directory? 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] [t-vim] Line numbers
On 2011-02-23 Aditya Mahajan wrote: > The md5 hashes are in the same directory as the file. So, in case you are > including a file from the current directory, the md5 hash will also be > there. So it's on purpose. I wasn't sure about that. > So, the easiest solution is to move (or perhaps simlink) the file > to the temporary directory. Then you can include the file tmp/t.tex and > the md5 hash will be created in the tmp directory. It will probably work, but is not a nice solution in my opinion. It looks strange that the document includes files from the tmp directory. From a tmp directory I expect to be able to delete the content without any effects. Anyway, I don't really care, since I usually don't delete the temporary files. > > Is it possible to convince the context script to remove the temporary > > stuff when called with the --purgeall option? > > I will look into that. I guess that the easiest way out is that, instead > of using .vimout extension, I use .tmp extension. Then, all the temporary > files will be removed by --purgeall. I don't think so. AFAIK --purgeall only deletes .tmp files with the basename as the document itself. I think it would make sense to convince --purgeall to be more grabby and to remove all .tmp files in the working dir + all files in the »directory« dir (here tmp). But I'm not sure about possible displeasing side effects, though. Regards 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] [t-vim] Line numbers
On Wed, 23 Feb 2011, Marco wrote: I stumbled over one thing: When set directory=tmp the temporary files are sent to the tmp directory except the md5 hashes of external file code, these are put in the working dir. The md5 hashes are in the same directory as the file. So, in case you are including a file from the current directory, the md5 hash will also be there. So, the easiest solution is to move (or perhaps simlink) the file to the temporary directory. Then you can include the file tmp/t.tex and the md5 hash will be created in the tmp directory. Is it possible to convince the context script to remove the temporary stuff when called with the --purgeall option? I will look into that. I guess that the easiest way out is that, instead of using .vimout extension, I use .tmp extension. Then, all the temporary files will be removed by --purgeall. 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] [t-vim] Line numbers
On 2011-02-22 Aditya Mahajan wrote: > Check the latest dev version of t-vim. > https://github.com/adityam/filter/blob/dev/t-vim.tex Brilliant. Works like a charm. I stumbled over one thing: When set directory=tmp the temporary files are sent to the tmp directory except the md5 hashes of external file code, these are put in the working dir. Example: %%% t.tex %%% \usemodule [vim] \definevimtyping [CON] [ syntax=context, directory=tmp, ] \starttext \typeCONfile {t.tex} \startCON % empty \stopCON \stoptext % Is it possible to convince the context script to remove the temporary stuff when called with the --purgeall option? Thanks for your work. Regards 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] [t-vim] Line numbers
On Tue, 22 Feb 2011, Marco wrote: On 2011-02-21 Aditya Mahajan wrote: 1) You have »Add line numbers« on your TODO list. What's the progress? No. I will look into them. I think that I should just be able to plug in ConTeXt's line numbering mechanism. I like the »just« in your sentence :) That would be awesome. Check the latest dev version of t-vim. https://github.com/adityam/filter/blob/dev/t-vim.tex I have not documented all the details, but the example at https://github.com/adityam/filter/blob/dev/tests/vim/line.tex should get you started. 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] [t-vim] Line numbers
On 2011-02-21 Aditya Mahajan wrote: > > 1) You have »Add line numbers« on your TODO list. What's the progress? > > No. I will look into them. I think that I should just be able to plug in > ConTeXt's line numbering mechanism. I like the »just« in your sentence :) That would be awesome. > > 2) To set the font size I do the following, is there a better solution > > like bodyfont=xyz for definetyping or is it just fine like this? > > > > \definevimtyping [PHP] [ > > syntax=php, > > before={\switchtobodyfont[small]}, > > ] > > I think that the best idea is to add a style=..., and color=..., key. ACK > In fact, I have added these keys to t-filter module. If you get the latest > version of the module from github[1], done > then you should be able to say: > > \definevimtyping > [PHP] > [syntax=php, > style={\switchtobodyfont[small]\setupinterlinespace}, > ] That works/looks nice. > PS: The style=.. and color=... attributes only work with MkIV. That's fine for me. Regards 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] [t-vim] Line numbers
On Sat, 19 Feb 2011, Marco wrote: I like your t-vim module. I think it's a nice concept not te reinvent the wheel and to take advantage of the hundreds of syntax files of the vim contributors. 1) You have »Add line numbers« on your TODO list. What's the progress? No. I will look into them. I think that I should just be able to plug in ConTeXt's line numbering mechanism. 2) To set the font size I do the following, is there a better solution like bodyfont=xyz for definetyping or is it just fine like this? \definevimtyping [PHP] [ syntax=php, before={\switchtobodyfont[small]}, ] I think that the best idea is to add a style=..., and color=..., key. In fact, I have added these keys to t-filter module. If you get the latest version of the module from github[1], then you should be able to say: \definevimtyping [PHP] [syntax=php, style={\switchtobodyfont[small]\setupinterlinespace}, ] I will upload a new version soon. Aditya [1]: https://github.com/adityam/filter/blob/dev/t-filter.tex PS: The style=.. and color=... attributes only work with MkIV. I need to think of a good way to get them to work in MkII. ___ 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] [t-vim] Line numbers
Hi everybodyoy Hi Aditya I like your t-vim module. I think it's a nice concept not te reinvent the wheel and to take advantage of the hundreds of syntax files of the vim contributors. 1) You have »Add line numbers« on your TODO list. What's the progress? 2) To set the font size I do the following, is there a better solution like bodyfont=xyz for definetyping or is it just fine like this? \definevimtyping [PHP] [ syntax=php, before={\switchtobodyfont[small]}, ] 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 remove unwanted coordinate numbers(metafun)
On 11-2-2011 3:26, Jeong Dalyoung wrote: Dear all. I try to draw a circle with points on it as following: path p; p:= fullcircle scaled 5cm; draw p; pickup pencircle scaled 2mm; k:=1; for i = 2.2,3,3.5,4.5,5,7,0,.7,1.3: drawpoint point i of p; label.lft(decimal k, point i of p); k:= k+1; endfor; It draws a circle, points, label, but unwanted coordinate numbers like (60.43535, 36.97691), too. I didn't see such numbers in any example in metafun document. If I use z[k] like z[k] = point i of P; draw z[k] Then such a long numbers disappeared. Is it the only way to surpress those numbers not using z? use drawdot then ... drawpoints is one of the tracing macros - 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] how to remove unwanted coordinate numbers(metafun)
Dear all. I try to draw a circle with points on it as following: path p; p:= fullcircle scaled 5cm; draw p; pickup pencircle scaled 2mm; k:=1; for i = 2.2,3,3.5,4.5,5,7,0,.7,1.3: drawpoint point i of p; label.lft(decimal k, point i of p); k:= k+1; endfor; It draws a circle, points, label, but unwanted coordinate numbers like (60.43535, 36.97691), too. I didn't see such numbers in any example in metafun document. If I use z[k] like z[k] = point i of P; draw z[k] Then such a long numbers disappeared. Is it the only way to surpress those numbers not using z? Thank you for reading. 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 ___
Re: [NTG-context] line numbers - method=page
Ok, thanks for the info! Daniel Am 02.01.11 11:17, schrieb Thomas Schmitz: On Sun, 02 Jan 2011 00:34:12 +0100 Daniel Schopper wrote: I'm using ConTeXt ver: 2010.07.30 11:35 MKIV fmt: 2010.12.31 which should be the newest version available on http://tlcontrib.metatex.org/2010. You will have to use a more recent (beta) version. I have added a sentence to the wiki page explaining that. Thomas ___ 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 ___ -- Daniel Schopper Esterhazygasse 31/1/9 1060 Wien mobil. +43 676 4302747 tel. +43 1 5851767 mail. daniel.schop...@aon.at ___ 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] line numbers - method=page
On Sun, 02 Jan 2011 00:34:12 +0100 Daniel Schopper wrote: I'm using ConTeXt ver: 2010.07.30 11:35 MKIV fmt: 2010.12.31 which should be the newest version available on http://tlcontrib.metatex.org/2010. You will have to use a more recent (beta) version. I have added a sentence to the wiki page explaining that. Thomas ___ 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] line numbers - method=page
Dear all, on trying to reproduce the TEI to ConTeXt example on http://wiki.contextgarden.net/TEI_xml I haven't been able to get the line numbering per page working right. I directly copy-pasted the relevant part of the seventh listing which goes like this: \setuplinenumbering[location=inner, step=5, method=page, style=\tfxx, align=left, distance=0.3em, width=0.3cm] - unfortunately to no avail. method=page isn't mentioned neither in the context manual nor in the wiki so I fear I'll have to find some workaround? Being a absolute newbie to ConTeXt I actually tried some primitive fiddling with variations of \setupheadertexts[\setcounter{linenumber}{0}] I'm using ConTeXt ver: 2010.07.30 11:35 MKIV fmt: 2010.12.31 which should be the newest version available on http://tlcontrib.metatex.org/2010. Any kind of help is highly appreciated! Please forgive me if there has been already mentioned a solution on this list which I missed… Thanks in advance! Daniel ___ 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] Marginal line numbers
On Dec 16, 2010, at 10:28 PM, Jon Crump wrote: > Thomas, et alia. > > Thanks so very much! I now have this: > > \startluacode > function filter(s) > if math.mod(s,5) == 0 then >context.color( { "darkred" }, s ) > end > end > \stopluacode > > \define[1]\MyNumber% > {\ctxlua{filter(#1)}\endgraf} > > \startxmlsetups xml:lb > \lineNumbers{\MyNumber{\xmlatt{#1}{n}}} > \xmlflush{#1} > \stopxmlsetups > > \defineinmargin [lineNumbers] [outer] [normal] > This was just an example to show you how to use lua to do things which are difficult or impossible or cumbersome in TeX alone, such as math, working with strings (substitutions, etc.), conditionals, loops... You don't have to take my code verbatim; the "darkred" was just meant to show that you can apply certain code to a number if it matches a condition (here: be divisible by 5). > This gets me what I wanted. Still fumbling greatly with the macro > syntax. I'm not sure what the recursion is for, for example. On the > other hand the lua seems rather straightforward to me by comparison. I > tried returning an empty string like this: context.color( {"blue"}, '' > ) to remove the other numbers, but that seemed silly, so I just > removed the 'else' clause instead, and that seemed to work as well. > Yes, of course, if all you want is process numbers divisible by 5, that's the easiest way. But it's good to know that lua allows more complex conditionals - you could use "elseif"s to make numbers divisible by 100 bold, or whatever. I find such conditionals in TeX much more cumbersome; even for somebody with no programming background like myself, they are easy to write in lua. The recursion was just a way of demonstrating the effect. \dorecurse is a wonderful macro to construct minimal examples (you can search the mail archive for some real gems). And, as a hint: constructing a compilable minimal example not only is educational (I don't know how often I could solve my problems when I tried to produce a minimal example and saw where my approach was failing), but will also improve your chances of people actually willing to help you. If you want to see an elegant way of producing minimal examples in xml, search the mail archive for "xmlprocessbuffer." Thomas ___ 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] Marginal line numbers
On Dec 16, 2010, at 10:28 PM, Jon Crump wrote: > Thomas, et alia. > > Thanks so very much! I now have this: > > \startluacode > function filter(s) > if math.mod(s,5) == 0 then > context.color( { "darkred" }, s ) > end > end > \stopluacode > > \define[1]\MyNumber% > {\ctxlua{filter(#1)}\endgraf} > > \startxmlsetups xml:lb > \lineNumbers{\MyNumber{\xmlatt{#1}{n}}} > \xmlflush{#1} > \stopxmlsetups > > \defineinmargin [lineNumbers] [outer] [normal] > This was just an example to show you how to use lua to do things which are difficult or impossible or cumbersome in TeX alone, such as math, working with strings (substitutions, etc.), conditionals, loops... You don't have to take my code verbatim; the "darkred" was just meant to show that you can apply certain code to a number if it matches a condition (here: be divisible by 5). > This gets me what I wanted. Still fumbling greatly with the macro > syntax. I'm not sure what the recursion is for, for example. On the > other hand the lua seems rather straightforward to me by comparison. I > tried returning an empty string like this: context.color( {"blue"}, '' > ) to remove the other numbers, but that seemed silly, so I just > removed the 'else' clause instead, and that seemed to work as well. > Yes, of course, if all you want is process numbers divisible by 5, that's the easiest way. But it's good to know that lua allows more complex conditionals - you could use "elseif"s to make numbers divisible by 100 bold, or whatever. I find such conditionals in TeX much more cumbersome; even for somebody with no programming background like myself, they are easy to write in lua. The recursion was just a way of demonstrating the effect. \dorecurse is a wonderful macro to construct minimal examples (you can search the mail archive for some real gems). And, as a hint: constructing a compilable minimal example not only is educational (I don't know how often I could solve my problems when I tried to produce a minimal example and saw where my approach was failing), but will also improve your chances of people actually willing to help you. If you want to see an elegant way of producing minimal examples in xml, search the mail archive for "xmlprocessbuffer." Thomas ___ 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] Marginal line numbers
On Thu, Dec 16, 2010 at 1:34 PM, Wolfgang Schuster wrote: > > Am 16.12.2010 um 22:28 schrieb Jon Crump: > > In python-speak I'd interpret context.color() as a method call on a > module 'context'. Could you, or anyone, direct me to any documentation > for this module and a list of the properties and methods that it > supports? > > http://pragma-ade.com/show-man-44.htm > Wolfgang Wolfgang, many thanks. Jon ___ 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] Marginal line numbers
Am 16.12.2010 um 22:28 schrieb Jon Crump: > In python-speak I'd interpret context.color() as a method call on a > module 'context'. Could you, or anyone, direct me to any documentation > for this module and a list of the properties and methods that it > supports? http://pragma-ade.com/show-man-44.htm 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] Marginal line numbers
Thomas, et alia. Thanks so very much! I now have this: \startluacode function filter(s) if math.mod(s,5) == 0 then context.color( { "darkred" }, s ) end end \stopluacode \define[1]\MyNumber% {\ctxlua{filter(#1)}\endgraf} \startxmlsetups xml:lb \lineNumbers{\MyNumber{\xmlatt{#1}{n}}} \xmlflush{#1} \stopxmlsetups \defineinmargin [lineNumbers] [outer] [normal] This gets me what I wanted. Still fumbling greatly with the macro syntax. I'm not sure what the recursion is for, for example. On the other hand the lua seems rather straightforward to me by comparison. I tried returning an empty string like this: context.color( {"blue"}, '' ) to remove the other numbers, but that seemed silly, so I just removed the 'else' clause instead, and that seemed to work as well. In python-speak I'd interpret context.color() as a method call on a module 'context'. Could you, or anyone, direct me to any documentation for this module and a list of the properties and methods that it supports? On Wed, Dec 15, 2010 at 11:34 PM, Thomas A. Schmitz wrote: > This is easy with a lua function. Since you know python, I guess the > following example will be easy for you: > > \startluacode > function filter(s) > if math.mod(s,5) == 0 then > context.color( { "darkred" }, s ) > else > context.color( { "darkblue" }, s ) > end > end > \stopluacode > > \define[1]\MyNumber% > {\ctxlua{filter(#1)}\endgraf} > > \starttext > > \dorecurse{25}{\MyNumber{\recurselevel}} > > \stoptext > > This should get you going, I hope > > Good luck > > Thomas ___ 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] Marginal line numbers
On Dec 14, 2010, at 9:33 PM, Jon Crump wrote: > All, > > Thanks to Thomas's help, I've been making my way up the learning curve. > > My TEI xml has empty lb elements indicating lines in the original and > corresponding lb elements in the translation. I'd like to be able to > set these numbers in the margin so that readers may coordinate the > lineation. So far I have this: > > \startxmlsetups xml:lb > \lineNumbers{\xmlatt{#1}{n}} > \xmlflush{#1} > \stopxmlsetups > > \defineinmargin [lineNumbers] [outer] [normal] > > which works, but I'd like to be able to set only every fifth or tenth > line number. Is there a way to perform some arithmetic on the value of > the n attribute and then execute \lineNumbers accordingly? > > for example: > > if n%5 == 0 then \lineNumbers else ignore > > Thanks, > Jon This is easy with a lua function. Since you know python, I guess the following example will be easy for you: \startluacode function filter(s) if math.mod(s,5) == 0 then context.color( { "darkred" }, s ) else context.color( { "darkblue" }, s ) end end \stopluacode \define[1]\MyNumber% {\ctxlua{filter(#1)}\endgraf} \starttext \dorecurse{25}{\MyNumber{\recurselevel}} \stoptext This should get you going, I hope Good luck Thomas ___ 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] Marginal line numbers
All, Thanks to Thomas's help, I've been making my way up the learning curve. My TEI xml has empty lb elements indicating lines in the original and corresponding lb elements in the translation. I'd like to be able to set these numbers in the margin so that readers may coordinate the lineation. So far I have this: \startxmlsetups xml:lb \lineNumbers{\xmlatt{#1}{n}} \xmlflush{#1} \stopxmlsetups \defineinmargin [lineNumbers] [outer] [normal] which works, but I'd like to be able to set only every fifth or tenth line number. Is there a way to perform some arithmetic on the value of the n attribute and then execute \lineNumbers accordingly? for example: if n%5 == 0 then \lineNumbers else ignore Thanks, Jon ___ 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] metafun: formatting numbers
On 12-12-2010 12:49, Peter Münster wrote: Hello, Formatting numbers seems to be buggy: \starttext \startMPcode drawoptions(withpen pencircle scaled .25pt withcolor .5white) ; draw hlingrid (0, 20, 1, 20cm, 10cm) ; fmt_pictures := false ; % use TeX as formatting engine draw hlintext.lft(0, 20, 1, 20cm, "@3e") ; \stopMPcode \stoptext See also page 381 of latest metafun-s.pdf. in mp-grid you can change: def do_initialize_numbers = if not numbers_initialized : init_numbers ( textext.raw("$-$") , textext.raw("$1$") , textext.raw("${\times}10$") , textext.raw("${}^-$") , textext.raw("${}^2$") ) ; if unknown _trial_run_ : numbers_initialized := true ; else : % no reset, otherwise textexts get out of sync % slows down graphics a bit but not much fi ; fi ; enddef ; - 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] metafun: formatting numbers
Hello, Formatting numbers seems to be buggy: \starttext \startMPcode drawoptions(withpen pencircle scaled .25pt withcolor .5white) ; draw hlingrid (0, 20, 1, 20cm, 10cm) ; fmt_pictures := false ; % use TeX as formatting engine draw hlintext.lft(0, 20, 1, 20cm, "@3e") ; \stopMPcode \stoptext See also page 381 of latest metafun-s.pdf. Peter -- Contact information: http://pmrb.free.fr/contact/ ___ 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] Figure and equation numbers only include chapter number
On Friday 03 December 2010 07:37:55 seasoul wrote: > Dear All, > >After my updating context minimal, the equation and figure numbers > became very weird. > > For example, all the figures in chapter 2 labeled as "figure 2." all the > equations in chapter 2 as "(2.). > > I have seen a report in the mailing list also mentioning a similar problem. Yes, there was a fluctuation yesterday that produced funny numbering. It appears to be corrected and correct numbering is now produced. Try updating from the minimals and re-process your files. (In fact, for some reason, it appeared to take two runs on my project to get the numbering back - probably making use of remaining auxiliary files or something of the sort...) Alan ___ 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] Figure and equation numbers only include chapter number
Dear All, After my updating context minimal, the equation and figure numbers became very weird. For example, all the figures in chapter 2 labeled as "figure 2." all the equations in chapter 2 as "(2.). I have seen a report in the mailing list also mentioning a similar problem. ___ 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] Problem with expansion tables (macros with variable numbers of paramaters)
Hello ConTeXist... I work on my first module (t-scancsv) which allows to process external CSV files. Now I have a problem with the processing of tables that require expansion line data. Unable to discover why my macro is not capable of handling the expanded rows. It seems to me that the macros with variable number of parameters work differently from the macros with a fixed number of parameters. I attach a minimal example of what problems occur in the processing of expanded lines. I need to write a macro \doloopaction with a variable number of parameters that would work as well as macro \doloopfromto, which has 3 fixed parameters. In addition, I attach a demonstration of the failing macro \DOLOOPFROMTO (variable number of parameters), but seems to me the same as the macro \doloopfromto. Someone help me find out what the problem is?? Thanx Jaroslav Here is my example: \def\FirstName{\recurselevel. MyFirstName} \def\Surname{\recurselevel. MySurname} \def\Id{\recurselevel. MyId} \def\lineaction{\expanded{\bTR\bTD \Id \eTD\bTD \FirstName \eTD\bTD \Surname \eTD\eTR}} \def\tab{\bTR\bTD \Id \eTD\bTD \FirstName \eTD\bTD \Surname \eTD\eTR} \def\xtab{\expanded{\bTR\bTD \Id \eTD\bTD \FirstName \eTD\bTD \Surname \eTD\eTR}} \def\bT{\bTABLE\bTR\bTD ID\eTD\bTD FirstName\eTD\bTD Surname\eTD\eTR} \def\eT{\eTABLE} \def\doloopfromto#1#2#3{% \dostepwiserecurse{#1}{#2}{1}{#3} }% \def\doloopaction{\dotriplegroupempty\doloopAction} \def\doloopAction#1#2#3{% \doifelsenothing{#1} {\doloopfromto{1}{10}{\lineaction}%0 par., } {\doifelsenothing{#2} {\doloopfromto{1}{10}{#1}% 1 par } {\doifelsenothing{#3} {\doloopfromto{1}{#2}{#1}%2 par } {\doloopfromto{#2}{#3}{#1}%3 par }}} } \def\DOLOOPFROMTO{\dotriplegroupempty\DOLOOPFROMTOAction} \def\DOLOOPFROMTOAction#1#2#3{% \doifelsenothing{#1} {%\doloopfromto{1}{10}{\lineaction}%0 par., \dostepwiserecurse{1}{10}{1}{\lineaction} } {\doifelsenothing{#2} {%\doloopfromto{1}{10}{#1}% 1 par \dostepwiserecurse{1}{10}{1}{#1} } {\doifelsenothing{#3} {%\doloopfromto{1}{#2}{#1}%2 par \dostepwiserecurse{1}{#2}{1}{#1} } {%\doloopfromto{#2}{#3}{#1}%3 par \dostepwiserecurse{#2}{#3}{1}{#1} }}} } \starttext 1. OK, WITHOUT EXPANSION is working as expected \bT \doloopfromto{1}{3}{\tab} \eT 2. OK, with expansion is working as expected \bT \doloopfromto{1}{5}{\xtab} \eT 3. OK, with expansion is working as expected \bT \doloopfromto{1}{5}{\lineaction} \eT 4. OK, with expansion (lineaction macro) is working as expected \bT \doloopaction \eT 5. OK, WITHOUT EXPANSION is working as expected \bT \doloopaction{\tab} \eT 6. OK, WITHOUT EXPANSION is working as expected \bT \doloopaction{\tab}{3} \eT 8. OK, WITHOUT EXPANSION is working as expected \bT \doloopaction{\tab}{3}{5} \eT 9. ERROR, WITH EXPANSION is not working (unlike examples 2, 3, 4) \bT %\doloopaction{\xtab} \eT 10. ERROR, WITH EXPANSION is not working (unlike examples 2, 3, 4) \bT %\doloopaction{\xtab}{3} \eT 11. ERROR, WITH EXPANSION is not working (unlike examples 2, 3, 4) \bT %\doloopaction{\xtab}{3}{5} \eT 12. OK, WITH EXPANSION (default lineaction) is working as expected \bT \DOLOOPFROMTO \eT 13. OK, WITHOUT expansion, but is working as expected \bT \DOLOOPFROMTO{\tab} \eT 14. ERROR, WITH EXPANSION is not working (unlike examples 2, 3, 4) \bT %\DOLOOPFROMTO{\xtab} \eT 15. ERROR, WITH EXPANSION is not working (unlike examples 2, 3, 4) \bT %\DOLOOPFROMTO{\lineaction}{4} \eT 16. ERROR, WITH EXPANSION is not working (unlike examples 2, 3, 4) \bT %\DOLOOPFROMTO{\lineaction}{4}{6} \eT \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] Referencing line numbers inside a typing
Am Mittwoch 27 Oktober 2010, 16:52:07 schrieb Wolfgang Schuster: > Am 27.10.2010 um 11:34 schrieb Stefan Müller: > > Thanks Wolgang, this looks pretty nice. Unfortunately I get the following > > error when running your example (ConTeXt ver: 2010.10.22 16:46 MKIV > > fmt: 2010.10.27 int: english/english): > > > > references : unknown reference [][lr:b:line:single] > > references : unknown reference [][lr:b:line:range] > > > > Any ideas? > > Works for me with the same context version. > > Do you use 'texexec' or 'context' to process the file? > > Wolfgang My mistake. I forgot \stoptext. It seems kind of inconvenient that I get such a misleading error message. I added some stuff regarding this thread to the wiki. http://wiki.contextgarden.net/Verbatim_text#Referencing_line_numbers http://wiki.contextgarden.net/Reference/en/inline http://wiki.contextgarden.net/Reference/en/someline http://wiki.contextgarden.net/Reference/en/startline http://wiki.contextgarden.net/Reference/en/inlinerange I hope that helps others. Best wishes, Stefan ___ 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] Referencing line numbers inside a typing
Am Dienstag 26 Oktober 2010, 21:12:01 schrieb Wolfgang Schuster: > Am 26.10.2010 um 20:47 schrieb Stefan Müller: > > One more question before wikifying: Is there a way to prevent the prefix > > "line"? I want to say something like "In lines 3 to 13". > > The texts „line“ and „lines“ are set with \setuplabeltext but you can see > alternative texts with \inline{...}[]. > > \setuptyping[numbering=line,escape=yes] > > \starttext > > See \inline[line:single] and also \inline[line:range]. > > See \inline{typeline}[line:single] and also \inline{typelines}[line:range]. > > See line~\inlinerange[line:single] and also lines~\inlinerange[line:range]. > > \starttyping > line 1 > line 2/BTEX\startline[line:range]/ETEX > line 3/BTEX\someline[line:single]/ETEX > line 4 > line 5/BTEX\stopline[line:range]/ETEX > line 6 > \stoptyping > > \stoptext > > Wolfgang Thanks Wolgang, this looks pretty nice. Unfortunately I get the following error when running your example (ConTeXt ver: 2010.10.22 16:46 MKIV fmt: 2010.10.27 int: english/english): references : unknown reference [][lr:b:line:single] references : unknown reference [][lr:b:line:range] Any ideas? Stefan ___ 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] Referencing line numbers inside a typing
Am 26.10.2010 um 20:47 schrieb Stefan Müller: > One more question before wikifying: Is there a way to prevent the prefix > "line"? I want to say something like "In lines 3 to 13". The texts „line“ and „lines“ are set with \setuplabeltext but you can see alternative texts with \inline{...}[]. \setuptyping[numbering=line,escape=yes] \starttext See \inline[line:single] and also \inline[line:range]. See \inline{typeline}[line:single] and also \inline{typelines}[line:range]. See line~\inlinerange[line:single] and also lines~\inlinerange[line:range]. \starttyping line 1 line 2/BTEX\startline[line:range]/ETEX line 3/BTEX\someline[line:single]/ETEX line 4 line 5/BTEX\stopline[line:range]/ETEX line 6 \stoptyping \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] Referencing line numbers inside a typing
On 26.10.2010 15:31, Wolfgang Schuster wrote: Am 26.10.2010 um 10:30 schrieb Stefan Müller: Hi list, is there a (preferably easy) way to reference line numbers inside a typing? Minimal (not working) example: \setuptyping[numbering=line] \starttext In the following typing, \in{line}{}[line:intyping] is really interesting. \starttyping This line is so interesting. \stoptyping \stoptext MkIV: \setuptyping[numbering=line,escape=yes] \starttext In the following typing, \inline[line:intyping] is really interesting. \starttyping line 1 line 2 line 3/BTEX\someline[line:intyping]/ETEX line 4 \stoptyping \stoptext Wolfgang One more question before wikifying: Is there a way to prevent the prefix "line"? I want to say something like "In lines 3 to 13". Thanks, Stefan ___ 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] Referencing line numbers inside a typing
Am 26.10.2010 um 10:30 schrieb Stefan Müller: > Hi list, > > is there a (preferably easy) way to reference line numbers inside a typing? > Minimal (not working) example: > > \setuptyping[numbering=line] > \starttext > In the following typing, \in{line}{}[line:intyping] is really interesting. > \starttyping > This line is so interesting. > \stoptyping > \stoptext MkIV: \setuptyping[numbering=line,escape=yes] \starttext In the following typing, \inline[line:intyping] is really interesting. \starttyping line 1 line 2 line 3/BTEX\someline[line:intyping]/ETEX line 4 \stoptyping \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] Referencing line numbers inside a typing
Hi list, is there a (preferably easy) way to reference line numbers inside a typing? Minimal (not working) example: \setuptyping[numbering=line] \starttext In the following typing, \in{line}{}[line:intyping] is really interesting. \starttyping This line is so interesting. \stoptyping \stoptext Thanks, Stefan ___ 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] en-dash for ranges of numbers in Bibliographies
Hi, in BibTeX databases ranges of numbers are usually listed with a single dash (e.g. 3-7) for compatibility reasons. Therefore the standard BibTeX styles convert a single dash in page numbers or range of numbers to a double dash (3--7). How do I get the same behaviour for \volume \issue \pages in the bibliographic module? Thanks! Cheers, Florian ___ 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] Verbatim typing with numbers inside float
On 07.10.2010 09:35, Alan BRASLAU wrote: On Thursday 07 October 2010 09:19:42 Hans Hagen wrote: On 7-10-2010 12:02, Stefan Müller wrote: Splitting up long source code in several pieces (one per page) and put them in separate figures doesn't seem right to me. Setting it as numbered paragraph? Putting up a fake caption with \placefloatcaption (which doesn't seem to work in MkIV)? Are there other possiblities of numbering (by section) more or less big chunks of source code I'm not thinking of? That would help me very much. Thanks for thinking about that. you can make your own construct, maybe something with a background (textbackgrounds can cross pages) Hello, I use textbackgrounds to set-off paragraphs, for example, here as secondary material. It does not float and, indeed, may flow over many pages. This is a concrete example (to which you could add line numbering): \definetextbackground [secondary] [location=paragraph, background=color,backgroundscreen=middlegray, leftoffset=0.5cm,rightoffset=0.5cm, topoffset=.25ex,bottomoffset=.25ex, before={\blank[small]\switchtobodyfont[script]}, after={\blank[small]}, frame=off] \kindofpagetextareas3 % fix from Hans % Indeed, there are several internal methods available % for managing text areas. Without this fix, the background % color bleeds over footnotes and floats external to the % secondary material. \startsecondary Here is some less interesting detailed stuff that can be skipped if you wish… \stopsecondary Alan Thanks, this is pretty nice. I'm going to use something like that inside an "algorithm enumeration", so I get the number I can reference to. This is better than the floating-approach, I think. Thanks for the ideas, Stefan. ___ 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] Verbatim typing with numbers inside float
On Thursday 07 October 2010 09:19:42 Hans Hagen wrote: > On 7-10-2010 12:02, Stefan Müller wrote: > > > Splitting up long source code in several pieces (one per page) and put > > them in separate figures doesn't seem right to me. Setting it as > > numbered paragraph? Putting up a fake caption with \placefloatcaption > > (which doesn't seem to work in MkIV)? Are there other possiblities of > > numbering (by section) more or less big chunks of source code I'm not > > thinking of? That would help me very much. Thanks for thinking about > > that. > > you can make your own construct, maybe something with a background > (textbackgrounds can cross pages) > Hello, I use textbackgrounds to set-off paragraphs, for example, here as secondary material. It does not float and, indeed, may flow over many pages. This is a concrete example (to which you could add line numbering): \definetextbackground [secondary] [location=paragraph, background=color,backgroundscreen=middlegray, leftoffset=0.5cm,rightoffset=0.5cm, topoffset=.25ex,bottomoffset=.25ex, before={\blank[small]\switchtobodyfont[script]}, after={\blank[small]}, frame=off] \kindofpagetextareas3 % fix from Hans % Indeed, there are several internal methods available % for managing text areas. Without this fix, the background % color bleeds over footnotes and floats external to the % secondary material. \startsecondary Here is some less interesting detailed stuff that can be skipped if you wish… \stopsecondary Alan ___ 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] Verbatim typing with numbers inside float
On 7-10-2010 12:02, Stefan Müller wrote: Thank you very much for your effort. Pretty amazing what's doable. Unfortunately there are two issues: The distance between numbers and source lines is too small for bigger line numbers. I just have to make "distance=0em" big enough for this to work, right? or width .. just experiment with values The other thing: The width available for the caption is capped by the width of the longest source line. I think I prefer the source lines to start at the left margin. you could move the framed to the right (\hskip1em or so) but on the other hand it might look more consistent if the numbers stick into some virtual margin In addition there is something else I didn't think of when I put up that mail (sorry for that). If I put (a very long piece) source inside a figure I won't have pagebreaks, right? So this makes me think it's probably not what I'm looking for. no page breaks indeed (at least not now in such cases) Splitting up long source code in several pieces (one per page) and put them in separate figures doesn't seem right to me. Setting it as numbered paragraph? Putting up a fake caption with \placefloatcaption (which doesn't seem to work in MkIV)? Are there other possiblities of numbering (by section) more or less big chunks of source code I'm not thinking of? That would help me very much. Thanks for thinking about that. you can make your own construct, maybe something with a background (textbackgrounds can cross pages) 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] Verbatim typing with numbers inside float
On 06.10.2010 22:24, Hans Hagen wrote: On 6-10-2010 4:26, Stefan Müller wrote: Hi list, I defined a float for typesetting algorithms, so I can reference them at other places in the document. \definefloat[algorithm][algorithms] When I now place such a figure with \placealgorithm[here][alg:myalgorithm]{Very neat algorithm.}{ \starttyping some source code \stoptyping } then the numbering I set up with \setuptyping[numbering=line] \setuplinenumbering[location=text] is gone. Is there a way to get around this? I try to not use itemize for this (although it seems to work with itemize), because I'd rather use the more semantically correct approach. Any help appreciated. this sort of works \startbuffer some source code some source code some source code \stopbuffer \setuplinenumbering[style=\ttx,distance=0em,width=1em] \startsetups algorithm \startlinenumbering \setuptyping[file][before=,after=] \framed[strut=no,align=normal,frame=off]{\typebuffer} \stoplinenumbering \stopsetups \placealgorithm [here][alg:myalgorithm] {Very neat algorithm.} {\directsetup{algorithm}} - 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 - Thank you very much for your effort. Pretty amazing what's doable. Unfortunately there are two issues: The distance between numbers and source lines is too small for bigger line numbers. I just have to make "distance=0em" big enough for this to work, right? The other thing: The width available for the caption is capped by the width of the longest source line. I think I prefer the source lines to start at the left margin. In addition there is something else I didn't think of when I put up that mail (sorry for that). If I put (a very long piece) source inside a figure I won't have pagebreaks, right? So this makes me think it's probably not what I'm looking for. Splitting up long source code in several pieces (one per page) and put them in separate figures doesn't seem right to me. Setting it as numbered paragraph? Putting up a fake caption with \placefloatcaption (which doesn't seem to work in MkIV)? Are there other possiblities of numbering (by section) more or less big chunks of source code I'm not thinking of? That would help me very much. Thanks for thinking about that. Best regards, Stefan. ___ 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] Verbatim typing with numbers inside float
On 6-10-2010 4:26, Stefan Müller wrote: Hi list, I defined a float for typesetting algorithms, so I can reference them at other places in the document. \definefloat[algorithm][algorithms] When I now place such a figure with \placealgorithm[here][alg:myalgorithm]{Very neat algorithm.}{ \starttyping some source code \stoptyping } then the numbering I set up with \setuptyping[numbering=line] \setuplinenumbering[location=text] is gone. Is there a way to get around this? I try to not use itemize for this (although it seems to work with itemize), because I'd rather use the more semantically correct approach. Any help appreciated. this sort of works \startbuffer some source code some source code some source code \stopbuffer \setuplinenumbering[style=\ttx,distance=0em,width=1em] \startsetups algorithm \startlinenumbering \setuptyping[file][before=,after=] \framed[strut=no,align=normal,frame=off]{\typebuffer} \stoplinenumbering \stopsetups \placealgorithm [here][alg:myalgorithm] {Very neat algorithm.} {\directsetup{algorithm}} - 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] Verbatim typing with numbers inside float
On 6-10-2010 4:26, Stefan Müller wrote: Hi list, I defined a float for typesetting algorithms, so I can reference them at other places in the document. \definefloat[algorithm][algorithms] When I now place such a figure with \placealgorithm[here][alg:myalgorithm]{Very neat algorithm.}{ \starttyping some source code \stoptyping } then the numbering I set up with \setuptyping[numbering=line] \setuplinenumbering[location=text] is gone. Is there a way to get around this? I try to not use itemize for this (although it seems to work with itemize), because I'd rather use the more semantically correct approach. Any help appreciated. needs a bit of thinking ... (deeply burried numbering) - 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] Verbatim typing with numbers inside float
Hi list, I defined a float for typesetting algorithms, so I can reference them at other places in the document. \definefloat[algorithm][algorithms] When I now place such a figure with \placealgorithm[here][alg:myalgorithm]{Very neat algorithm.}{ \starttyping some source code \stoptyping } then the numbering I set up with \setuptyping[numbering=line] \setuplinenumbering[location=text] is gone. Is there a way to get around this? I try to not use itemize for this (although it seems to work with itemize), because I'd rather use the more semantically correct approach. Any help appreciated. Thanks in advance, Stefan. ___ 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] numbers missing in subsubsubsubsubsubsection
Am 11.09.2010 um 22:50 schrieb Steffen Wolfrum: > > Hi all, > > how do I get my numbers in level nine (and higher) back? > See example below please. Add \definestructureprefixset [myset] [section-1,section-2,section-3,section-4,section-5,section-6,section-7,section-8,section-9,section-10,section-11] [] \setupheads[sectionset=myset] to your document. 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] numbers missing in subsubsubsubsubsubsection
Hi all, how do I get my numbers in level nine (and higher) back? See example below please. Did someone change module[subsub] ?? Thanks in advance, Steffen [2010.09.05 13:23 MKIV] = \usemodule[subsub] \starttext \definehead [LevelSeven] [subsubsubsubsection] \definehead [LevelNine] [subsubsubsubsubsubsection] \setuphead [LevelSeven] [sectionsegments=7:7] \setuphead [LevelNine] [sectionsegments=9:9] \LevelSeven{Seven} \LevelNine{Nine} \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] varying headers, footers, page numbers
On Tue, Aug 24, 2010 at 6:01 PM, Michael Goerz wrote: > I'm trying to create a book where the front matter has no > headers/footers, except roman numeral page numbers at the top outside of the > page. The main matter should have Arabic numeral page numbers > (restarting with '1') at the top outside of each page, plus the name of > the book in the header of each even page and the name of the chapter in > the header of each odd page, with no footer. However, on the pages > where a new chapter starts (which is set to always be an odd page), > there should be no header, and the page number should appear centered > at the bottom of the page. > > I'm quite confused about how to achieve this in ConTeXt. > > An excerpt from the project structure is > ./env.tex > ./project.tex > ./book/book.tex > ./book/chapters/chapter1.tex > > The following is a shortened excerpt from book.tex: > \startfrontmatter > \setuppagenumbering[state=stop] % nothing for now, should be roman page > % numbers later > \component book/frontmatter > % ToC ... > \stopfrontmatter > > \startbodymatter > \setuppagenumber[number=1] > \setupheadertexts > [{Name of Chapter}] [{}] > [{}] [{Name of Book}] > \setuppagenumbering[ > alternative=doublesided, % mirrored even/odd pages > location={header,margin}, > style=small] > \component vol04_1/articles/azimov > \stopbodymatter > This leads to my first question: I generally try to keep all formatting > definitions in env.tex. However, it seems to me that since I want to have > different settings in the frontmatter compared to the mainmatter, I need to > put > the \setuppagenumbering and \setupheadertexts in book.tex, which slightly > bothers me. The way I intuitively feel it should work is that I would define > various headertexts and pagenumberings under some label in env.tex, and then > activate the different configurations in book.tex via that label. Is there > anything in ConTeXt that I may have overlooked that makes something like that > (centrally defining several alternative header/footer/pagenumber > configurations) possible? > > Next, the problem of having a different header/footer/pagenumber on pages > where > a new chapter starts. In env.tex, I have > > \setuphead[chapter][ > page=mychapterpagebreak, > number=no, > alternative=c, > align={center, nothyphenated, verytolerant}, > style={\switchtobodyfont[16pt]}, > header=high, > footer=none, > ] > > This causes the chapter pages to have no header/footer/pagenumber at all, > which > is halfway what I want. But actually, I don't really understands why that > works > either. My understanding is that "header=high" means there should be no header > on the first page and the normal header on all subsequent pages. The way I've > set it up though, the page number is not really part of the header (it's > separately set up through \setuppagenumbering). So why does the page number > disappear as well? And, of course, the main question: How do I get the page > number centered in the bottom of that page? Again, I feel if there was some > way > to define different configurations for the header/footer/pagenumbers under > different labels, e.g. a label 'chapterfooter', it would then make sense to do > something like 'footer=chapterfooter', instead of 'footer=none'. But I guess > that's not the way it works -- so how *does* it work? Digging deeper in the reference manual, it seems that \definetext[chapter][footer][pagenumber] together with \setuphead[chapter][ page=mychapterpagebreak, number=no, alternative=c, align={center, nothyphenated, verytolerant}, style={\switchtobodyfont[16pt]}, header=high, footer=chapter, ] is the answer. Do I understand it correctly that \definetext[chapter][footer]... is exactly the same as \setupfootertext... but with the extra label "chapter"? So that would be exactly what my intuition said should exist. Can I only use the "chapter" label inside of \setuphead, like in the above example, or could I also somehow use \definetext to setup different headers/footers for the frontmatter/mainmatter, for example? Thanks, Michael ___ 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] varying headers, footers, page numbers
Hi, I'm trying to create a book where the front matter has no headers/footers, except roman numeral page numbers at the top outside of the page. The main matter should have Arabic numeral page numbers (restarting with '1') at the top outside of each page, plus the name of the book in the header of each even page and the name of the chapter in the header of each odd page, with no footer. However, on the pages where a new chapter starts (which is set to always be an odd page), there should be no header, and the page number should appear centered at the bottom of the page. I'm quite confused about how to achieve this in ConTeXt. An excerpt from the project structure is ./env.tex ./project.tex ./book/book.tex ./book/chapters/chapter1.tex The following is a shortened excerpt from book.tex: \startfrontmatter \setuppagenumbering[state=stop] % nothing for now, should be roman page % numbers later \component book/frontmatter % ToC ... \stopfrontmatter \startbodymatter \setuppagenumber[number=1] \setupheadertexts [{Name of Chapter}] [{}] [{}] [{Name of Book}] \setuppagenumbering[ alternative=doublesided, % mirrored even/odd pages location={header,margin}, style=small] \component vol04_1/articles/azimov \stopbodymatter This leads to my first question: I generally try to keep all formatting definitions in env.tex. However, it seems to me that since I want to have different settings in the frontmatter compared to the mainmatter, I need to put the \setuppagenumbering and \setupheadertexts in book.tex, which slightly bothers me. The way I intuitively feel it should work is that I would define various headertexts and pagenumberings under some label in env.tex, and then activate the different configurations in book.tex via that label. Is there anything in ConTeXt that I may have overlooked that makes something like that (centrally defining several alternative header/footer/pagenumber configurations) possible? Next, the problem of having a different header/footer/pagenumber on pages where a new chapter starts. In env.tex, I have \setuphead[chapter][ page=mychapterpagebreak, number=no, alternative=c, align={center, nothyphenated, verytolerant}, style={\switchtobodyfont[16pt]}, header=high, footer=none, ] This causes the chapter pages to have no header/footer/pagenumber at all, which is halfway what I want. But actually, I don't really understands why that works either. My understanding is that "header=high" means there should be no header on the first page and the normal header on all subsequent pages. The way I've set it up though, the page number is not really part of the header (it's separately set up through \setuppagenumbering). So why does the page number disappear as well? And, of course, the main question: How do I get the page number centered in the bottom of that page? Again, I feel if there was some way to define different configurations for the header/footer/pagenumbers under different labels, e.g. a label 'chapterfooter', it would then make sense to do something like 'footer=chapterfooter', instead of 'footer=none'. But I guess that's not the way it works -- so how *does* it work? Thanks, Michael ___ 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] Footnote numbers not following \setupinteraction color
On 13-8-2010 7:54, John Haltiwanger wrote: I seem to be full of problems today: --- \setupcolors[state=start] \setupinteraction[state=start, color=black] \setupcolor[hex] \definecolor[titleRed][h=910A00] \starttext This \footnote{should not have a red color, correct?} \stoptext --- The footnote number in the page footer inherits color titleRed, though the footnote "notice" in the text is properly black. color=,contrastcolor= red means: link on same page (contrastcolor is used then) - 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] Footnote numbers not following \setupinteraction color
On 2010-08-13 <17:54:02>, John Haltiwanger wrote: > I seem to be full of problems today: > > --- > \setupcolors[state=start] > \setupinteraction[state=start, color=black] Hi John, it's a link to the same page: \setupinteraction[state=start, color=black, contrastcolor=black] should fix it. Philipp > > \setupcolor[hex] > \definecolor[titleRed][h=910A00] > > \starttext > > This \footnote{should not have a red color, correct?} > > \stoptext > --- > > The footnote number in the page footer inherits color titleRed, though > the footnote "notice" in the text is properly black. > > Also, this doesn't seem to affect links in my ToC (they aren't titleRed). > ___ > 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 pgpxClyMZh7dy.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] Footnote numbers not following \setupinteraction color
I seem to be full of problems today: --- \setupcolors[state=start] \setupinteraction[state=start, color=black] \setupcolor[hex] \definecolor[titleRed][h=910A00] \starttext This \footnote{should not have a red color, correct?} \stoptext --- The footnote number in the page footer inherits color titleRed, though the footnote "notice" in the text is properly black. Also, this doesn't seem to affect links in my ToC (they aren't titleRed). ___ 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] Roman page numbers
于 2010年08月13日 00:21, Wolfgang Schuster 写道: Should be \setupuserpagenumber. Thanks, this works. ___ 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] Roman page numbers
Am 12.08.10 05:35, schrieb Hongwen Qiu: 于 2010年08月12日 11:08, Wolfgang Schuster 写道: Am 12.08.10 03:52, schrieb Hongwen Qiu: Hi, The following minimal example has no effect on page numbering(MkIV): \setuppagenumbering[conversion=romannumerals] % \setuppagenumbering[numberconversion=romannumerals] has no effect too. \setupuserpagenumbering[numberconversion=romannumerals] Thanks for the reply, but I get the following error: ! Undefined control sequence. l.10 \setupuserpagenumbering [numberconversion=romannumerals] Should be \setupuserpagenumber. 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] Roman page numbers
于 2010年08月12日 11:08, Wolfgang Schuster 写道: Am 12.08.10 03:52, schrieb Hongwen Qiu: Hi, The following minimal example has no effect on page numbering(MkIV): \setuppagenumbering[conversion=romannumerals] % \setuppagenumbering[numberconversion=romannumerals] has no effect too. \setupuserpagenumbering[numberconversion=romannumerals] Thanks for the reply, but I get the following error: ! Undefined control sequence. l.10 \setupuserpagenumbering [numberconversion=romannumerals] ? ___ 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] Roman page numbers
Am 12.08.10 03:52, schrieb Hongwen Qiu: Hi, The following minimal example has no effect on page numbering(MkIV): \setuppagenumbering[conversion=romannumerals] % \setuppagenumbering[numberconversion=romannumerals] has no effect too. \setupuserpagenumbering[numberconversion=romannumerals] 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] Roman page numbers
Hi, The following minimal example has no effect on page numbering(MkIV): \setuppagenumbering[conversion=romannumerals] % \setuppagenumbering[numberconversion=romannumerals] has no effect too. \starttext \chapter{Alpha} \input tufte \stoptext $ context --version MTXrun | current version: 2010.08.10 17:14 $ luatex --version This is LuaTeX, Version beta-0.61.0-2010072816 ___ 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] an issue with line numbers in the verbatim text
2010/8/11 Hongwen Qiu : > On 08/11/2010 08:23 PM, Li Yanrui (李延瑞) wrote: >> >> Hi all, >> >> this is an example. >> >> \setuptyping[numbering=line] >> \setuplinenumbering[location=intext] >> \showframe >> \starttext >> \starttyping >> This is the first line. >> Last line after an empty line. >> \stoptyping >> \stoptext >> >> the linenumbering setup of "location=intext" can not work. the line >> numbers still be inmargin. > > Not "location=intext", but "location=text" will do. I see, tks! -- Best regards, Li Yanrui (李延瑞) ___ 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] an issue with line numbers in the verbatim text
On 08/11/2010 08:23 PM, Li Yanrui (李延瑞) wrote: Hi all, this is an example. \setuptyping[numbering=line] \setuplinenumbering[location=intext] \showframe \starttext \starttyping This is the first line. Last line after an empty line. \stoptyping \stoptext the linenumbering setup of "location=intext" can not work. the line numbers still be inmargin. Not "location=intext", but "location=text" will do. ___ 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] an issue with line numbers in the verbatim text
Hi all, this is an example. \setuptyping[numbering=line] \setuplinenumbering[location=intext] \showframe \starttext \starttyping This is the first line. Last line after an empty line. \stoptyping \stoptext the linenumbering setup of "location=intext" can not work. the line numbers still be inmargin. -- Best regards, Li Yanrui ___ 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] Frontmatter page numbers and using ifodd / pageno
With the page layout setups I'm using, the first table of contents entry on each page (except for the first page) is formatted as if it were on the preceding page. I assume that the page number is not advancing until some number of objects are placed on the page. When I compiled the example included below, it was the first three entries on each page (after the first page) that were formatted as if they were on the previous page. Related to this, I need "invisible" page numbers on the table of contents pages to enable different formatting by odd/even page number (which I accomplish now by using \phantom as a style command for page numbering), but I'd like for the page numbering of the body matter to start at 1. Also, how can I number the front matter backward? Like: xi, x, ix, viii, vii, vi, v, iv, iii, ii, i. \def\SectionListEntry#1#2#3% { \noindent \noexpand{\ifodd\pageno \simplealignedbox{left}{.63667\textwidth}{#2} \simplealignedbox{middle}{.06\textwidth}{·} \simplealignedbox{right}{.30333\textwidth}{#3} \else \simplealignedbox{left}{.30333\textwidth}{#3} \simplealignedbox{middle}{.06\textwidth}{·} \simplealignedbox{right}{.63667\textwidth}{#2} \fi} \par\blank } \setuplist[section] [alternative=command, command=\SectionListEntry] \def\TableOfContents% { \page[empty] \page[odd] \setuppagenumbering[style=command, command=\phantom] \setuppagenumber[state=start] \placelist[section] \setuppagenumber[state=stop] \page[empty] \page[odd] } \startfrontmatter \TableOfContents \stopfrontmatter \startbodymatter \setuppagenumber[state=start] \dorecurse{45}{\section{Section title}\input tufte} \stopbodymatter Thanks, Scott - This is a work of fiction. Names, characters, places, and incidents either are the product of the writer's imagination or are used fictitiously, and any resemblance to actual persons, living or dead, businesses, companies, events, or locales is entirely coïncidental. ___ 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] feauture request - no numbers on blank pages at chapter's end
That's very close indeed. Thanks for putting me on the right track! What I wanted is rather: \setuphead [chapter] [page={yes,footer,right}, footer=nomarking] Best Piotr 2010/5/21 Wolfgang Schuster : > Am 20.05.10 13:21, schrieb Piotr Kopszak: >> >> Many thanks for your help! >> >> First the file according to the wiki example. Works if location=footer >> in \setuppagenumbering but not when >> >> \definepagebreak >> [mychapterpagebreak] >> [yes,header,right] >> >> \setuphead >> [chapter] >> [page=mychapterpagebreak,footer=empty] >> \setuppagenumbering[alternative=doublesided,location=margin] >> >> \starttext >> \chapter{testA} \dorecurse{10}{\input tufte } >> \chapter{testB} \dorecurse{10}{\input tufte } >> \chapter{testC} \dorecurse{10}{\input tufte } >> \stoptext >> >> >> Changing \setuphead to >> >> \setuphead[chapter][page={blank,right}] >> >> gets rid of the number on the chapter's title page (which I don't >> want) and still leaves it on the left empty page facing the title >> page. Not to mention the fact that pagenumbers appear only from page 10. > > This works for your minimal example: > > \setuphead > [chapter] > [page={yes,footer,right}, > footer=empty] > > 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 > ___ > -- http://okle.pl ___ 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] feauture request - no numbers on blank pages at chapter's end
Am 20.05.10 13:21, schrieb Piotr Kopszak: Many thanks for your help! First the file according to the wiki example. Works if location=footer in \setuppagenumbering but not when \definepagebreak [mychapterpagebreak] [yes,header,right] \setuphead [chapter] [page=mychapterpagebreak,footer=empty] \setuppagenumbering[alternative=doublesided,location=margin] \starttext \chapter{testA} \dorecurse{10}{\input tufte } \chapter{testB} \dorecurse{10}{\input tufte } \chapter{testC} \dorecurse{10}{\input tufte } \stoptext Changing \setuphead to \setuphead[chapter][page={blank,right}] gets rid of the number on the chapter's title page (which I don't want) and still leaves it on the left empty page facing the title page. Not to mention the fact that pagenumbers appear only from page 10. This works for your minimal example: \setuphead [chapter] [page={yes,footer,right}, footer=empty] 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] feauture request - no numbers on blank pages at chapter's end
Many thanks for your help! First the file according to the wiki example. Works if location=footer in \setuppagenumbering but not when \definepagebreak [mychapterpagebreak] [yes,header,right] \setuphead [chapter] [page=mychapterpagebreak,footer=empty] \setuppagenumbering[alternative=doublesided,location=margin] \starttext \chapter{testA} \dorecurse{10}{\input tufte } \chapter{testB} \dorecurse{10}{\input tufte } \chapter{testC} \dorecurse{10}{\input tufte } \stoptext Changing \setuphead to \setuphead[chapter][page={blank,right}] gets rid of the number on the chapter's title page (which I don't want) and still leaves it on the left empty page facing the title page. Not to mention the fact that pagenumbers appear only from page 10. Piotr 2010/5/20 Wolfgang Schuster : > Am 20.05.10 12:53, schrieb Piotr Kopszak: >> >> It would be handy to avoid inserting \page in this case, I think. >> > > \setuphead[chapter][page={blank,right}] > > 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 > ___ > -- http://okle.pl ___ 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] feauture request - no numbers on blank pages at chapter's end
Am 20.05.10 12:53, schrieb Piotr Kopszak: It would be handy to avoid inserting \page in this case, I think. \setuphead[chapter][page={blank,right}] 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] feauture request - no numbers on blank pages at chapter's end
Am 20.05.10 12:58, schrieb Piotr Kopszak: Yes, I know but even if it was working in all cases (and it is not, for instace I need pagenumbers in the margin and it didn't work in this case) it looks really, really ugly. Why not wrap something like this in a definition and give users an option? Make a example and i can try to provide a solution. 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] feauture request - no numbers on blank pages at chapter's end
Yes, I know but even if it was working in all cases (and it is not, for instace I need pagenumbers in the margin and it didn't work in this case) it looks really, really ugly. Why not wrap something like this in a definition and give users an option? 2010/5/20 Wolfgang Schuster : > Am 20.05.10 11:07, schrieb Piotr Kopszak: >> >> Hello list, >> >> I don't know if it is only an idiosyncrasy of Polish typography but if >> a chapter ends with a blank page it should not display its number. It >> would be very useful if this could be an option (if not a default >> behaviour) of \setuppagenumbering . It's not a huge problem and I >> think I will not wait for a solution before sending my next book for >> printing, but it would be nice if it appeared in the future. >> > > This is mentioned here: > http://wiki.contextgarden.net/Titles#Truly_empty_pagebreak_before_chapters > > You don't \definepagebreak as mentioned in the wiki because > > \setuphead[chapter][page={header,footer,right}] > > is also valid. > > 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 > ___ > -- http://okle.pl ___ 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] feauture request - no numbers on blank pages at chapter's end
It would be handy to avoid inserting \page in this case, I think. 2010/5/20 Taco Hoekwater : > Piotr Kopszak wrote: >> >> Hello list, >> >> I don't know if it is only an idiosyncrasy of Polish typography but if >> a chapter ends with a blank page it should not display its number. It >> would be very useful if this could be an option (if not a default >> behaviour) of \setuppagenumbering . It's not a huge problem and I >> think I will not wait for a solution before sending my next book for >> printing, but it would be nice if it appeared in the future. > > Isn't this what \page[blank,right] is supposed to do? > > Best wishes, > Taco > ___ > 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 > ___ > -- http://okle.pl ___ 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] feauture request - no numbers on blank pages at chapter's end
Am 20.05.10 11:07, schrieb Piotr Kopszak: Hello list, I don't know if it is only an idiosyncrasy of Polish typography but if a chapter ends with a blank page it should not display its number. It would be very useful if this could be an option (if not a default behaviour) of \setuppagenumbering . It's not a huge problem and I think I will not wait for a solution before sending my next book for printing, but it would be nice if it appeared in the future. This is mentioned here: http://wiki.contextgarden.net/Titles#Truly_empty_pagebreak_before_chapters You don't \definepagebreak as mentioned in the wiki because \setuphead[chapter][page={header,footer,right}] is also valid. 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] feauture request - no numbers on blank pages at chapter's end
Piotr Kopszak wrote: Hello list, I don't know if it is only an idiosyncrasy of Polish typography but if a chapter ends with a blank page it should not display its number. It would be very useful if this could be an option (if not a default behaviour) of \setuppagenumbering . It's not a huge problem and I think I will not wait for a solution before sending my next book for printing, but it would be nice if it appeared in the future. Isn't this what \page[blank,right] is supposed to do? Best wishes, Taco ___ 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] feauture request - no numbers on blank pages at chapter's end
Hello list, I don't know if it is only an idiosyncrasy of Polish typography but if a chapter ends with a blank page it should not display its number. It would be very useful if this could be an option (if not a default behaviour) of \setuppagenumbering . It's not a huge problem and I think I will not wait for a solution before sending my next book for printing, but it would be nice if it appeared in the future. Best Piotr -- http://okle.pl ___ 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] Numbers in \definesynonyms
On 13-5-2010 10:42, Otared Kavian wrote: Dear all, When defining abbreviations through \definesynonyms, if the abbreviation contains a digit then it seems that the built-in macro is not recognized: in the example below the command \EEG is recognized, whereas \M2 or \Y2K are not. Is there a way around this difficulty? Or should one use a definition like \definesynonyms[abbreviation][abbreviations][\inshort][\infull] and then use everywhere \inshort{Y2K}? Many thanks in advance, with my best regards: OK begin example-abbr.tex \definesynonyms[abbreviation][abbreviations][\infull] \starttext \abbreviation{EEG} {Electroencephalogram} \abbreviation{ERP} {Event-Related Potentials} \abbreviation{M2}{Master 2nd year} \abbreviation{Y2K}{Year 2000} \abbreviation[MTWO][M2]{Master 2nd year} \MTWO Test inshort working: \EEG, \ERP, Test not working \M2, \Y2K Test infull: \infull{EEG}, \infull{ERP}, \infull{M2} \completelistofabbreviations \stoptext end example-abbr.tex ___ 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 ___ -- - 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] Numbers in \definesynonyms
Dear all, When defining abbreviations through \definesynonyms, if the abbreviation contains a digit then it seems that the built-in macro is not recognized: in the example below the command \EEG is recognized, whereas \M2 or \Y2K are not. Is there a way around this difficulty? Or should one use a definition like \definesynonyms[abbreviation][abbreviations][\inshort][\infull] and then use everywhere \inshort{Y2K}? Many thanks in advance, with my best regards: OK begin example-abbr.tex \definesynonyms[abbreviation][abbreviations][\infull] \starttext \abbreviation{EEG} {Electroencephalogram} \abbreviation{ERP} {Event-Related Potentials} \abbreviation{M2}{Master 2nd year} \abbreviation{Y2K}{Year 2000} Test inshort working: \EEG, \ERP, Test not working \M2, \Y2K Test infull: \infull{EEG}, \infull{ERP}, \infull{M2} \completelistofabbreviations \stoptext end example-abbr.tex ___ 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 compute the sum of numbers
Jan Pohanka wrote: Thank you, I have an additional question. Is it possible to have the sum available before the \question commands? This is what I would do (but I suspect Wolfgang can come up with something cleaner): \def\startquestions {\newcount\totalpoints} \def\stopquestions {\expanded{\reference[totalpoints]{\the\totalpoints}}} \def\question#1#2{\global\advance\totalpoints #1\relax #2\par} \starttext Total points: \in[totalpoints] \startquestions \question{5}{text text} \question{3}{text text} \question{1}{text text} \stopquestions \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] how to compute the sum of numbers
Thank you, I have an additional question. Is it possible to have the sum available before the \question commands? I mean Total points: \the\totalpoints % or something like that \question{5}{text text} \question{3}{text text} \question{1}{text text} greetings, Jan Dne Tue, 11 May 2010 11:23:30 +0200 Taco Hoekwater napsal(a): Jan Pohanka wrote: Hello, I'm preparing a simple template for exam tests. I have following commad. \question{3}{text text text} \newcount\totalpoints \def\question#1#2{\global\advance\totalpoints #1\relax ... #2 ...} where firtst parametr stands for points. I'd like to compute the sum of points to be used as "Total points: xx" Total points: \the\totalpoints Best wishes, Taco ___ 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 ___ -- Tato zpráva byla vytvořena převratným poštovním klientem Opery: http://www.opera.com/mail/ ___ 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 compute the sum of numbers
Jan Pohanka wrote: Hello, I'm preparing a simple template for exam tests. I have following commad. \question{3}{text text text} \newcount\totalpoints \def\question#1#2{\global\advance\totalpoints #1\relax ... #2 ...} where firtst parametr stands for points. I'd like to compute the sum of points to be used as "Total points: xx" Total points: \the\totalpoints Best wishes, Taco ___ 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] how to compute the sum of numbers
Hello, I'm preparing a simple template for exam tests. I have following commad. \question{3}{text text text} where firtst parametr stands for points. I'd like to compute the sum of points to be used as "Total points: xx" What is the correct approach to do that if I'm using MKII? greetings Jan -- Tato zpráva byla vytvořena převratným poštovním klientem Opery: http://www.opera.com/mail/ ___ 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] Footnote numbers and leftmargin setup [mkIV]
On 3 May 2010, at 15:23, Thomas Floeren wrote: > Wolfgang Schuster <mailto:schuster.wolfg...@googlemail.com> wrote on Monday, > May 03, 2010 2:20 PM: > >> Am 03.05.10 14:11, schrieb Thomas Floeren: >>> >>> Hello, >>> >>> in mkII I use to set my left margins to 0pt. When I do this now in >>> mkIV, I get misplaced footnote numbers (at the bottom). >>> >>> Example: >>> >>> \setuplayout >>> [leftmargin=\zeropoint] >>> >>> \starttext >>> just text\footnote{foot text} >>> \stoptext >>> >>> >>> To get correctly placed numbers I have to either set the leftmargin >>> to>= 5pt, or leave out the leftmargin key in setuplayout. >>> >>> Is this a bug or just the mkIV way? >>> >> The code for footnotes in MkII and MkIV is different, while MkII use >> it's own >> code MkIV use enumerations for the notes (that's why you can use >> nearly all >> options from enumerations) and the number is placed by default in the >> left margin >> but why do you set leftmargin to 0pt? >> > > > If I don’t set the leftmargin, everything is messed up. > > Try this with and without leftmargin setup key: > > %-- > \setuplayout > [backspace=25mm, > cutspace=15mm, > topspace=10mm, > header=\zeropoint, > headerdistance=\zeropoint, > bottomspace=10mm, > footer=5mm, > footerdistance=8mm, > % leftmargin=\zeropoint, > rightmargin=\zeropoint, > height=fit, > width=fit, > location=middle] > > > \setupfooter [state=start,before=\hrule] > \setupfootertexts > [nice text here][and here] > > \starttext > \dorecurse{20}{just text }\footnote{foot text} > \page\null > \stoptext > %--- > > Without the leftmargin key, text and footer leave the page borders. > > Guess I have to to change my way to setup the layout in mkIV(?) > Not really, the problem is, that you use conflicting keys. If you set the topspace, header, headerdistance, footer, footerdistance and the bottomspace then the height is already fixed. The same is applicable for the horizontal measures. I suggest to use the backspace to determine the left rim of the textarea, set the the width to an appropriate value if the left and right margin should be different in size, otherwise use width=middle which makes right and left margin identical i.e. as large as the backspace. The margins and margindistances which are setup in the setuplayout are sort of virtual and they are placed over the area defined by backspace and the rest of the paper right from the right rim of the textarea. This is the reason why marginareas can stick outside the paper. Willi > > Thomas > > ___ > 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] Footnote numbers and leftmargin setup [mkIV]
Am 03.05.10 15:23, schrieb Thomas Floeren: Without the leftmargin key, text and footer leave the page borders. Guess I have to to change my way to setup the layout in mkIV(?) There are a few things you should change: 1. Use 'middle' for the width and height keys in \setuplayout, 2. Place the rule above the footer in the text area, 3. Don't set the left and right margins to 0pt, 4. Instead of a rule before the footer you can use the background mechanism to draw the borders of the footer. \setuplayout [backspace=25mm, cutspace=15mm, topspace=10mm, header=0pt, headerdistance=0pt, bottomspace=10mm, footer=5mm, footerdistance=8mm, height=middle, width=middle, location=middle] \setupfooter[text][before=\hairline] %\setupbackgrounds[footer][text][topframe=on] \setupfootertexts[nice text here][and here] \starttext \dorecurse{20}{just text }\footnote{foot text}\page[dummy] \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] Footnote numbers and leftmargin setup [mkIV]
Wolfgang Schuster <mailto:schuster.wolfg...@googlemail.com> wrote on Monday, May 03, 2010 2:20 PM: > Am 03.05.10 14:11, schrieb Thomas Floeren: >> >> Hello, >> >> in mkII I use to set my left margins to 0pt. When I do this now in >> mkIV, I get misplaced footnote numbers (at the bottom). >> >> Example: >> >> \setuplayout >> [leftmargin=\zeropoint] >> >> \starttext >> just text\footnote{foot text} >> \stoptext >> >> >> To get correctly placed numbers I have to either set the leftmargin >> to>= 5pt, or leave out the leftmargin key in setuplayout. >> >> Is this a bug or just the mkIV way? >> > The code for footnotes in MkII and MkIV is different, while MkII use > it's own > code MkIV use enumerations for the notes (that's why you can use > nearly all > options from enumerations) and the number is placed by default in the > left margin > but why do you set leftmargin to 0pt? > If I dont set the leftmargin, everything is messed up. Try this with and without leftmargin setup key: %-- \setuplayout [backspace=25mm, cutspace=15mm, topspace=10mm, header=\zeropoint, headerdistance=\zeropoint, bottomspace=10mm, footer=5mm, footerdistance=8mm, % leftmargin=\zeropoint, rightmargin=\zeropoint, height=fit, width=fit, location=middle] \setupfooter [state=start,before=\hrule] \setupfootertexts [nice text here][and here] \starttext \dorecurse{20}{just text }\footnote{foot text} \page\null \stoptext %--- Without the leftmargin key, text and footer leave the page borders. Guess I have to to change my way to setup the layout in mkIV(?) Thomas ___ 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] Footnote numbers and leftmargin setup [mkIV]
Am 03.05.10 14:11, schrieb Thomas Floeren: Hello, in mkII I use to set my left margins to 0pt. When I do this now in mkIV, I get misplaced footnote numbers (at the bottom). Example: \setuplayout [leftmargin=\zeropoint] \starttext just text\footnote{foot text} \stoptext To get correctly placed numbers I have to either set the leftmargin to>= 5pt, or leave out the leftmargin key in setuplayout. Is this a bug or just the mkIV way? The code for footnotes in MkII and MkIV is different, while MkII use it's own code MkIV use enumerations for the notes (that's why you can use nearly all options from enumerations) and the number is placed by default in the left margin but why do you set leftmargin to 0pt? 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] Footnote numbers and leftmargin setup [mkIV]
Hello, in mkII I use to set my left margins to 0pt. When I do this now in mkIV, I get misplaced footnote numbers (at the bottom). Example: \setuplayout [leftmargin=\zeropoint] \starttext just text\footnote{foot text} \stoptext To get correctly placed numbers I have to either set the leftmargin to >= 5pt, or leave out the leftmargin key in setuplayout. Is this a bug or just the mkIV way? Thomas ConTeXt ver: 2010.04.29 22:30 MKIV fmt: 2010.4.30 int: english/english ___ 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] \setuptyping[numbering=line] don't emit line numbers
$ context --version MTXrun | current version: 2010.04.16 21:08 $ luatex --version This is LuaTeX, Version beta-0.60.0-2010040422 I found that \setuptyping[numbering=line] no longer produces line numbers any more. So are there something changed, or just it's ought to be ok? ___ 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] Selectively dropping page numbers
Am 24.03.10 13:37, schrieb Tom: The Chicago Manual of Style, 14th edition, states that page numbers are normally omitted on pages containing only illustrations or tables, except in long sequences of figures or tables. Is it practical within ConTeXt to omit page numbers from a single page within a chapter? Can you add a entry to the bug/feature tracker (http://tracker.luatex.org/). I agree to have a option to disable headers/footers on float pages. \starttext \dorecurse{10}{\input knuth\par} \placefigure[page,none]{}{\externalfigure[dummy][factor=max]} \dorecurse{10}{\input knuth\par} \placefigure[page,none,header]{}{\externalfigure[dummy][factor=max]} % no header on float page \dorecurse{10}{\input knuth\par} \placefigure[page,none,footer]{}{\externalfigure[dummy][factor=max]} % no footer on float page \dorecurse{10}{\input knuth\par} \placefigure[page,none,empty]{}{\externalfigure[dummy][factor=max]} % no header and footer on float page \dorecurse{10}{\input knuth\par} \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] Selectively dropping page numbers
The Chicago Manual of Style, 14th edition, states that page numbers are normally omitted on pages containing only illustrations or tables, except in long sequences of figures or tables. Is it practical within ConTeXt to omit page numbers from a single page within a chapter? Tom Benjey 717-258-9733 voice 717-243-0074 fax Twitter: @TomBenjey ___ 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] oldstyle numbers in TeXGyre fonts
On 15-3-2010 14:46, Thomas A. Schmitz wrote: Hi all, Hans, is there or can we have an easy, fast way of setting up the TeXGyre fonts so that they use oldstyle numbers by default? I think this would be attractive at least for the serif fonts termes, pagella, schola, which all have this feature. \definefontfeature[default][default][onum=yes] - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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] oldstyle numbers in TeXGyre fonts
Hi all, Hans, is there or can we have an easy, fast way of setting up the TeXGyre fonts so that they use oldstyle numbers by default? I think this would be attractive at least for the serif fonts termes, pagella, schola, which all have this feature. All best Thomas ___ 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] Formatting numbers in LuaTeX
On Mon, Feb 15 2010, Andreas Harder wrote: > > But the "$·$"-construct is problematic. It do not work in display style > (\let\calcmath\displaycalcmath) and without the dollar-signs the placement > and the spacing are wrong. I don't know, why "·" doesn't work, but you can try this: local exp_replacements = {["*"] = "cdot"} Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/ ___ 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] Formatting numbers in LuaTeX
Am 15.02.2010 um 20:35 schrieb Peter Münster: > On Sun, Feb 14 2010, Hans Hagen wrote: > >>> sqrt = math.sqrt >>> pi = math.pi >>> function my_equation(s, r) >> >> beware, this creates (and possibly overloads) sqrt, pi and my_equation as >> gobals > > Indeed... > > The following hack was *not* so quick, but there is a bug somewhere > (a digit is added at the end): > > \usemodule[calcmath] > \startluacode > local exp_replacements = {["*"] = "$·$"} > local res_replacements = {["sqrt"] = "math.sqrt", ["π"] = "math.pi"} > userdata = userdata or {} > function userdata.result_as_string(r) > r = math.floor(1000 * r + 0.5) / 1000 > r = tostring(r) > tex.write(r:gsub("%.", ",")) > end > function userdata.filter_expression(s) > for k, v in pairs(exp_replacements) do > s = s:gsub(k, v) > end > tex.write(s) > end > function userdata.filter_result(s) > for k, v in pairs(res_replacements) do > s = s:gsub(k, v) > end > tex.write(s) > end > \stopluacode > \def\calculate#1{% > \start >\def\Expression{\ctxlua{userdata.filter_expression("#1")}} >\def\Result{\ctxlua{userdata.filter_result("#1")}} >\calcmath{\Expression=\ctxlua{userdata.result_as_string(\Result)}} > \stop > } > \starttext > \startlines > \calculate{1+2} > \calculate{3/2-1} > \calculate{3*2} > \calculate{sqrt(2)} > \calculate{2*π} > \stoplines > \stoptext I've noticed that one can even use such things as \calculate{3^2}, \calculate{2^3} out of the box and it's easy to add ["e"] = "math.exp(1)", ["sin"] = "math.sin", … But the "$·$"-construct is problematic. It do not work in display style (\let\calcmath\displaycalcmath) and without the dollar-signs the placement and the spacing are wrong. Thank you for your elaboration. Greetings Andreas ___ 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] Formatting numbers in LuaTeX
On 15-2-2010 20:35, Peter Münster wrote: tex.write(r:gsub("%.", ",")) tex.write((r:gsub("%.", ","))) gsub returns two values - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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] Formatting numbers in LuaTeX
On Sun, Feb 14 2010, Hans Hagen wrote: >>sqrt = math.sqrt >>pi = math.pi >>function my_equation(s, r) > > beware, this creates (and possibly overloads) sqrt, pi and my_equation as > gobals Indeed... The following hack was *not* so quick, but there is a bug somewhere (a digit is added at the end): \usemodule[calcmath] \startluacode local exp_replacements = {["*"] = "$·$"} local res_replacements = {["sqrt"] = "math.sqrt", ["π"] = "math.pi"} userdata = userdata or {} function userdata.result_as_string(r) r = math.floor(1000 * r + 0.5) / 1000 r = tostring(r) tex.write(r:gsub("%.", ",")) end function userdata.filter_expression(s) for k, v in pairs(exp_replacements) do s = s:gsub(k, v) end tex.write(s) end function userdata.filter_result(s) for k, v in pairs(res_replacements) do s = s:gsub(k, v) end tex.write(s) end \stopluacode \def\calculate#1{% \start \def\Expression{\ctxlua{userdata.filter_expression("#1")}} \def\Result{\ctxlua{userdata.filter_result("#1")}} \calcmath{\Expression=\ctxlua{userdata.result_as_string(\Result)}} \stop } \starttext \startlines \calculate{1+2} \calculate{3/2-1} \calculate{3*2} \calculate{sqrt(2)} \calculate{2*π} \stoplines \stoptext Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/ ___ 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] Formatting numbers in LuaTeX
On 14-2-2010 14:10, Andreas Harder wrote: \startluacode local floor = math.floor local round = function(n) return floor(1000*n+0.5)/1000 end sqrt = math.sqrt pi = math.pi function my_equation(s, r) r = round(r) r = tostring(r) tex.print(s:gsub("*", "$·$") .. "=" .. r:gsub("%.", ",")) end \stopluacode beware, this creates (and possibly overloads) sqrt, pi and my_equation as gobals Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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] Formatting numbers in LuaTeX
Am 14.02.2010 um 13:11 schrieb Peter Münster: > On Sun, Feb 14 2010, Andreas Harder wrote: > >> 1) Is it possible to have a comma as decimal separator? >> >> 2) If you look at the above definition, it works fine with +, –, /, but >> not with *. Is it possible to expand my macro that it will also work with >> a multiplication or even with the last two examples? > > Hello Andreas, > > Just a quick hack: > > \usemodule[calcmath] > \startluacode > sqrt = math.sqrt > pi = math.pi > function my_equation(s, r) > r = tostring(r) > tex.print(s:gsub("*", "×") .. "=" .. r:gsub("%.", ",")) > end > \stopluacode > \def\calculate#1{\calcmath{\ctxlua{my_equation("#1", #1)}}} > \starttext > \startlines > \calculate{1+2} > \calculate{3/2-1} > \calculate{3*2} > \calculate{sqrt(2)} > \calculate{2*pi} > \stoplines > \stoptext That’s nice! Thank you very much! I've found an posting on the LuaTeX-mailing-list and incorporated it, so one have rounded results (I didn't find a way to use "\%.2f"). So, if someone is interested: \usemodule[calcmath] \startluacode local floor = math.floor local round = function(n) return floor(1000*n+0.5)/1000 end sqrt = math.sqrt pi = math.pi function my_equation(s, r) r = round(r) r = tostring(r) tex.print(s:gsub("*", "$·$") .. "=" .. r:gsub("%.", ",")) end \stopluacode \def\calculate#1{\calcmath{\ctxlua{my_equation("#1", #1)}}} \starttext \startlines \calculate{1+2} \calculate{3/2-1} \calculate{3*2} \calculate{sqrt(2)} \calculate{2*pi} \stoplines \stoptext Greetings Andreas ___ 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] Formatting numbers in LuaTeX
On Sun, Feb 14 2010, Andreas Harder wrote: > 1) Is it possible to have a comma as decimal separator? > > 2) If you look at the above definition, it works fine with +, –, /, but > not with *. Is it possible to expand my macro that it will also work with > a multiplication or even with the last two examples? Hello Andreas, Just a quick hack: \usemodule[calcmath] \startluacode sqrt = math.sqrt pi = math.pi function my_equation(s, r) r = tostring(r) tex.print(s:gsub("*", "×") .. "=" .. r:gsub("%.", ",")) end \stopluacode \def\calculate#1{\calcmath{\ctxlua{my_equation("#1", #1)}}} \starttext \startlines \calculate{1+2} \calculate{3/2-1} \calculate{3*2} \calculate{sqrt(2)} \calculate{2*pi} \stoplines \stoptext Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/ ___ 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] Formatting numbers in LuaTeX
On Sun, Feb 14, 2010 at 11:42 AM, Andreas Harder wrote: > Hi all! > > I played a little bit with LuaTeX in ConTeXt and two questions have arisen. > > \usemodule[calcmath] > \starttext > \def\calculate#1{\calcmath{#1=\ctxlua{tex.print(#1)}}} > \calculate{1+2} \par > \calculate{3/2-1}\par % the output should be 0,5 > \calculate{3*2}\par > % \calculate{sqrt(2)} \calculate{2*π} % 2*\pi > \stoptext > > 1) Is it possible to have a comma as decimal separator? string.format ? -- 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 ___
[NTG-context] Formatting numbers in LuaTeX
Hi all! I played a little bit with LuaTeX in ConTeXt and two questions have arisen. \usemodule[calcmath] \starttext \def\calculate#1{\calcmath{#1=\ctxlua{tex.print(#1)}}} \calculate{1+2} \par \calculate{3/2-1}\par % the output should be 0,5 \calculate{3*2}\par % \calculate{sqrt(2)} \calculate{2*π} % 2*\pi \stoptext 1) Is it possible to have a comma as decimal separator? 2) If you look at the above definition, it works fine with +, –, /, but not with *. Is it possible to expand my macro that it will also work with a multiplication or even with the last two examples? Thank you in advance Andreas ___ 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] Where did page numbers go?
On 10-2-2010 10:26, Mojca Miklavec wrote: On Tue, Feb 9, 2010 at 20:55, Wolfgang Schuster wrote: Am 09.02.10 20:36, schrieb Mojca Miklavec: Hello Hans, \currentpage (as already reported by Peter Münster) doesn't work in MKIV (always returns 1) and \setnumber[page]{0} has zero effect (in MKII; in MKIV I cannot test it anyway). \pagenumber? MkIV has no counter 'page' but 'realpage', 'userpage' and 'subpage'. - But why should \currentpage stop working? (Is there any stong reason to break compatibility?) because it' set at the wrong place, i'll fix it and upluad a beta dedicated to you (keep in mind that \currentpage in mkii/mkiv is the page in the file, aka realpage) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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] Where did page numbers go?
On Tue, Feb 9, 2010 at 20:55, Wolfgang Schuster wrote: > Am 09.02.10 20:36, schrieb Mojca Miklavec: >> >> Hello Hans, >> >> \currentpage (as already reported by Peter Münster) doesn't work in >> MKIV (always returns 1) and \setnumber[page]{0} has zero effect (in >> MKII; in MKIV I cannot test it anyway). >> > > \pagenumber? > > MkIV has no counter 'page' but 'realpage', 'userpage' and 'subpage'. - But why should \currentpage stop working? (Is there any stong reason to break compatibility?) - I'm testing \subpage and get: 1, I, I, I, the \userpage gives me 1, II, III, IV; \currentpage gives me 1, 1, 1, 1; I'll try to post a minimal example, but I stongly suspect that something is a bit broken here. - Is there a way to say "\thisisreallythelastpage", so that \totalnumberofpages (or some other counter) doesn't count any leftovers from the end? (I'll try to play a bit more with that, so you don't need to answer me that last question, but I find the behaviour of other counters really strange.) The number 1 is on frontmatter, the uppercase roman numbers are on bodypart (without setting any conversion at all). 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 ___