[NTG-context] Definition of lualetterbackslash
Hi Consider the following example: \startluacode print(lualetterbackslash:, [=[\\include]=]) \stopluacode \def\lualetterbackslash{\letterbackslash} \startluacode print(letterbackslash:, [=[\\include]=]) \stopluacode \bye gives lualetterbackslash: \\include letterbackslash:\include I find the second alternative better. Why is \lualetterbackslash defined differently from \letterbackslash? 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] Definition of lualetterbackslash
On 22-8-2011 09:15, Aditya Mahajan wrote: Hi Consider the following example: \startluacode print(lualetterbackslash:, [=[\\include]=]) \stopluacode \def\lualetterbackslash{\letterbackslash} \startluacode print(letterbackslash:, [=[\\include]=]) \stopluacode \bye gives lualetterbackslash: \\include letterbackslash: \include I find the second alternative better. Why is \lualetterbackslash defined differently from \letterbackslash? to avoid problems with \n, \t and such btw, best use context.include then as it provides you better tracing 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] Definition of lualetterbackslash
On Mon, 22 Aug 2011, Hans Hagen wrote: On 22-8-2011 09:15, Aditya Mahajan wrote: Hi Consider the following example: \startluacode print(lualetterbackslash:, [=[\\include]=]) \stopluacode \def\lualetterbackslash{\letterbackslash} \startluacode print(letterbackslash:, [=[\\include]=]) \stopluacode \bye gives lualetterbackslash: \\include letterbackslash: \include I find the second alternative better. Why is \lualetterbackslash defined differently from \letterbackslash? to avoid problems with \n, \t and such Ah, I see. btw, best use context.include then as it provides you better tracing Well, \include is a lilypond command that must be written to an external file, something like this: \startluacode lilypond_preamble = [[ \\include lilypond-book-preamble.py other settings that will be substituted at run-time ]] buffers.assign(preamble, lilypond_preamble) \stopluacode \startbuffer[content] content of lilypond file \stopbuffer \savebuffer[preamble,content][temp-file] \bye I'll probably just use \appendtoks \def\/{\letterbackslash} \to\everyluacode and then \/include. Other than using the magic single letter commands, I don't see an easy way of getting a \ in a lua string inside luacode :( - \noexpand\include fails unless I define \include - \letterbackslash include gives \ include - \letterbackslash{}include gives \{}include 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] Definition of lualetterbackslash
On 22-8-2011 10:49, Aditya Mahajan wrote: and then \/include. Other than using the magic single letter commands, I don't see an easy way of getting a \ in a lua string inside luacode :( - \noexpand\include fails unless I define \include - \letterbackslash include gives \ include - \letterbackslash{}include gives \{}include you can also play with \luaescapestring{...} \detokenize{...} or just \string\include - 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] Two rotates on the same line
On Wed, Aug 17 2011, Cecil Westerhof wrote: I am still expanding my knowledge of ConTeXt. At the moment I am playing with \rotate. When using: \rotate[rotation=42]{Tekst kan ook worden geroteerd.} \rotate[rotation=-42]{In elke richting die je maar wilt.} This is displayed as: / \ I would like it displayed as: /\ How can I do that? \starttext \dontleavehmode \rotate[rotation=42]{Tekst kan ook worden geroteerd.} \rotate[rotation=-42]{In elke richting die je maar wilt.} \stoptext - http://wiki.contextgarden.net/FAQ#Why_is_there_a_line-break_in_the_output_after_some_commands.3F -- 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 ___
Re: [NTG-context] Lilypond
Am 2011-08-22 um 03:53 schrieb Aditya Mahajan: @Hraban: Long story short, the filter module is working again. Can you test the dev branch from the latest git version? Thank you! LilyPond ist called, but your approach of including the LaTeX file fails, since you don’t define \linebreak from: \includegraphics{test1-temp-lilypond-0-1}% \ifx\betweenLilyPondSystem \undefined \linebreak \else \expandafter\betweenLilyPondSystem{1}% \fi In my test case (where I include the one system per file patch) I can \def\linebreak{\relax} and get a nice multi-page score. Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer) ___ If your question is of interest to others as well, please add an 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] Itemize right-aligned
Hi, is it possible to right-align enumerations? Giving something like the following This is the first item * A somewhat longer second item * A short third item * Thanks Erik No but you can use descriptions to get this output: \definedescription [myitem] [location=right, align=flushright, width=2em, distance=1em, headalign=middle, text={\symbol[bullet]}] \starttext \input ward \startmyitem \input ward \stopmyitem \startmyitem \input ward \stopmyitem \input ward \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] Lilypond
On Mon, 22 Aug 2011, Henning Hraban Ramm wrote: Am 2011-08-22 um 03:53 schrieb Aditya Mahajan: @Hraban: Long story short, the filter module is working again. Can you test the dev branch from the latest git version? Thank you! LilyPond ist called, but your approach of including the LaTeX file fails, since you don’t define \linebreak from: I need bigger test files :) I find creating TeX macros to parse the latex output easier than understanding what lilypond creates (there is very little documentation about what goes on behind the scenes). Even the generated latex output is horrible, but, at least, I understand what it does. \includegraphics{test1-temp-lilypond-0-1}% \ifx\betweenLilyPondSystem \undefined \linebreak \else \expandafter\betweenLilyPondSystem{1}% \fi Can you send me the complete example? In my test case (where I include the one system per file patch) I can \def\linebreak{\relax} and get a nice multi-page score. and also send the one system per file patch (is it just including lilypond-book-preamble.ly?). I'll add \let\linebreak\donothing to lilypond::setups. Aditya___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] arbitrary tex-code in xml?
Hi all, must be the heat here in Germany - I'm all out of ideas, and I have no example yet. Maybe someone can help: is it possible to define an xml setup that will run arbitrary tex code? Something like this (obviously pseudo-code): in a TeX file MyInputs.tex which will be loaded at runtime, I have: \startTEXbuffer[mybuffer] \color[red]{Hello World!} \stopTEXbuffer in the xml, I have gettexbuffermybuffer/gettexbuffer and in the setups \input MyInputs \startxmlsetups xml:gettexbuffer \getTEXbuffer[\xmlflush{#1}] \stopxmlsetups I tried with simple \startbuffer[mybuffer] ... \getbuffer[mybuffer], but the result is that the TeX code is typeset verbatim, not processed (problem of catcodes?). Any takers before I pull myself together and try to come up with an example? Thanks! 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] arbitrary tex-code in xml?
On 22-8-2011 18:02, Thomas A. Schmitz wrote: Hi all, must be the heat here in Germany - I'm all out of ideas, and I have no example yet. Maybe someone can help: is it possible to define an xml setup that will run arbitrary tex code? Something like this (obviously pseudo-code): I know that I should refuse to answer questions without a minimal example ... I'm pretty sure that your students can't use the heat-wave excuse. \startbuffer[example] something sometexweird/sometex /something \stopbuffer \startbuffer[weird] \color[red]{Looks red to me!} \stopbuffer \startxmlsetups xml:mysetups \xmlsetsetup{#1}{*}{xml:*} \stopxmlsetups \xmlregistersetup{xml:mysetups} \startxmlsetups xml:something \blank \relax [start something] \blank \xmlflush{#1} \blank \relax [stop something] \blank \stopxmlsetups \startxmlsetups xml:sometex \pushcatcodetable \catcodetable\ctxcatcodes \getbuffer[\xmlflush{#1}] \popcatcodetable \stopxmlsetups \starttext \xmlprocessbuffer{main}{example}{} \stoptext I'll replace \processTEXbuffer by: \unexpanded\def\processTEXbuffer {\dosingleempty\doprocessTEXbuffer} \def\doprocessTEXbuffer[#1]% {\pushcatcodetable \catcodetable\ctxcatcodes \getbuffer[#1]% \popcatcodetable} so that you can say: \startxmlsetups xml:sometex \processTEXbuffer[\xmlflush{#1}] \stopxmlsetups 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] arbitrary tex-code in xml?
On 08/22/2011 07:19 PM, Hans Hagen wrote: I know that I should refuse to answer questions without a minimal example ... I'm pretty sure that your students can't use the heat-wave excuse. You're right, of course, for educational purposes... As for my students: they use the weirdest excuses anyway... \startbuffer[example] something sometexweird/sometex /something \stopbuffer \startbuffer[weird] \color[red]{Looks red to me!} \stopbuffer \startxmlsetups xml:mysetups \xmlsetsetup{#1}{*}{xml:*} \stopxmlsetups \xmlregistersetup{xml:mysetups} \startxmlsetups xml:something \blank \relax [start something] \blank \xmlflush{#1} \blank \relax [stop something] \blank \stopxmlsetups \startxmlsetups xml:sometex \pushcatcodetable \catcodetable\ctxcatcodes \getbuffer[\xmlflush{#1}] \popcatcodetable \stopxmlsetups \starttext \xmlprocessbuffer{main}{example}{} \stoptext I'll replace \processTEXbuffer by: \unexpanded\def\processTEXbuffer {\dosingleempty\doprocessTEXbuffer} \def\doprocessTEXbuffer[#1]% {\pushcatcodetable \catcodetable\ctxcatcodes \getbuffer[#1]% \popcatcodetable} so that you can say: \startxmlsetups xml:sometex \processTEXbuffer[\xmlflush{#1}] \stopxmlsetups Excellent, it must be less hot in Hasselt then... Thanks for the example, and for the solution! So \processTEXbuffer will end up in the core? 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] arbitrary tex-code in xml?
On 22-8-2011 19:31, Thomas A. Schmitz wrote: Excellent, it must be less hot in Hasselt then... Thanks for the no, also hot example, and for the solution! So \processTEXbuffer will end up in the core? yes, already put in Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] please fix command reference links on contextgarden
it does *still* not work. the fuction is defined as such: function show_command(URL) { open_window().location.href='http://texshow.contextgarden.net/cmd/' + URL; } and thus redirects to some url under http://texshow.contextgarden.net/. but no matter what that url is, the subdomain always redirects to the url http://wiki.contextgarden.net/Category:Reference/en (no, not http://wiki.contextgarden.net/Category:Reference/en/TheCommandName!) please fix it, whoeveer runs texshow.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] please fix command reference links on contextgarden
On Mon, Aug 22, 2011 at 21:14, Philipp A. wrote: it does still not work. the fuction is defined as such: function show_command(URL) { open_window().location.href='http://texshow.contextgarden.net/cmd/' + URL; } and thus redirects to some url under http://texshow.contextgarden.net/. but no matter what that url is, the subdomain always redirects to the url http://wiki.contextgarden.net/Category:Reference/en (no, not http://wiki.contextgarden.net/Category:Reference/en/TheCommandName!) please fix it, whoeveer runs texshow.contextgarden.net Can you please provide more details - how can we reproduce the problem and where is that function? Thank you, Mojca (texshow used to be a separate application; it is now part of wiki) ___ If your question is of interest to others as well, please add an 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] please fix command reference links on contextgarden
Can you please provide more details of course how can we reproduce the problem go to e.g. http://wiki.contextgarden.net/Quotes and click on a command link, e.g. *single quotes* \quote{some text} in the wiki, the fake link on \quote is a real one, calling javascript:show_command('quote') on click. and where is that function? the function can be found in http://wiki.contextgarden.net/index.php?title=-action=rawsmaxage=0gen=jsuseskin=monobook270, which is loaded in the head of each contextgarden wiki page. and as said, the problem is that - either the function should open the right url in the first place - or texshow should redirect properly @texshow: the resonse header contains the following lines: HTTP/1.1 302 Found Server: Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 PHP/5.2.6-2ubuntu4.6 with Suhosin-Patch Phusion_Passenger/2.2.4 Location: http://wiki.contextgarden.net/Category:Reference/en so the apache webapp is misconfigured. Thank you, Mojca thank you for listening :D (texshow used to be a separate application; it is now part of wiki) i kinda figured that ;) ___ If your question is of interest to others as well, please add an 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] please fix command reference links on contextgarden
On Mon, Aug 22, 2011 at 21:53, Philipp A. wrote: and where is that function? the function can be found in http://wiki.contextgarden.net/index.php?title=-action=rawsmaxage=0gen=jsuseskin=monobook270, which is loaded in the head of each contextgarden wiki page. Thank you. It was a very nasty one to find, it is located here: http://wiki.contextgarden.net/MediaWiki:Monobook.js I fixed the link now, but we probably need to remove javascript alltogether and just create a normal link. 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] please fix command reference links on contextgarden
2011/8/22 Mojca Miklavec mojca.miklavec.li...@gmail.com Thank you. It was a very nasty one to find, it is located here: http://wiki.contextgarden.net/MediaWiki:Monobook.js I fixed the link now, but we probably need to remove javascript alltogether and just create a normal link. Mojca thank you! ___ If your question is of interest to others as well, please add an 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 ___