[NTG-context] buffers (append)
Hello, In addition to \startbuffer \stopbuffer it would be nice to have \startappendbuffer \stopappendbuffer. I see that the lua function buffer.append() exists but I have not worked-out how to add this functionality cleanly as conTeXt macros. I imagine that this might be quite trivial for our TeX programming experts... (for once, a [useful?] suggestion that in the end will not entail many hours of work? :) 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] getnameinfo (Hans Hagen)
On Sun, Jan 13, 2013 at 6:49 PM, Hans Hagen wrote: On 1/12/2013 4:32 PM, Wolfgang Werners-Lucchini wrote: I use win2K. What I have included was the solution how to solve this incompatibility. I don't know. It's more something for Mojca's team of binary magicians. The Mojca's team of binary magicians boils down to a certain Japanese physicist when it comes down to Windows. You would have to ask him. Citing from TL documentation: As to Windows: Windows XP and later are supported. Windows 2000 will probably still mostly work. I was trying to find out which versions of Windows are supported in MikTeX because MikTeX was somehow drastic about dropping support for older windows, but I don't find that information on the new website. My personal opinion: if there is a trivial change needed that can make someone's life easier, why not. But I wouldn't bother with dirty hacks to support Windows 2000. However, it's not me that's building the binaries. 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 ___
Re: [NTG-context] buffers (append)
Am 14.01.2013 um 09:00 schrieb Alan BRASLAU alan.bras...@cea.fr: Hello, In addition to \startbuffer \stopbuffer it would be nice to have \startappendbuffer \stopappendbuffer. I see that the lua function buffer.append() exists but I have not worked-out how to add this functionality cleanly as conTeXt macros. I imagine that this might be quite trivial for our TeX programming experts... (for once, a [useful?] suggestion that in the end will not entail many hours of work? :) \startbuffer[a] Line 1 \stopbuffer \startbuffer[b] Line 2 \stopbuffer \starttext \startlines \getbuffer[a,b] \stoplines \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] buffers (append)
On Mon, 14 Jan 2013 09:34:08 +0100 Wolfgang Schuster wolfgang.schus...@gmail.com wrote: Am 14.01.2013 um 09:00 schrieb Alan BRASLAU alan.bras...@cea.fr: Hello, In addition to \startbuffer \stopbuffer it would be nice to have \startappendbuffer \stopappendbuffer. I see that the lua function buffer.append() exists but I have not worked-out how to add this functionality cleanly as conTeXt macros. I imagine that this might be quite trivial for our TeX programming experts... (for once, a [useful?] suggestion that in the end will not entail many hours of work? :) \startbuffer[a] Line 1 \stopbuffer \startbuffer[b] Line 2 \stopbuffer \starttext \startlines \getbuffer[a,b] \stoplines \stoptext Wolfgang Thank you Wolfgang, this is useful. However, it would still be helpful to be able to generically add to a buffer without having to rename a new one. Shouldn't be very difficult but I did not find that anything like this already exists. I often think this way when I teach, adding steps to an example while repeating the previous steps. \startbuffer[a] Line 1 \stopbuffer \getbuffer[a] \startaddtobuffer[a] Line 2 \stopaddtobuffer \getbuffer[a] 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] index: distinguish entries by pagestyle
Hi there, I got a question considering the registers. I'd like to distinguish between the definition of some term and its appearance/use somewhere else (boldface vs. normal font of page number for instance). The garden provides a solution, which does not seem to work for me: %%% \setupregister[index][nb][pagestyle=bold] \starttext My \index[nb::dog]{dog}dog is a cat\index{cat}. \placeindex \stoptext %%% (modified from http://wiki.contextgarden.net/Registers). What I'd like to have is, that dog appears with a bold page number and that cat doesn't. ConTeXt ver: 2013.01.10 01:04 MKIV fmt: 2013.1.11 Cheers, 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 ___
[NTG-context] Any ConTeXt-Lua changes
Hi, I wrote Lua routines a while back that parse a string representation of a weekly schedule to create a table representation of the schedule. It worked last fall. Certainly in August, 2012 and I think at least as late October. I just tried it again, but it failed; and it failed on the same file it worked on before. Before I roll up my sleeves and starting digging through the code, I was wondering if something had changed in the last two or three months that I should know about. No MWE for you, but here's the ConTeXt command that sends an ID (#1) and a parameters (#2) to Lua \def\defineschedule{\dodoubleempty\dodefineschedule} \def\dodefineschedule[#1][#2]{\ctxlua{userdata.schedule.new(#1,#2)}} Thanks for any tips, Michael This e-mail message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message (including any attachments) is strictly prohibited. If you have received this message in error, please contact the sender by reply e-mail message and destroy all copies of the original message (including attachments). ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Any ConTeXt-Lua changes
Am 14.01.2013 um 15:08 schrieb Rogers, Michael K mrog...@emory.edu: Hi, I wrote Lua routines a while back that parse a string representation of a weekly schedule to create a table representation of the schedule. It worked last fall. Certainly in August, 2012 and I think at least as late October. I just tried it again, but it failed; and it failed on the same file it worked on before. Before I roll up my sleeves and starting digging through the code, I was wondering if something had changed in the last two or three months that I should know about. No MWE for you, but here's the ConTeXt command that sends an ID (#1) and a parameters (#2) to Lua \def\defineschedule{\dodoubleempty\dodefineschedule} \def\dodefineschedule[#1][#2]{\ctxlua{userdata.schedule.new(#1,#2)}} What’s the error message, there is no way to tell what’s wrong with only these two code lines. 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] Any ConTeXt-Lua changes
The error is basically that a variable is 'nil'. I figure it's my job to track down why -- the code is long and boring and sometimes complicated. I just thought if there's been some change in how parameters are passed or strings handled. A typical use would be \defineschedule[test][sched={M--Th 8.05a--9:20,1:45--2:30}] The 'sched' is parsed to {day, interval = {start, stop}} pairs and stored in a table. It seems the interval table is nil now, but it used to work. Here's the actual error: ! LuaTeX error [string \directlua ]:529: attempt to index field '?' (a nil value) stack traceback: [string \directlua ]:529: in function 'dotablerow' [string \directlua ]:658: in function 'tablefromschedule' [string \directlua ]:1: in main chunk. system tex error on line 58 in file Syllabus112.tex: LuaTeX error … I thought something must have changed, since nothing has changed in the syllabus file or the module file, since a couple of months ago. If nothing occurs to anyone, I'll just have to trace it down. Thanks in any case, whether you can think of something or not. On Jan 14, 2013, at 9:21 AM, Wolfgang Schuster wolfgang.schus...@gmail.com wrote: Am 14.01.2013 um 15:08 schrieb Rogers, Michael K mrog...@emory.edu: Hi, I wrote Lua routines a while back that parse a string representation of a weekly schedule to create a table representation of the schedule. It worked last fall. Certainly in August, 2012 and I think at least as late October. I just tried it again, but it failed; and it failed on the same file it worked on before. Before I roll up my sleeves and starting digging through the code, I was wondering if something had changed in the last two or three months that I should know about. No MWE for you, but here's the ConTeXt command that sends an ID (#1) and a parameters (#2) to Lua \def\defineschedule{\dodoubleempty\dodefineschedule} \def\dodefineschedule[#1][#2]{\ctxlua{userdata.schedule.new(#1,#2)}} What’s the error message, there is no way to tell what’s wrong with only these two code lines. 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 ___ This e-mail message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message (including any attachments) is strictly prohibited. If you have received this message in error, please contact the sender by reply e-mail message and destroy all copies of the original message (including attachments). ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Any ConTeXt-Lua changes
On Mon, Jan 14 2013, Rogers, Michael K wrote: I thought something must have changed, Perhaps the lua-version: 5.1 - 5.2 -- Peter ___ 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] Bibliography in authornum format
I am using ConTeXt ver: 2013.01.10 01:04 MKIV and here is the MWE. I would like to create numbered bibliography with *Author name [1]* format. If multiple authors are present then it should produce *Author /et al./ [1]*. This does not happen. Instead I get *Author, [1]*. Since I am new to ConTeXt, I might be making a basic mistake. Devendra --- \setupbibtex[database={bib}] % As suggested by Aditya on TEX SX. \setuppublications[alternative=num, refcommand=authornum] \starttext I am refering to \cite{me13} . \placepublications[criterium=text] \stoptext bib.bib @article{me13, title = {This bibliography in context}, author = {Convert, Recent and User, Power and Fiddler, Amateur}, journal = {Tex SX}, volume = {1}, number = {1}, pages = {1-11}, year = {2013}, } --- ___ 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] index: distinguish entries by pagestyle
On Jan 14, 2013, at 2:54 PM, Andreas Mang m...@imt.uni-luebeck.de wrote: Hi there, I got a question considering the registers. I'd like to distinguish between the definition of some term and its appearance/use somewhere else (boldface vs. normal font of page number for instance). The garden provides a solution, which does not seem to work for me: %%% \setupregister[index][nb][pagestyle=bold] \starttext My \index[nb::dog]{dog}dog is a cat\index{cat}. \placeindex \stoptext %%% (modified from http://wiki.contextgarden.net/Registers). What I'd like to have is, that dog appears with a bold page number and that cat doesn't. Your example produces the expected output with Mkii, and your code is OK, so i assume this must be a bug in Mkiv. Hans? 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] index: distinguish entries by pagestyle
···date: 2013-01-14, Monday···from: Schmitz Thomas A.··· On Jan 14, 2013, at 2:54 PM, Andreas Mang m...@imt.uni-luebeck.de wrote: Hi there, I got a question considering the registers. I'd like to distinguish between the definition of some term and its appearance/use somewhere else (boldface vs. normal font of page number for instance). The garden provides a solution, which does not seem to work for me: %%% \setupregister[index][nb][pagestyle=bold] \starttext My \index[nb::dog]{dog}dog is a cat\index{cat}. \placeindex \stoptext %%% (modified from http://wiki.contextgarden.net/Registers). What I'd like to have is, that dog appears with a bold page number and that cat doesn't. Your example produces the expected output with Mkii, and your code is OK, so i assume this must be a bug in Mkiv. Hans? Hi Andreas and Thomas, this was reported a while back [0] but is still a “todo” in the source [1]. Regards Philipp [0] http://www.ntg.nl/pipermail/ntg-context/2011/059544.html [1] http://repo.or.cz/w/context.git/blob/refs/heads/origin:/tex/context/base/strc-reg.mkiv pgpeER2DKNSjO.pgp Description: PGP signature ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Any ConTeXt-Lua changes
On 1/14/2013 3:48 PM, Rogers, Michael K wrote: The error is basically that a variable is 'nil'. I figure it's my job to track down why -- the code is long and boring and sometimes complicated. I just thought if there's been some change in how parameters are passed or strings handled. A typical use would be \defineschedule[test][sched={M--Th 8.05a--9:20,1:45--2:30}] The 'sched' is parsed to {day, interval = {start, stop}} pairs and stored in a table. It seems the interval table is nil now, but it used to work. Here's the actual error: ! LuaTeX error [string \directlua ]:529: attempt to index field '?' (a nil value) stack traceback: [string \directlua ]:529: in function 'dotablerow' [string \directlua ]:658: in function 'tablefromschedule' [string \directlua ]:1: in main chunk. system tex error on line 58 in file Syllabus112.tex: LuaTeX error … I thought something must have changed, since nothing has changed in the syllabus file or the module file, since a couple of months ago. If nothing occurs to anyone, I'll just have to trace it down. Thanks in any case, whether you can think of something or not. we moved from lua 5.1 to lua 5.2 so maybe you do something very 5.1-ish - 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] Update: Bibliography in authornum format
Please see: http://tex.stackexchange.com/questions/93729/bibliography-in-context for a solution provided by Aditya at stackexchange. I shouldn't have asked the question on two forums. Sorry for the trouble. Regards, Devendra ___ 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] Bibliography in authornum format
On Mon, 14 Jan 2013, Devendra Ghate wrote: I am using ConTeXt ver: 2013.01.10 01:04 MKIV and here is the MWE. I would like to create numbered bibliography with *Author name [1]* format. If multiple authors are present then it should produce *Author /et al./ [1]*. This does not happen. Instead I get *Author, [1]*. Since I am new to ConTeXt, I might be making a basic mistake. Devendra --- \setupbibtex[database={bib}] % As suggested by Aditya on TEX SX. \setuppublications[alternative=num, refcommand=authornum] \starttext I am refering to \cite{me13} . \placepublications[criterium=text] \stoptext bib.bib @article{me13, title = {This bibliography in context}, author = {Convert, Recent and User, Power and Fiddler, Amateur}, journal = {Tex SX}, volume = {1}, number = {1}, pages = {1-11}, year = {2013}, } --- As I had explained in http://tex.stackexchange.com/a/93743/323, the definition of \bibauthornumref needs to be updated to: \def\dobibauthornumref#1% {\bibinsertrefsep \doifbibreferencefoundelse{#1} {\begingroup \cite[left=,right=,alternative=author][#1]% \bibalternative\c!inbetween \cite[num][#1]% \endgroup} {}} 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] Bibliography in authornum format
On 1/14/2013 7:10 PM, Aditya Mahajan wrote: As I had explained in http://tex.stackexchange.com/a/93743/323, the definition of \bibauthornumref needs to be updated to: \def\dobibauthornumref#1% {\bibinsertrefsep \doifbibreferencefoundelse{#1} {\begingroup \cite[left=,right=,alternative=author][#1]% \bibalternative\c!inbetween \cite[num][#1]% \endgroup} {}} in bibl-tra.mkiv ? - 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] ntg-context Digest, Vol 103, Issue 37
Thank you, Sietse, That works a treat. And thank you for your idea of looking at the source code. I should do that more often to ease myself into understanding TeX a bit better. At the moment I still look at myself as a user. Regards, Malte. On 14/01/2013, at 7:00 PM, ntg-context-requ...@ntg.nl wrote: Date: Sun, 13 Jan 2013 22:44:59 +0100 From: Sietse Brouwer sbbrou...@gmail.com To: mailing list for ConTeXt users ntg-context@ntg.nl Subject: Re: [NTG-context] Controlling Appearance of \inoutermargin Message-ID: CAF=dkzyWB-aVxCKb_+Fo+_Jn+Hhdw9HBRvj7XOhGghwg=t4...@mail.gmail.com Content-Type: text/plain; charset=UTF-8 Hi Malte, This mail contains (1) an answer to your question; (2) a minimal working example; (3) an explanation of how I found this out (I had never heard of inoutermargin before). (1) An answer to your question. I grepped the ConTeXt source code for `inoutermargin`, and found out it is an instance of the `margindata` class. This is its setup command: \setupmargindata[inoutermargin][style=bold,color=red] (2) A minimal working example. It is nice to include an MWE when you ask a question -- it makes things easier for people who want to try to answer the question, because they don't have to think up their own example. Anyway, I'm including this one for the benefit of people who stumble across this e-mail from the future, and want to play with \inoutermargin. :-) \setuppapersize[A8,landscape] % w x h is about 7.5x5 \setuplayout[ backspace=1cm, width=3cm, % leftmargin=0.5cm, leftmargindistance=2mm, % rightmargin=2cm, rightmargindistance=2mm] \setuppagenumbering[alternative=doublesided] \showframe \startbuffer asdf asdf asdf \inoutermargin{bsdf} \page[yes] \stopbuffer \setupmargindata [inoutermargin] [style=bold,color=red] \starttext \getbuffer \getbuffer \getbuffer \stoptext (3) How I found the answer Whenever I want to learn about a command I don't know yet, I grep for it in the source code. (I ignore bits like 'setup' or 'start'.) I've even got a shell command for it, to make searching the source as easy as possible: function grepcon { cd /opt/context/tex/texmf-context/tex/context/base/ grep -R $* * } `grepcon inoutermargin` gave me two hits in mkii files, and one in typo-mar.mkiv: \definemargindata[inoutermargin][\v!outer][...various style setups...]. That set me on the right track. If you frequently need to work out how commands work, I cannot recommend enough that you make your own source-searching function and use it enough. For me, at least, it's enormously helpful. Cheers, Sietse ___ 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 ___