Re: [NTG-context] TEI - conTeXt
On Dec 11, 2010, at 8:56 PM, Jon Crump wrote: > > I've done as you suggest and downloaded the minimals beta leaving the > TeX-live distribution behind, so I can be on the same page with you > all. Hans's fix has worked. I'm gratified that my intuition about how > @xml:id should work was not wrong. The example in my last message now > works as expected. > If you want to try the latest and greatest, it's indeed better to work with the minimals. You can always keep texlive if you want to use other TeX stuff or if you want a stable fallback in case the latest beta breaks. > > This looks sensible to me. I'll see if I can't make it work with my > document next week. Thanks ever so much. Is that string substitution > function a bit of Lua? > Indeed, that's a lua function. It's extracting a substring (substitution would be string.gsub). > > Thomas, I do not take it in a negative way; simply practical. I take > seriously both the principle and practice of open-source endeavors > like ConTeXt, and the scholarly work it can support. I hope and intend > that as I get up to speed, I'll be able to make some small > contribution, even if it's only posting the commented example of our > project on the wiki. I've done some programming in Python, and am > rather keen to learn something about Lua, as they have quite a bit in > common. It's unlikely I'll be able to make substantive contributions > to the code, but not impossible in the fullness of time. I'm mindful > of the generosity of all involved, and all on this list, and offer > great thanks and kudos. > > Your cautionary note on the bilingual edition is taken to heart, and I > have recommended that for the time being our project will not try to > implement a facing page translation. This remains an important > desideratum for us however, and I will attend with great interest your > progress, and the insights of any engaged in similar efforts. The > specific use-case we have in mind, and the problems associated with it > may be of interest to others and I'll post it on the wiki. Good, that's the spirit! 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] color all the formulae?
Hi, Hans: Is there some way to color all the formulae braced in $$ and \start|stopformula? I search setupcolors, only textcolor is available. there are also no color key in setupformulae. Yue Wang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] \par in end of define fails
On Thu, 16 Dec 2010, Jonas Stein wrote: \define[1]\myoneliner{#1 \par } raises an error. (Untested) \define[1]\myoneliner{#1 \endgraf} 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] Installation context minimals
OkayI think the following was missing. In addition to the three commands I needed mtxrun --generate I have update the Wiki by adding this command to making formats. Let me know if this is incorrect. On Wed, Dec 15, 2010 at 7:41 PM, Curiouslearn wrote: > I just want to update my post to include the following information: > > I had forgotten to run the following step during the installation: > > source /Applications/ContextMinimals/tex/setuptex > > I did that and ran the three commands > > mtxrun --selfupdate > luatools --generate > context --make > > > This time a lot of things happened for the the latter two commands. > > I should mention that I also added the following line to my .bash_profile file > > . /Applications/ConTeXtMinimals/tex/setuptex /Applications/ConTeXtMinimals/tex > > However, when I try to typeset the file, I get the following error: > > MTXrun | unknown script 'context.lua' or 'mtx-context.lua' > > Any ideas. Please help! > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] Installation context minimals
I just want to update my post to include the following information: I had forgotten to run the following step during the installation: source /Applications/ContextMinimals/tex/setuptex I did that and ran the three commands mtxrun --selfupdate luatools --generate context --make This time a lot of things happened for the the latter two commands. I should mention that I also added the following line to my .bash_profile file . /Applications/ConTeXtMinimals/tex/setuptex /Applications/ConTeXtMinimals/tex However, when I try to typeset the file, I get the following error: MTXrun | unknown script 'context.lua' or 'mtx-context.lua' Any ideas. Please help! ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] \par in end of define fails
\define[1]\myoneliner{#1 \par } raises an error. Why, and how should i repair it? Kind regards, -- Jonas Stein ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] Installation context minimals
Hello, Can someone please tell me if the instructions for installation/updating of minimals given on http://wiki.contextgarden.net/ConTeXt_Minimals#Unix-like_platforms_.28Linux.2FMacOS_X.2FFreeBSD.2FSolaris.29 are still valid. I went to my /Applications/ContextMinimals folder (on Mac OSX) and typed: sh first-setup.sh --extras=all Then I entered, mtxrun --selfupdate However, I got the following: MTXrun | resolvers: to be replaced old script /Applications/ConTeXtMinimalsStable/tex/texmf-osx-intel/bin/mtxrun MTXrun | resolvers: using suffix based filetype 'lua' MTXrun | resolvers: unable to locate new script Seems like there was a problem here. Anyway, I went ahead and did luatools --selfupdate and I got: MTXrun | unknown script 'base.lua' or 'mtx-base.lua' and, then I did context --make which gave me, MTXrun | unknown script 'context.lua' or 'mtx-context.lua' Can someone please explain the recipe for installation. What I should do? Also, I have read long back in the forum that some people have two installations at the same time and you can switch between these. How is this done? Is there any information about this on the Wiki. Thanks. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \do(single|double|etc)empty behaviour
Wolfgang Schuster writes: > Am 15.12.2010 um 19:40 schrieb Marco Pessotto: > >> >> Hello there. >> >> I was writing a small macro to emulate a custom \part command, and I >> broke my head against \dosingleempty (but finally I won). >> >> […] >> >> It's unclear to me how the arguments are passed between macros. >> Probably it's just a matter of knowledge of TeX macro programming >> (which obviously I don't have). > > Your test with \iffirstargument fails because you perform it after > \startalignment which has itself a argument which sets > \iffirstargument to true, a better way to check for content of the > optional argument is \doifsomethingelse. > > \def\talpart > {\dosingleempty\dotalpart} > > \def\dotalpart[#1]#2% > {\page[right] >\blank[force,2*big] >\startalignment[center] >\doifsomethingelse{#1} > {{\bfc#1}\writetolist[talpart]{}{#1. #2}} > {\writetolist[talpart]{}{#2}}% >\blank[2*big] >{\bfd#2} >\stopalignment >\page[left]} > > Wolfgang > Thanks a lot for your explanation. I've added a "pitfalls" section to http://wiki.contextgarden.net/Commands_with_optional_arguments#Pitfalls (well, it was a pitfall at least for me) -- 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] \do(single|double|etc)empty behaviour
Am 15.12.2010 um 19:40 schrieb Marco Pessotto: > > Hello there. > > I was writing a small macro to emulate a custom \part command, and I > broke my head against \dosingleempty (but finally I won). > > […] > > It's unclear to me how the arguments are passed between macros. > Probably it's just a matter of knowledge of TeX macro programming (which > obviously I don't have). Your test with \iffirstargument fails because you perform it after \startalignment which has itself a argument which sets \iffirstargument to true, a better way to check for content of the optional argument is \doifsomethingelse. \def\talpart {\dosingleempty\dotalpart} \def\dotalpart[#1]#2% {\page[right] \blank[force,2*big] \startalignment[center] \doifsomethingelse{#1} {{\bfc#1}\writetolist[talpart]{}{#1. #2}} {\writetolist[talpart]{}{#2}}% \blank[2*big] {\bfd#2} \stopalignment \page[left]} 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] \do(single|double|etc)empty behaviour
Hello there. I was writing a small macro to emulate a custom \part command, and I broke my head against \dosingleempty (but finally I won). Why this example is working: % start % \definelist[talpart] \define\talpart{\page[right]% \blank[2*big]% \startalignment[center]% \dosingleempty\doTalPart} \def\doTalPart[#1]#2{% \iffirstargument debug: I have the optional arg \bfc#1\blank[2*big] \writetolist[talpart]{}{{#1. }#2} \else debug: I don't have any arg \blank[2*big] \writetolist[talpart]{}{#2} \fi \bfd#2 \stopalignment \blank[2*big] } \starttext \placelist[talpart] \talpart[optional]{With optional argument} \input knuth \talpart{No argument} \input ward \stoptext %%% stop While this, the original one, is definitively not working? % start % \definelist[talpart] \define\talpart{\dosingleempty\doTalPart} \def\doTalPart[#1]#2{% \page[right] \startalignment[center] \blank[force,2*big] \iffirstargument debug: I have the optional arg \noindent{\bfc#1}\blank[2*big] \writetolist[talpart]{}{{#1. }#2} \else debug: I don't have any arg \blank[2*big] \writetolist[talpart]{}{#2} \fi {\noindent \bfd#2} \stopalignment \page[left] } \starttext \placelist[talpart] \talpart[optional]{With optional argument} \input knuth \talpart{No argument} \input ward \stoptext %%% stop It's unclear to me how the arguments are passed between macros. Probably it's just a matter of knowledge of TeX macro programming (which obviously I don't have). My source of inspiration was: http://wiki.contextgarden.net/Commands_with_optional_arguments Bests -- 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] Horizontal space in math subscript generated by Lua
Hello, On Wed, 15 Dec 2010 13:06:42 +0100, Hans Hagen wrote: actually, the luacode was doing the right thing as there is a protect/unprotect mismatch (will be fixed); puttingthis at the top of you file works: \catcodetable\ctxcatcodes thank you, Hans. This makes both solutions (Ctx generated and Lua generated) equal - [wider] spacing is the same. Just my point of view - the previous native Ctx result (= narrower spacing in subscript when mixing upper and lower case letters) - seemed to me a bit prettier; wouldn't be better to keep the "old" Ctx look (= result without \catcodetable\ctxcatcodes) and to drive Lua to give the same result? Best regards, Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Help: tweaking bibliography style
In article , Nicola wrote: > Hi, > currently, in my document, an article reference looks like this: > > [1] Thor, A. U. (2010). ConTeXt is great. My Own Publishing, 2(4), 23-34. > > with the title in italics. How to make the year appear at the end and > how to make the publisher in italics, too? I would like such changes to > apply to other types of references as well (books, inproceedings, etc...) > > Second, \cite[Thor:2010,Bar:2009] produces something like [6 and 9]. How > do I get rid of 'and' and get simply [6,9]? Sorry for the noise: somehow, I hadn't noticed that a fairly complete bib manual exists. Now I realise how flexible the module is. As for bibltx, I assume that it is deprecated. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] Own environment creating
Hello Hans, Its ingeniously simple and easy!!! ConTeXt never cease fascinate to me! God Save the developers of ConTeXt! :-) Jaroslav with greetings Dne 15.12.2010 12:37, Hans Hagen napsal(a): On 15-12-2010 11:49, Jaroslav Hajtmar wrote: Hello experts, I'll find somewhere perfect example of how to define and set parameters of my own environment. I want to create my own environment derived from framedtext environment. I want to use my own settings such as: \defineframedtext[MyFramedCols][MYTITLE=My title, MYNUMCOLS=3, ..., width = (ie the rest is inherited from the parent environment) ] Is such a thing possible? It is within the power of an ordinary user to do something similar (as for example using namespaces)? I was googling without result... you can just add your own key/values and access them with \framedparameter{MYTITLE} etc - 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] Horizontal space in math subscript generated by Lua
On 14-12-2010 12:25, Procházka Lukáš Ing. - Pontex s. r. o. wrote: Hello, I encountered a strange effect. Let's have a code that generates the same math, firstly by Ctx and secondly by Lua: --- \starttext \startformula M_{t,WnT} = 1000 \stopformula \startluacode context.startformula() context("M_{t,WnT} = 1000") context.stopformula() \stopluacode \stoptext --- You can see the result - the space between "W" and "n" in lower index is smaller when generated (natively) by Ctx than that in math generated by Lua. (The latter case may affect a bit "disturbingly" to the reader.) It seems also that space between (subscript) "T" and "=" varies. So why these differences? How to avoid the extra-space when Lua generates math subscript? actually, the luacode was doing the right thing as there is a protect/unprotect mismatch (will be fixed); putting this at the top of you file works: \catcodetable\ctxcatcodes I have no clue yet where the space comes from (that's taco's speciality) 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] How to avoid that \writetolist becomes a page-breaker
Hans Hagen writes: > On 14-12-2010 9:00, Marco Pessotto wrote: > > \doneleavehmode > \writetolist[myrandompart]{It's a test} > \input knuth > > i.e. just bind the write to some text Thanks for your answer. I'm on my way to the wiki :-) -- Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] bold small caps
On 12-12-2010 8:39, Peter Münster wrote: On Sun, Dec 12 2010, Wolfgang Schuster wrote: \unexpanded\def\sc{\doifelsecurrentfonthasfeature{smcp}{\addfs{smcp}}\normalsc} Nice! Hans, what about integration into the core? when it works out ok, I'm sure that wolfgang and I will look into it 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] How to avoid that \writetolist becomes a page-breaker
On 14-12-2010 9:00, Marco Pessotto wrote: \doneleavehmode \writetolist[myrandompart]{It's a test} \input knuth i.e. just bind the write to some text - 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] How to avoid that \writetolist becomes a page-breaker
On 14-12-2010 10:32, Marco Pessotto wrote: \subject{\bf My title!} \dontleavehmode \writetolist[myrandompart]{}{It's a test} works. The question if is this the right thing to do, still remains, though it's quite ok as long as you realize that it introduces 'something' in the text stream, so xxx \dontleavehmode\writetolist[myrandompart]{}{It's a test} xxx is actually: xxx [something written to a list] xxx so when whitespace is setup, in some cases you can get some extra also, the [something ...] can end up on the current page or the next one, depending on the circumstances in practice it's no real problem as one will do explicit writes inside boxes or so - 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] Own environment creating
On 15-12-2010 11:49, Jaroslav Hajtmar wrote: Hello experts, I'll find somewhere perfect example of how to define and set parameters of my own environment. I want to create my own environment derived from framedtext environment. I want to use my own settings such as: \defineframedtext[MyFramedCols][MYTITLE=My title, MYNUMCOLS=3, ..., width = (ie the rest is inherited from the parent environment) ] Is such a thing possible? It is within the power of an ordinary user to do something similar (as for example using namespaces)? I was googling without result... you can just add your own key/values and access them with \framedparameter{MYTITLE} etc - 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] Own environment creating
Hello experts, I'll find somewhere perfect example of how to define and set parameters of my own environment. I want to create my own environment derived from framedtext environment. I want to use my own settings such as: \defineframedtext[MyFramedCols][MYTITLE=My title, MYNUMCOLS=3, ..., width = (ie the rest is inherited from the parent environment) ] Is such a thing possible? It is within the power of an ordinary user to do something similar (as for example using namespaces)? I was googling without result... Sufficient to link it somehow to try to wade through Thanx Jaroslav ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___