[NTG-context] \par and \startlines
Hi, I'm trying to typeset a poem from XML, but I can't figure out how to make the inbetween key working here. As the source is XML, I cannot just add an empty line to start a new group of lines inside \startlines...\stoplines. I guess, there must be a command to do that, but \par seems to have no effect here. How can this be done? Best, Denis %%% \setuplines[before={\blank},after={\blank},inbetween={ARE WE INBETWEEN?\blank}] % XML Nodes auswählen \startxmlsetups xml:test \xmlsetsetup{#1}{*}{-} \xmlsetsetup{#1}{doc|poem|stanza|line}{xml:*} \stopxmlsetups \xmlregistersetup{xml:test} \startxmlsetups xml:doc \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:poem \startlines \xmlflush{#1} \stoplines \stopxmlsetups \startxmlsetups xml:stanza \xmlflushlinewise{#1}\par %this has no effect \stopxmlsetups \startxmlsetups xml:line \xmlflush{#1} \stopxmlsetups \startbuffer[test] The lines are there! The lines are there! \stopbuffer \starttext This works: \startlines The lines are there! The lines are there! \stoplines Apparently, \type{\par} has no effect here: \startlines The lines are there!\par% \par has no effect here The lines are there! \stoplines For background, this is what I'm actually trying to do: \xmlprocessbuffer{test}{test}{} \stoptext %% ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
Re: [NTG-context] poetry \startlines and tab
On 1/12/2022 1:09 AM, jbf via ntg-context wrote: For poetry that has non-regular indentations, I simply \definelines[poem] and set that up the way I want, obviously, with \setuplines[poem] e.g. [before={\blank \setupinterlinespace[line=2.5ex]},after={\blank},indenting=first]. And then, but I guess it is still a hack, I use \hskip at a suitable dimension whenever I need indented lines: \startpoem This is line one, \hskip1em{This is line two} This is line three, \hskip1em{This is line four,} \hskip1em{This is line five.} \rightaligned{Poet's name} \stoppoem \quad - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] poetry \startlines and tab
For poetry that has non-regular indentations, I simply \definelines[poem] and set that up the way I want, obviously, with \setuplines[poem] e.g. [before={\blank \setupinterlinespace[line=2.5ex]},after={\blank},indenting=first]. And then, but I guess it is still a hack, I use \hskip at a suitable dimension whenever I need indented lines: \startpoem This is line one, \hskip1em{This is line two} This is line three, \hskip1em{This is line four,} \hskip1em{This is line five.} \rightaligned{Poet's name} \stoppoem Julian On 11/1/22 1:01 pm, Youssef Cherem via ntg-context wrote: Hello, I needed to typeset some poetry and noticed that \startlines[space=on] Some line with tab % doesn't work, no spaces added Some line with spaces %work \stoplines Is there a way to make the "tab" render the space "as is"? ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] startlines with long lines that break and indent
juh via ntg-context schrieb am 26.12.2021 um 17:36: Hi all, I am looking for a way to make startstoplines likes this: This is a long line that breaks, the second line, the third line. So if a line in the poem is too long it shall break and indent. Short version: \setuplines [ before={\blank\startnarrow[default=left,left=1cm]}, after={\stopnarrow\blank}, indenting={yes,-1cm}] \showframe[text][text] \starttext before \startlines text \dorecurse{10}{ text} text \dorecurse{40}{ text} text \dorecurse{10}{ text} \stoplines after \stoptext Long version: \definemeasure[Indentation][1cm] \definenarrower [LinesIndentation] [ before=\blank, after=\blank, default=left, left=\measure{Indentation}] \definelines [Poem] [ before=\startLinesIndentation, after=\stopLinesIndentation, indenting={yes,-\measure{Indentation}}] \showframe[text][text] \starttext before \startPoem text \dorecurse{10}{ text} text \dorecurse{40}{ text} text \dorecurse{10}{ text} \stopPoem after \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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] startlines with long lines that break and indent
On 2021-12-26 11:36, juh via ntg-context wrote: Hi all, I am looking for a way to make startstoplines likes this: This is a long line that breaks, the second line, the third line. So if a line in the poem is too long it shall break and indent. TIA juh You can play with something based on the following, which I made it following suggestions from others. There may well be other ways, but this works for me. \define\Poemindent{3em} \define\Poeminset{14em} \definedelimitedtext[Poe] \setupwhitespace[medium] \showframe \startbuffer[Poem] This is a long line that breaks, the second line, the third line. The second stanza starts. \stopbuffer \setupdelimitedtext[Poe][ rightmargin=\Poeminset, leftmargin={\dimexpr\Poemindent+\Poeminset\relax}, before={\setuplines[ before=, inbetween={\blank[small]}, after=, ] \startlines \setupindenting[-\Poemindent,yes] \startparagraph}, after=\stopparagraph \stoplines, ] \starttext \startparagraph Here comes a poem – watch the lines break! \stopparagraph \startPoe \inlinebuffer[Poem] \stopPoe \startparagraph Now, it is gone. Good-bye. \stopparagraph \stoptext -- Rik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Typesetting poetry with particular indenting
Tommaso Gordini schrieb am 02.07.2020 um 17:33: I have found this, that works, buy I don't know if there's a possibility of using less code: [...] The following example needs version 2020.07.02 or newer. begin example \definelines [poem] \setuplines [poem] [ before={\startframedtext[location=middle,width=fit,offset=none,frame=off]}, after={\stopframedtext}, indentlist={0em,1em,1em}] \starttext \startpoem Per correr miglior acque alza le vele omai la navicella del mio ingegno, che lascia dietro a sé mar sì crudele; e canterò di quel secondo regno dove l'umano spirito si purga e di salire al ciel diventa degno. Ma qui la morta poesì resurga, o sante Muse, poi che vostro sono; e qui Calïopè alquanto surga, seguitando il mio canto con quel suono di cui le Piche misere sentiro lo colpo tal, che disperar perdono. \stoppoem \stoptext end example 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Typesetting poetry with particular indenting
I have found this, that works, buy I don't know if there's a possibility of using less code: % !TEX encoding = UTF-8 Unicode % !TEX TS-program = ConTeXt-MkIV % questo codice centra il blocco dei versi sulla pagina \defineframedtext [poemframed] [width=\textwidth, autowidth=force, align=flushleft, before=, after=, frame=off] \definenarrower[poemnarrower] \definelines [poemlines] [before={\startpoemnarrower[left]}, after=\stoppoemnarrower] \definebuffer[poem] \def\stoppoem{\setups{poems:buffer}} \startsetups poems:buffer \setupnarrower[poemnarrower][left=0pt] \setbox\scratchbox\vbox {\poemframed {\startpoemlines \getpoem \stoppoemlines}} \edef\poemhsize{\the\dimexpr(\hsize-\wd\scratchbox)/2\relax} \setupnarrower[poemnarrower][left=\poemhsize] \startpoemlines \getpoem \stoppoemlines \stopsetups % questo codice rientra ogni secondo e terzo verso \unprotect \installindentingmethod {three} {\c_spac_indentation_toggle_state\plusthree} \unexpanded\def\spac_indentation_tri_toggle_indeed {\glet\checkindentation\spac_indentation_tri_toggle} \unexpanded\def\spac_indentation_tri_toggle {\gdef\checkindentation {\spac_indentation_remove \gdef\checkindentation{\spac_indentation_tri_toggle_indeed}}} % this next macro is redefinition of a core macro! \def\spac_indentation_check_toggle {\ifcase\c_spac_indentation_toggle_state % nothing \or \spac_indentation_no_toggle \or \spac_indentation_do_toggle \or \spac_indentation_tri_toggle \fi} \protect % questo codice attiva il rientro \setupindenting[yes,1em] \setuplines[indenting=three] \starttext \startpoem Per correr miglior acque alza le vele omai la navicella del mio ingegno, che lascia dietro a sé mar sì crudele; e canterò di quel secondo regno dove l'umano spirito si purga e di salire al ciel diventa degno. Ma qui la morta poesì resurga, o sante Muse, poi che vostro sono; e qui Calïopè alquanto surga, seguitando il mio canto con quel suono di cui le Piche misere sentiro lo colpo tal, che disperar perdono. \stoppoem \stoptext Il giorno gio 2 lug 2020 alle ore 17:14 Tommaso Gordini < illinguista1...@gmail.com> ha scritto: > Thanks, Wolfgang. Your example works, but the verse indentation ( > \setuplines[indenting=three]) is lost. > There's a way to preserve it? > > Tommy > > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Typesetting poetry with particular indenting
Thanks, Wolfgang. Your example works, but the verse indentation ( \setuplines[indenting=three]) is lost. There's a way to preserve it? Tommy ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Typesetting poetry with particular indenting
Hans Hagen schrieb am 02.07.2020 um 16:48: On 7/2/2020 4:15 PM, Wolfgang Schuster wrote: Hans Hagen schrieb am 02.07.2020 um 15:40: On 7/2/2020 3:01 PM, Tommaso Gordini wrote: [...] I'll add this \setuplines[indentnext={0pt,10pt,15pt,20pt}] % \setuplines[indentnext={0pt,*,*}] which then is a challenge for WS to get in the setups and for you to wikify Are you sure you use the correct key? Well, we have that key (and maybe some day we can do that for all), i was wondering about 'left' but then we'd need some \cycle command or so But indentnext is only used to prevent or allow indentation of a paragraph at the end of an environment. 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Typesetting poetry with particular indenting
On 7/2/2020 4:15 PM, Wolfgang Schuster wrote: Hans Hagen schrieb am 02.07.2020 um 15:40: On 7/2/2020 3:01 PM, Tommaso Gordini wrote: Hi everyone. I am typesetting a poetry text in triplets and I would like the second and third lines of each triplet to be indented (i.e., in the next example, verse no. 2, 3, 5, and 6). Is it possible to get what I ask for with ConTeXt? The most I managed to do is this: \starttext \setupindenting[yes,1em] \setuplines[indenting=even] \startlines Per correr miglior acque alza le vele omai la navicella del mio ingegno, che lascia dietro a sé mar sì crudele; e canterò di quel secondo regno dove l'umano spirito si purga e di salire al ciel diventa degno. \stoplines \stoptext but that's not what I want. I'll add this \setuplines[indentnext={0pt,10pt,15pt,20pt}] % \setuplines[indentnext={0pt,*,*}] which then is a challenge for WS to get in the setups and for you to wikify Are you sure you use the correct key? Well, we have that key (and maybe some day we can do that for all), i was wondering about 'left' but then we'd need some \cycle command or so Hans -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Typesetting poetry with particular indenting
Taco, this works! Thank you! Now (last question), it's possibile to centering in the middle of the page the whole verse block ? Tommy Il giorno gio 2 lug 2020 alle ore 15:56 Taco Hoekwater ha scritto: > > I was having fun with this as well while Hans was writing his generic > solution. > > Here is an explicit ‘indent each 2nd and 3rd line’: > > > \unprotect > > \installindentingmethod {three} > {\c_spac_indentation_toggle_state\plusthree} > > \unexpanded\def\spac_indentation_tri_toggle_indeed > {\glet\checkindentation\spac_indentation_tri_toggle} > > \unexpanded\def\spac_indentation_tri_toggle > {\gdef\checkindentation > {\spac_indentation_remove >\gdef\checkindentation{\spac_indentation_tri_toggle_indeed}}} > > % this next macro is redefinition of a core macro ! > \def\spac_indentation_check_toggle > {\ifcase\c_spac_indentation_toggle_state > % nothing > \or > \spac_indentation_no_toggle > \or > \spac_indentation_do_toggle > \or > \spac_indentation_tri_toggle > \fi} > \protect > %% > > to be used with: > > \setuplines[indenting=three] > > > Best wishes, > Taco > > > On 2 Jul 2020, at 15:01, Tommaso Gordini > wrote: > > > > \starttext > > > > \setupindenting[yes,1em] > > \setuplines[indenting=even] > > > > \startlines > > Per correr miglior acque alza le vele > > omai la navicella del mio ingegno, > > che lascia dietro a sé mar sì crudele; > > e canterò di quel secondo regno > > dove l'umano spirito si purga > > e di salire al ciel diventa degno. > > \stoplines > > > > \stoptext > > Taco Hoekwater > Elvenkind BV > > > > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Typesetting poetry with particular indenting
Hans Hagen schrieb am 02.07.2020 um 15:40: On 7/2/2020 3:01 PM, Tommaso Gordini wrote: Hi everyone. I am typesetting a poetry text in triplets and I would like the second and third lines of each triplet to be indented (i.e., in the next example, verse no. 2, 3, 5, and 6). Is it possible to get what I ask for with ConTeXt? The most I managed to do is this: \starttext \setupindenting[yes,1em] \setuplines[indenting=even] \startlines Per correr miglior acque alza le vele omai la navicella del mio ingegno, che lascia dietro a sé mar sì crudele; e canterò di quel secondo regno dove l'umano spirito si purga e di salire al ciel diventa degno. \stoplines \stoptext but that's not what I want. I'll add this \setuplines[indentnext={0pt,10pt,15pt,20pt}] % \setuplines[indentnext={0pt,*,*}] which then is a challenge for WS to get in the setups and for you to wikify Are you sure you use the correct key? 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Typesetting poetry with particular indenting
I was having fun with this as well while Hans was writing his generic solution. Here is an explicit ‘indent each 2nd and 3rd line’: \unprotect \installindentingmethod {three} {\c_spac_indentation_toggle_state\plusthree} \unexpanded\def\spac_indentation_tri_toggle_indeed {\glet\checkindentation\spac_indentation_tri_toggle} \unexpanded\def\spac_indentation_tri_toggle {\gdef\checkindentation {\spac_indentation_remove \gdef\checkindentation{\spac_indentation_tri_toggle_indeed}}} % this next macro is redefinition of a core macro ! \def\spac_indentation_check_toggle {\ifcase\c_spac_indentation_toggle_state % nothing \or \spac_indentation_no_toggle \or \spac_indentation_do_toggle \or \spac_indentation_tri_toggle \fi} \protect %% to be used with: \setuplines[indenting=three] Best wishes, Taco > On 2 Jul 2020, at 15:01, Tommaso Gordini wrote: > > \starttext > > \setupindenting[yes,1em] > \setuplines[indenting=even] > > \startlines > Per correr miglior acque alza le vele > omai la navicella del mio ingegno, > che lascia dietro a sé mar sì crudele; > e canterò di quel secondo regno > dove l'umano spirito si purga > e di salire al ciel diventa degno. > \stoplines > > \stoptext Taco Hoekwater Elvenkind BV ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Typesetting poetry with particular indenting
On 7/2/2020 3:01 PM, Tommaso Gordini wrote: Hi everyone. I am typesetting a poetry text in triplets and I would like the second and third lines of each triplet to be indented (i.e., in the next example, verse no. 2, 3, 5, and 6). Is it possible to get what I ask for with ConTeXt? The most I managed to do is this: \starttext \setupindenting[yes,1em] \setuplines[indenting=even] \startlines Per correr miglior acque alza le vele omai la navicella del mio ingegno, che lascia dietro a sé mar sì crudele; e canterò di quel secondo regno dove l'umano spirito si purga e di salire al ciel diventa degno. \stoplines \stoptext but that's not what I want. I'll add this \setuplines[indentnext={0pt,10pt,15pt,20pt}] % \setuplines[indentnext={0pt,*,*}] which then is a challenge for WS to get in the setups and for you to wikify Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Typesetting poetry with particular indenting
Hi everyone. I am typesetting a poetry text in triplets and I would like the second and third lines of each triplet to be indented (i.e., in the next example, verse no. 2, 3, 5, and 6). Is it possible to get what I ask for with ConTeXt? The most I managed to do is this: \starttext \setupindenting[yes,1em] \setuplines[indenting=even] \startlines Per correr miglior acque alza le vele omai la navicella del mio ingegno, che lascia dietro a sé mar sì crudele; e canterò di quel secondo regno dove l'umano spirito si purga e di salire al ciel diventa degno. \stoplines \stoptext but that's not what I want. Thank you very much in advance? Tommy ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Capitalize first word of first line within \startlines
On 3/4/2020 5:09 PM, Thangalin wrote: Looking to uppercase the first word of a poem: \setupindenting[yes, 0.75em] \setupinitial[ state=start, n=2, distance=\zeropoint, ] % This does not appear to work? \definealternativestyle[PoemFirstWord][\WORD][] \definefirstline[PoemFirstLine][ alternative=word, style=PoemFirstWord, n=1, ] \definestartstop[poem][ before={\startlines \setfirstline[PoemFirstLine] \placeinitial}, after={\stoplines}, ] \setuplines[indenting=odd] \starttext \startpoem Some say the world will end in fire, Some say in ice. From what I've tasted of desire I hold with those who favor fire. But if it had to perish twice, I think I know enough of hate To say that for destruction ice Is also great, And would suffice. \stoppoem \stoptext Any ideas why the first word is not capitalized? because it is not applied to that stretch ... but i will send you something to play with ... kind of braindead trivial piece of code but it needs testing a bit Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Capitalize first word of first line within \startlines
Looking to uppercase the first word of a poem: \setupindenting[yes, 0.75em] \setupinitial[ state=start, n=2, distance=\zeropoint, ] % This does not appear to work? \definealternativestyle[PoemFirstWord][\WORD][] \definefirstline[PoemFirstLine][ alternative=word, style=PoemFirstWord, n=1, ] \definestartstop[poem][ before={\startlines \setfirstline[PoemFirstLine] \placeinitial}, after={\stoplines}, ] \setuplines[indenting=odd] \starttext \startpoem Some say the world will end in fire, Some say in ice. From what I've tasted of desire I hold with those who favor fire. But if it had to perish twice, I think I know enough of hate To say that for destruction ice Is also great, And would suffice. \stoppoem \stoptext Any ideas why the first word is not capitalized? 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] problem with \sym?
Alan Bowen schrieb am 04.02.19 um 18:50: Here is a mwe that gives the same error as the original: luatex warning > hpack filter: error: ...eXt/tex/texmf-context/tex/context/base/mkiv/typo-dua.lua:422: attempt to compare number with nil tex error > tex error on line 22 in file /Users/bowen1/Desktop/TestTeX/test-02.tex: ? \setupdirections[bidi=global, method=one]%<—— \defineitemgroup[CList][levels=2] \setupCList[1][n, broad, packed, autointro, repeat, continue] [itemalign=flushright, left={},right={},stopper={.}, margin=0pc, before={\setupinterlinespace[off] \setuplines[before={}, after={}] \startlines}, after={\stoplines}] \setupCList[2][n, broad, packed, joinedup, autointro] [itemalign=flushright, left={}, right={}, stopper={}, margin=0pc, ] \startcomponent[*] \startCList \sym{} Preface \sym{0.} Prolegomena %<——line 22 \stopCList \stopcomponent The example processes as it should when the first line is commented out. It works with method two or three for \setupdirections. Below is a shorter minimal example. \setupdirections[bidi=global,method=one] \starttext \setbox\scratchbox\autodirhbox{xyz} \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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] problem with \sym?
Alan Bowen schrieb am 04.02.19 um 16:37: I should have done this originally. Sorry for that. My table of contents is component of a book-project; it is essentially a custom itemization. The following: \defineitemgroup[CList][levels=2] \setupCList[1][n, broad, packed, autointro, repeat, continue] [itemalign=flushright, left={},right={},stopper={.}, margin=0pc, before={\setupinterlinespace[off] \setuplines[before={}, after={}] \startlines}, after={\stoplines}] \setupCList[2][n, broad, packed, joinedup, autointro] [itemalign=flushright, left={}, right={}, stopper={}, margin=0pc, ] \def\leaderfill{\leaders\hbox to 1em{\hss. \hss}\hfill} \define[1]\pg{{\switchtobodyfont[10pt]\hfill\at[#1]\crlf}} \startcomponent%\starttext \startCList \sym{} Illustrations and Tables\pg{Illustrations} \sym{} Preface\pg{Preface} \sym{} Acknowledgments\pg{Acknowledgments} \blank[big, fixed] \sym{0.} Prolegomena to the Study of Hellenistic Astronomy \emph{Alan C.\ Bowen and Francesca Rochberg}\pg{ACB00} \stopCList \stopcomponent%\stoptext Oddly enough, there is no problem if the code is run between \starttext and \stoptext. This used to work with the previous betas. \startcomponent expects the name of the current file as argument, e.g. \startcomponent [mycomponent] or \startcomponent mycomponent You can also replace the name of the current file with a asterisk, e.g. \startcomponent [*] In your document \startcomponent takes \startCList as argument which leads to the error message. 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Error at \stoplines
Am 2018-01-23 um 22:42 schrieb Aditya Mahajan <adit...@umich.edu>: > On Tue, 23 Jan 2018, Henning Hraban Ramm wrote: > >> Am 2018-01-23 um 10:29 schrieb r.erm...@hccnet.nl: >>>> in my current project, every time I use \startlines .. \stoplines (for >>>> poems), I run into this error: >>>> structure > sectioning > chapter @ level 2 : 5.2 -> Example >>>> tex error > tex error on line 27 in file ka34/c_example.tex: ! Extra >>>> }, or forgotten \endgroup >>> 1. count the number of \startlines, do this with grep -e '^\\startlines' | >>> wc | less >>> 2. count the number of \stoplines, do this with grep -e ‘^\\stoplines' | wc >>> | less >>> But you probably already thought of this yourself. >> >> That’s not the problem, there are only a few "lines" sections, and of course >> I checked these first. >> I also checked all(?) other \start/stops, braces and brackets - of course I >> could have overlooked some, it’s a whole book, but most cases are caught on >> their own. >> >> I guess it might be something in my setups, but not in \setuplines, but >> don’t know for what I should look, there’s too much... >> >> Which other setups affect \start/stoplines? > > The error could be due to some other mismatched group. Have you tried: > > mtxrun --script concheck filename.tex Thank you for the reminder, I should use this more often. Of course it found a few errors, and now the book runs through. It’s strange that ConTeXt only stopped at \stoplines. Greetlings, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Error at \stoplines
On Tue, 23 Jan 2018, Henning Hraban Ramm wrote: Am 2018-01-23 um 10:29 schrieb r.erm...@hccnet.nl: in my current project, every time I use \startlines .. \stoplines (for poems), I run into this error: structure > sectioning > chapter @ level 2 : 5.2 -> Example tex error > tex error on line 27 in file ka34/c_example.tex: ! Extra }, or forgotten \endgroup 1. count the number of \startlines, do this with grep -e '^\\startlines' | wc | less 2. count the number of \stoplines, do this with grep -e ‘^\\stoplines' | wc | less But you probably already thought of this yourself. That’s not the problem, there are only a few "lines" sections, and of course I checked these first. I also checked all(?) other \start/stops, braces and brackets - of course I could have overlooked some, it’s a whole book, but most cases are caught on their own. I guess it might be something in my setups, but not in \setuplines, but don’t know for what I should look, there’s too much... Which other setups affect \start/stoplines? The error could be due to some other mismatched group. Have you tried: mtxrun --script concheck filename.tex 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Error at \stoplines
Am 2018-01-23 um 10:29 schrieb r.erm...@hccnet.nl: >> in my current project, every time I use \startlines .. \stoplines (for >> poems), I run into this error: >> structure > sectioning > chapter @ level 2 : 5.2 -> Example >> tex error > tex error on line 27 in file ka34/c_example.tex: ! Extra >> }, or forgotten \endgroup > 1. count the number of \startlines, do this with grep -e '^\\startlines' | wc > | less > 2. count the number of \stoplines, do this with grep -e ‘^\\stoplines' | wc | > less > > But you probably already thought of this yourself. That’s not the problem, there are only a few "lines" sections, and of course I checked these first. I also checked all(?) other \start/stops, braces and brackets - of course I could have overlooked some, it’s a whole book, but most cases are caught on their own. I guess it might be something in my setups, but not in \setuplines, but don’t know for what I should look, there’s too much... Which other setups affect \start/stoplines? Greetlings, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Finalizing my book
Mikoláš Štrajt <mailto:stra...@seznam.cz> 5. September 2015 22:15 I am finalizing my semi-autogenerated e-book and i ran into three issues: 1) its impossible to place table of content after the content itself. It simply doesnt display without any trace in log. 2) i am triying to use Antykwa Torunska with "\definetypeface [antykwa] [rm] [serif] [antykwa-torunska] [default] [encoding=ec]", but it complaint for misssing typescript. Is there some working way to install it? (Using minimals) Use \definetypeface [antykwa] [rm] [serif] [antykwa] [default] to set the font. 3) is there some trick to protect stanzas of poems against pagebreak in the middle of stanza? Or there are some usefult tips/modules when typeseting poetry in Context? You can use the lines environment with the packed option. begin example \definetypeface [antykwa] [rm] [serif] [antykwa] [default] \setupbodyfont[antykwa] \setuplines[option=packed,inbetween={\blank[line,preference]}] \setuppapersize[A6] \showframe \starttext \subsection{Co mě tak láká?} \startlines A ty se ptáš, co mě tak láka, na tobě? Odpoveď máš tady i když v snivé podobě Dostal jsem ochutnat z poháru štěstí. Je to jak tancovat na poušti v dešti. Rychle mi však došlo, že byl to jen sen Nad pouští slunce vyšlo a zase další horký den. Tak buď mi oázou, do které toužím jít. Pouští mé kroky jdou, mám žízeň, musím pít. I kdybys byla jen fata morgána, tak dáváš mi směr. Oslovit můžu pak, to slunce nad náma: Jen do mě si per! \stoplines \stoptext end example 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] orphans and widows in poems
On 6/17/2013 1:39 AM, Wolfgang Schuster wrote: Verse page. You don’t need any tricks to prevent page breaks in a lines environment because \setuplines[option=packed] already does it. Wolfgang You still need to make each stanza an individual lines environment, don't you? -- Bill Meahan Westland Michigan ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] orphans and widows in poems
On 17/06/13 07:39, Wolfgang Schuster wrote: Am 17.06.2013 um 02:36 schrieb Bill Meahan subscribed_li...@meahan.net: On 6/16/2013 3:46 AM, Pablo Rodríguez wrote: [...] Is there no way to avoid orphans and widows in the lines environment? It's a bit ugly, but if the poem consists of individual stanzas, you can put each stanza in an non-bordered frame. [...] A frame will never be split across pages. BTW this trickis on the wiki on the Verse page. You don’t need any tricks to prevent page breaks in a lines environment because \setuplines[option=packed] already does it. Many thanks for your replies, Bill, Aditya and Wolfgang. I don't want to prevent page breaks in lines environment, I only want to prevent orphan and widow lines in this environment too (which seems to be impossible, if I didn't get it wrong). Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] orphans and widows in poems
Am 17.06.2013 um 15:50 schrieb Bill Meahan subscribed_li...@meahan.net: On 6/17/2013 1:39 AM, Wolfgang Schuster wrote: Verse page. You don’t need any tricks to prevent page breaks in a lines environment because \setuplines[option=packed] already does it. Wolfgang You still need to make each stanza an individual lines environment, don't you? You can change the definition of the inbetween key (default: \blank) which is used when you add a blank line in the environment. With the preference keyword for \blank you can allow a page break. \setuplayout[lines=8] \starttext \showframe \startlines[option=packed,inbetween={\blank[preference,line]}] Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 \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] orphans and widows in poems
On 6/16/2013 3:46 AM, Pablo Rodríguez wrote: I'm afraid that I get widow lines in the lines environment. Is there no way to avoid orphans and widows in the lines environment? It's a bit ugly, but if the poem consists of individual stanzas, you can put each stanza in an non-bordered frame. e.g.: % Set up the lines environment to put the contained lines in a frame so they are kept together \setuplines[indenting={yes,small,even}, -- whatever options you want before={\startframedtext[frame=off]}, after=\stopframedtext] % Then wrap your stanzas in individual line environments \startlines A maiden fair was seated there, Her hair of fine-spun gold. Azure eyes so clear and bright, So wondrous to behold. \stoplines A frame will never be split across pages. BTW this trickis on the wiki on the Verse page. -- Bill Meahan Westland Michigan ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] orphans and widows in poems
On Sun, 16 Jun 2013, Bill Meahan wrote: On 6/16/2013 3:46 AM, Pablo Rodríguez wrote: I'm afraid that I get widow lines in the lines environment. Is there no way to avoid orphans and widows in the lines environment? It's a bit ugly, but if the poem consists of individual stanzas, you can put each stanza in an non-bordered frame. e.g.: % Set up the lines environment to put the contained lines in a frame so they are kept together \setuplines[indenting={yes,small,even}, -- whatever options you want before={\startframedtext[frame=off]}, after=\stopframedtext] % Then wrap your stanzas in individual line environments \startlines A maiden fair was seated there, Her hair of fine-spun gold. Azure eyes so clear and bright, So wondrous to behold. \stoplines A frame will never be split across pages. BTW this trickis on the wiki on the Verse page. If the poem consists of stanzas with fixed number of lines, say 4, then you could also try: \setuplines[inbetween={\testpage[4]\blank}] This will ensure that a stanza does not break across pages. 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] orphans and widows in poems
Am 17.06.2013 um 02:36 schrieb Bill Meahan subscribed_li...@meahan.net: On 6/16/2013 3:46 AM, Pablo Rodríguez wrote: I'm afraid that I get widow lines in the lines environment. Is there no way to avoid orphans and widows in the lines environment? It's a bit ugly, but if the poem consists of individual stanzas, you can put each stanza in an non-bordered frame. e.g.: % Set up the lines environment to put the contained lines in a frame so they are kept together \setuplines[indenting={yes,small,even}, -- whatever options you want before={\startframedtext[frame=off]}, after=\stopframedtext] % Then wrap your stanzas in individual line environments \startlines A maiden fair was seated there, Her hair of fine-spun gold. Azure eyes so clear and bright, So wondrous to behold. \stoplines A frame will never be split across pages. BTW this trickis on the wiki on the Verse page. You don’t need any tricks to prevent page breaks in a lines environment because \setuplines[option=packed] already does it. 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] Indenting in \setuplines
On 6/6/2013 12:36 AM, Marcin Borkowski wrote: Sorry to say that, but neither seems to work... it is hard to say what goes wrong if you only show the error message and no real code 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] Indenting in \setuplines
Dnia 2013-06-06, o godz. 09:49:27 Hans Hagen pra...@wxs.nl napisał(a): On 6/6/2013 12:36 AM, Marcin Borkowski wrote: Sorry to say that, but neither seems to work... it is hard to say what goes wrong if you only show the error message and no real code Sorry for that, my fault. Now comes the fun part: I *copied* my code from my version of spac-hor.mkiv to the document, and it started to work then! Strange. I attach a MWE. Hans, is it possible to add something like that to spac-hor.mkiv? (This code is not very nice, there's some duplication, but it's simple and works;).) cut here \unprotect \installindentingmethod{oddpairs}{\c_spac_indentation_toggle_state\plusthree} \installindentingmethod{evenpairs}{\c_spac_indentation_toggle_state\plusfour} \newcount \c_spac_par_modulo_four \def\spac_indentation_evenpairs_toggle {% \advance \c_spac_par_modulo_four \plusone \ifnum \c_spac_par_modulo_four=4 \c_spac_par_modulo_four=0 \fi \ifcase \c_spac_par_modulo_four \global\indentationtrue \or \global\indentationfalse \spac_indentation_remove \or \global\indentationfalse \spac_indentation_remove \or \global\indentationtrue \fi } \def\spac_indentation_oddpairs_toggle {% \advance \c_spac_par_modulo_four \plusone \ifnum \c_spac_par_modulo_four=4 \c_spac_par_modulo_four=0 \fi \ifcase \c_spac_par_modulo_four \global\indentationfalse \spac_indentation_remove \or \global\indentationtrue \or \global\indentationtrue \or \global\indentationfalse \spac_indentation_remove \fi } \def\spac_indentation_check_toggle {\ifcase\c_spac_indentation_toggle_state % nothing \or% odd \spac_indentation_no_toggle \or% even \spac_indentation_do_toggle \or% oddpairs \global\let\checkindentation\spac_indentation_oddpairs_toggle \or% evenpairs \global\let\checkindentation\spac_indentation_evenpairs_toggle \fi} \protect \setupindenting[yes,1em] \starttext \startlines[indenting=evenpairs] Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. \stoplines \stoptext cut here Hans Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Indenting in \setuplines
Dnia 2013-06-03, o godz. 15:20:45 Marcin Borkowski mb...@wmi.amu.edu.pl napisał(a): Hi, I'd like to have my \startlines ... \stoplines indented in the following way: the first two lines unindented, the next two indented, and so on. Basically, this means that I'd like the pattern to be based on (mod 4) arithmetic and not (mod 2). Is it possible? If yes, how? OK, so I thought I can handle this... but not:(. I found the relevant definitions in spac-hor.mkiv and tried to add a line saying \installindentingmethod \v!evenpairs{\c_spac_indentation_toggle_state\plusfour} But after context --make I got an Undefined control sequence. Here's an excerpt from the log information: ! Undefined control sequence. system tex error on line 108 in file /home/marcin/context-2013-05-22-19-28/tex/texmf-context/tex/context/base/spac-hor.mkiv: Undefined control sequence ... 98 99 \installindentingmethod \v!yes {\parindent\d_spac_indentation_par\relax} % not \indent ! 100 \installindentingmethod \v!always{\parindent\d_spac_indentation_par\relax} % not \indent ! 101 102 \installindentingmethod \v!never {\parindent\zeropoint\relax % no \indent ! 103 \c_spac_indentation_toggle_state\zerocount} 104 105 \installindentingmethod \v!odd {\c_spac_indentation_toggle_state\plusone} 106 \installindentingmethod \v!even {\c_spac_indentation_toggle_state\plustwo} 107 %\installindentingmethod \v!oddpairs {\c_spac_indentation_toggle_state\plusthree} 108 \installindentingmethod \v!evenpairs {\c_spac_indentation_toggle_state\plusfour} 109 110 \installindentingmethod \v!normal{\ifx\normalindentation\empty\else 111 \let\v_spac_indentation_current\normalindentation 112 \simplesetupindenting 113 \fi} 114 115 \installindentingmethod \v!reset {\settrue\c_spac_indentation_indent_first 116 \parindent\zeropoint 117 \c_spac_indentation_toggle_state\zerocount} 118 argument \??indentingmethod \v!evenpairs \setvalue #1?-\expandafter \def \csname #1 \endcsname \installindentingmethod ...{\??indentingmethod #1} {#2} l.108 ...{\c_spac_indentation_toggle_state\plusfour} What am I doing wrong? TIA, Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Indenting in \setuplines
On 6/5/2013 11:06 PM, Marcin Borkowski wrote: Dnia 2013-06-03, o godz. 15:20:45 Marcin Borkowski mb...@wmi.amu.edu.pl napisał(a): Hi, I'd like to have my \startlines ... \stoplines indented in the following way: the first two lines unindented, the next two indented, and so on. Basically, this means that I'd like the pattern to be based on (mod 4) arithmetic and not (mod 2). Is it possible? If yes, how? OK, so I thought I can handle this... but not:(. I found the relevant definitions in spac-hor.mkiv and tried to add a line saying \installindentingmethod \v!evenpairs{\c_spac_indentation_toggle_state\plusfour} % there is no \v!evenpairs \unprotect % english interface only: \installindentingmethod {evenpairs} {\c_spac_indentation_toggle_state\plusfour} % or maybe: \installindentingmethod \v!quadruple {\c_spac_indentation_toggle_state\plusfour} % as \v!quadruple is a known keyword \protect - 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] Indenting in \setuplines
Dnia 2013-06-06, o godz. 00:22:04 Hans Hagen pra...@wxs.nl napisał(a): On 6/5/2013 11:06 PM, Marcin Borkowski wrote: Dnia 2013-06-03, o godz. 15:20:45 Marcin Borkowski mb...@wmi.amu.edu.pl napisał(a): Hi, I'd like to have my \startlines ... \stoplines indented in the following way: the first two lines unindented, the next two indented, and so on. Basically, this means that I'd like the pattern to be based on (mod 4) arithmetic and not (mod 2). Is it possible? If yes, how? OK, so I thought I can handle this... but not:(. I found the relevant definitions in spac-hor.mkiv and tried to add a line saying \installindentingmethod \v!evenpairs{\c_spac_indentation_toggle_state\plusfour} % there is no \v!evenpairs \unprotect % english interface only: \installindentingmethod {evenpairs} {\c_spac_indentation_toggle_state\plusfour} % or maybe: \installindentingmethod \v!quadruple {\c_spac_indentation_toggle_state\plusfour} % as \v!quadruple is a known keyword \protect Sorry to say that, but neither seems to work... ! Missing number, treated as zero. to be read again q \v_spac_indentation_current -q uadruple \4unknown #1#2#3#4#5-#2=#1 \relax \spac_indentation_apply_step_one ...on_setup_size \fi \next1 #1,-\spac_indentation_apply_step_one {#1} \syst_helpers_do_process_co... \syst_helpers_do_process_comma_list ...rgument #1, ]\relax \global \advance \... ... l.36 \startlines[indenting=quadruple] ? What do I do? (And what do I do if I really want evenpairs, especially that I'd like to have oddpairs, too, so quadruple is not really a good keyword for me?) TIA, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Indenting in \setuplines
Hi, I'd like to have my \startlines ... \stoplines indented in the following way: the first two lines unindented, the next two indented, and so on. Basically, this means that I'd like the pattern to be based on (mod 4) arithmetic and not (mod 2). Is it possible? If yes, how? TIA, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to center with picture taken into consideration
Hello Cecil, I have a LuaTeX-based start for you, but there is one important thing I do not know: how to obtain the an image's width and/or height from Lua. Although that would also depend on whether you want to resize images to a fixed with, etc. Anyway, now that the typesetting code is Lua-based, working out the conditional stuff you need will hopefully be trivial (for 'if you know Lua or have an hour to learn the basics' values of trivial). Cheers, Sietse % 2013-04-27 \useMPlibrary[dum] \showframe \defineparagraphs[persoon] \setupparagraphs[persoon][1] [width=\dimexpr \textwidth - 3.5cm\relax, distance=0.5cm, align=middle, ] \setuplines[align=middle] \setupparagraphs[persoon][2][width=3cm] \starttext \startluacode -- a table containing the material we want to typeset local contents = { { text = [[ Naam: Adres: Burgerservicenummer: ]], image = pic1 }, { text = [[ Naam: Aapje aapje aapje aapje Adres: Olifantje Burgerservicenummer: En nu jij ]], image = pic2 } } -- typeset each text-image pair for k,v in ipairs(contents) do -- calculate or specify how wide you want the image and the paragraphs to be imagecolwidth = string.todimen(3cm) coldistance = string.todimen(0.5cm) textcolwidth = tex.dimen.textwidth - imagecolwidth - coldistance -- setup the text column context.setupparagraphs( { persoon }, { 1 }, { width = textcolwidth .. sp }) -- setup the image column (possibly to width 0?) context.setupparagraphs( { persoon }, { 2 }, { width = imagecolwidth .. sp }) -- the actual typesetting code context.startpersoon() context.startlines() context(v.text) context.stoplines() context.nextpersoon() context.externalfigure( { v.image}, { width = imagecolwidth .. sp, height = 4cm, factor = fit } ) context.stoppersoon() end \stopluacode \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] block with different formatting per line?
Am 06.02.2013 um 07:04 schrieb Ingo Hohmann cont...@ingohohmann.de: On 02/03/2013 04:56 AM, Rogers, Michael K wrote: On Feb 1, 2013, at 6:16 PM, Ingo Hohmann cont...@ingohohmann.de wrote: Hi, is it possible to define a block, where lines are automatically formatted differently? For example: first line in caps, second in bold, others normal. Is this possible? And how? If you mean input lines, then yes. But if you mean output lines, then I don't know. It seems a well-defined task, but a hard task judging by how the line-breaking algorithm is described by Knuth. I'll leave that question to experts. Here's a way to process the input lines. If there's a counter that counts the line number, there would be another way; but I couldn't find out that there was a counter. There may be better ways anyway. \define\FirstLine{\let\myLine\SecondLine\sc} \define\SecondLine{\let\myLine\OtherLine\bf} \define\OtherLine{\tf} \definelines[doMyLines][command=\myLine] \def\startMyLines{\let\myLine\FirstLine\startdoMyLines} \def\stopMyLines{\stopdoMyLines} As I said that works, but while trying to understand this, I found that the documentation for \definelines doesn't mention the command= option. On the other hand it does mention align= and this doesn't work. Neither does \setuplines. I always get undefined control sequence. \definelines[doFirstBoldRight][command=\myLine] \setupdoFirstBoldRight[align=flushleft] \setuplines[doFirstBoldRight][…] OR \definelines[doFirstBoldRight][align=flushleft,command=\myLine] gives the same error. Do you have any idea what I am doing wrong? Make a complete example. BTW: I suggest to use my Lua example from the other thread. 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] block with different formatting per line?
On 02/06/2013 02:29 PM, Wolfgang Schuster wrote: Am 06.02.2013 um 07:04 schrieb Ingo Hohmann cont...@ingohohmann.de mailto:cont...@ingohohmann.de: On 02/03/2013 04:56 AM, Rogers, Michael K wrote: On Feb 1, 2013, at 6:16 PM, Ingo Hohmanncont...@ingohohmann.de wrote: ... Here's a way to process the input lines. If there's a counter that counts the line number, there would be another way; but I couldn't find out that there was a counter. There may be better ways anyway. \define\FirstLine{\let\myLine\SecondLine\sc} \define\SecondLine{\let\myLine\OtherLine\bf} \define\OtherLine{\tf} \definelines[doMyLines][command=\myLine] \def\startMyLines{\let\myLine\FirstLine\startdoMyLines} \def\stopMyLines{\stopdoMyLines} As I said that works, but while trying to understand this, I found that the documentation for \definelines doesn't mention the command= option. On the other hand it does mention align= and this doesn't work. Neither does \setuplines. I always get undefined control sequence. ... Make a complete example. I thought I could get away without it, because it's practically the answer to my question, just with alignment. For some reason, now that I started from scratch to show the example, it works. \define\FirstLine{\let\myLine\SecondLine\sc} \define\SecondLine{\let\myLine\OtherLine\bf} \define\OtherLine{\tf} % this align here didn't work \definelines[doMyLines][align=flushright,command=\myLine] % and this setup doesn't %\setupdoMyLines[align=flushright] \def\startMyLines{\let\myLine\FirstLine\startdoMyLines} \def\stopMyLines{\stopdoMyLines} \definelines[right][align=flushright] % I get an error here, too. %\setupright[align=flushright] \starttext \startright test \stopright \startMyLines First line in caps, Second in bold, Others normal. Others normal. Others normal. \stopMyLines \stoptext BTW: I suggest to use my Lua example from the other thread. When I looked at it first, it was in the middle of the night. And it looked a bit over the moon for me. Now I think I can grab it, and it looks _very_ powerfull. Thank you. Ingo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] block with different formatting per line?
On Feb 6, 2013, at 1:04 AM, Ingo Hohmann cont...@ingohohmann.demailto:cont...@ingohohmann.de wrote: On 02/03/2013 04:56 AM, Rogers, Michael K wrote: On Feb 1, 2013, at 6:16 PM, Ingo Hohmann cont...@ingohohmann.demailto:cont...@ingohohmann.de wrote: Hi, is it possible to define a block, where lines are automatically formatted differently? For example: first line in caps, second in bold, others normal. Is this possible? And how? If you mean input lines, then yes. But if you mean output lines, then I don't know. It seems a well-defined task, but a hard task judging by how the line-breaking algorithm is described by Knuth. I'll leave that question to experts. Here's a way to process the input lines. If there's a counter that counts the line number, there would be another way; but I couldn't find out that there was a counter. There may be better ways anyway. \define\FirstLine{\let\myLine\SecondLine\sc} \define\SecondLine{\let\myLine\OtherLine\bf} \define\OtherLine{\tf} \definelines[doMyLines][command=\myLine] \def\startMyLines{\let\myLine\FirstLine\startdoMyLines} \def\stopMyLines{\stopdoMyLines} As I said that works, but while trying to understand this, I found that the documentation for \definelines doesn't mention the command= option. On the other hand it does mention align= and this doesn't work. Neither does \setuplines. I figured it out from the source, spac-lin.mkiv. One might see there that the align key does not seem to be processed; it s a relic from a previous version of ConTeXt, I suppose. Many macros have a command key, which usually seems to be a method for customizing the basic unit, in this case a line. (The source is written in a certain style that makes it possible often to figure things out, even when the wiki is not up-to-date. I say possible but not always easy. And there's always this maillist.) 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] block with different formatting per line?
On 02/03/2013 04:56 AM, Rogers, Michael K wrote: On Feb 1, 2013, at 6:16 PM, Ingo Hohmanncont...@ingohohmann.de wrote: Hi, is it possible to define a block, where lines are automatically formatted differently? For example: first line in caps, second in bold, others normal. Is this possible? And how? If you mean input lines, then yes. But if you mean output lines, then I don't know. It seems a well-defined task, but a hard task judging by how the line-breaking algorithm is described by Knuth. I'll leave that question to experts. Here's a way to process the input lines. If there's a counter that counts the line number, there would be another way; but I couldn't find out that there was a counter. There may be better ways anyway. \define\FirstLine{\let\myLine\SecondLine\sc} \define\SecondLine{\let\myLine\OtherLine\bf} \define\OtherLine{\tf} \definelines[doMyLines][command=\myLine] \def\startMyLines{\let\myLine\FirstLine\startdoMyLines} \def\stopMyLines{\stopdoMyLines} As I said that works, but while trying to understand this, I found that the documentation for \definelines doesn't mention the command= option. On the other hand it does mention align= and this doesn't work. Neither does \setuplines. I always get undefined control sequence. \definelines[doFirstBoldRight][command=\myLine] \setupdoFirstBoldRight[align=flushleft] OR \definelines[doFirstBoldRight][align=flushleft,command=\myLine] gives the same error. Do you have any idea what I am doing wrong? Thank you in advance, Ingo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] different vertical space with \definelines and \setuplines
Hi Hans, I have the following sample: \definelines[narrow][before=\blank,after=\blank] \stopsetups \starttext This is a paragraph.\par \startnarrow this is a verse this is a verse \stopnarrow This is paragraph.\par \stoptext If I replace \definelines with \setuplines, before and after aren't honored. \definelines adds an extra paragraph separation space within the lines that isn't inserted with \setuplines. Is this intended? Many thanks for your help, Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] different vertical space with \definelines and \setuplines
Am 09.12.2012 um 20:08 schrieb Pablo Rodríguez oi...@web.de: Hi Hans, I have the following sample: \definelines[narrow][before=\blank,after=\blank] \stopsetups \starttext This is a paragraph.\par \startnarrow this is a verse this is a verse \stopnarrow This is paragraph.\par \stoptext If I replace \definelines with \setuplines, before and after aren't honored. \definelines adds an extra paragraph separation space within the lines that isn't inserted with \setuplines. Is this intended? 1. When you add a blank line in a “lines” environment context inserts the value from the “inbetween” key. \starttext \startlines[inbetween=INBETWEEN] this is a verse this is a verse \stoplines \stoptext You can remove the line by setting “inbetween=”. 2. The \startnarrow command is already defined in the core as narrower command. \definenarrower[mynarrow][left=4em,default=left] \starttext Normal Text. \startnarrow Indented Text. \stopnarrow Normal Text. \startnarrow[mynarrow] Indented Text. \stopnarrow Normal Text. \stoptext 3. Replacing \definelines with \setuplines changes nothing because you haven’t created a lines environment with the name “narrow” yet. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A Lorem ipsum module?
On 19-7-2012 03:27, Rogers, Michael K wrote: On 2012-07-18 Marcin Borkowski mbork@??? wrote: in LaTeX, there is quite a useful package called lipsum, for typesetting varioud amounts of Lorem ipsum stuff. Is there anything like that in ConTeXt? (I know about \input knuth, \input tufte etc., but that is not exactly what I have in mind, especially when giving a sample of some design to a customer;).) The LaTeX lipsum seems to have been pre-download from lipsum.comhttp://lipsum.com. ConTeXt makes this relatively easy. The one problem that might be solved better is that the paragraphs come in a single xml node separated by single newlines. I defined a lines environment to make these into paragraphs, which is not as pretty as I would like. \startxmlsetups xml:Lorem:base \xmlsetsetup{Lorem}{*}{-} \xmlsetsetup{Lorem}{feed|lipsum}{xml:Lorem:*} \stopxmlsetups \xmlregisterdocumentsetup{Lorem}{xml:Lorem:base} \startxmlsetups xml:Lorem:feed \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:Lorem:lipsum \xmlflush{#1} \stopxmlsetups \definelines[LoremLines] \def\Lorem#1{% #1 = number of paragraphs to request \startLoremLines \xmlprocessfile{Lorem}{http://www.lipsum.com/feed/xml?amount=#1what=parasstart=yes}{} \stopLoremLines } \starttext \setupindenting[yes,20pt] \setuplines[LoremLines][command=\blank,indenting=yes] \Lorem{12} \stoptext I've added a module m-ipsum. I have no clue if it provides what one expects from such a module \usemodule[ipsum] \setupbodyfont[dejavu,11pt] \starttext \ipsum[alternative=paragraph,before=\blank,after=\blank] \ipsum[alternative=lines,n=2,right=\par,before=\blank,after=\blank] \ipsum[alternative=lines,n=random,before=\blank,after=\blank] \ipsum[alternative=lines,before=\startitemize,after=\stopitemize,left=\startitem,right=\stopitem] \ipsum[alternative=words,left=(,right=),inbetween=\space] \page \defineipsum [ward] [file=ward, before=\blank, after=\blank] \defineipsum [ward:itemize] [ward] [alternative=lines, before={\startitemize[packed]}, after=\stopitemize, left=\startitem, right=\stopitem] \defineipsum [ward:title] [ward] [alternative=lines, n=random] \subject{\directipsum{ward:title}} \ipsum[ward] \ipsum[ward:itemize] \stoptext Rather trivial code. 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] A Lorem ipsum module?
On 2012-07-18 Marcin Borkowski mbork@??? wrote: in LaTeX, there is quite a useful package called lipsum, for typesetting varioud amounts of Lorem ipsum stuff. Is there anything like that in ConTeXt? (I know about \input knuth, \input tufte etc., but that is not exactly what I have in mind, especially when giving a sample of some design to a customer;).) The LaTeX lipsum seems to have been pre-download from lipsum.comhttp://lipsum.com. ConTeXt makes this relatively easy. The one problem that might be solved better is that the paragraphs come in a single xml node separated by single newlines. I defined a lines environment to make these into paragraphs, which is not as pretty as I would like. \startxmlsetups xml:Lorem:base \xmlsetsetup{Lorem}{*}{-} \xmlsetsetup{Lorem}{feed|lipsum}{xml:Lorem:*} \stopxmlsetups \xmlregisterdocumentsetup{Lorem}{xml:Lorem:base} \startxmlsetups xml:Lorem:feed \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:Lorem:lipsum \xmlflush{#1} \stopxmlsetups \definelines[LoremLines] \def\Lorem#1{% #1 = number of paragraphs to request \startLoremLines \xmlprocessfile{Lorem}{http://www.lipsum.com/feed/xml?amount=#1what=parasstart=yes}{} \stopLoremLines } \starttext \setupindenting[yes,20pt] \setuplines[LoremLines][command=\blank,indenting=yes] \Lorem{12} \stoptext 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] indenting \startlines... \stoplines
Am 31.12.2011 um 20:33 schrieb Pablo Rodríguez: Hi there, I want to be a \startlines... \stoplines environment to be 10cm away from the left margin. I know this is a basic question, but I have no idea how to do it. As the lines environment has no margin keys you need the narrower environment to increase the left margin. \definenarrower[narrowlines][left=10cm] \setuplines [before={\startnarrowlines[left]}, after=\stopnarrowlines] \starttext \showframe \startlines One Two Three \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] processing style inside verbatim in XML
On 21-10-2011 22:18, Mojca Miklavec wrote: Hello, Is there any simple way to typeset the following example properly in ConTeXt? I have an example of text that has to obey lines and spaces, but I would like to apply some color to make it more readable. The attachment contains an example of HTML which displays fine in my browser, and it should look similar with ConTeXt. I have problems with literal typesetting ofspan class=... (that should have applied style instead), but maybe I only have wrong settings in my parser. When I use \xmlsetfunction{main}{pre}{lxml.displayverbatim}, then I cannot color the numbers. When I use, according to Wolfgang's suggestion, \startxmlsetups pre \setuplines[style=mono,space=yes] \startlines \xmlflush{#1} \stoplines \stopxmlsetups then all the spaces are eaten up by XML parser (or somewhere else), so that I don't get the desired result. Any ideas about this? I'm also sending a self-contained example with \setuplines which doesn't really work in the desired way. The next beta will provide two extra flushers. The following patch to your example seems to work ok then. \startxmlsetups all:html \xmlsetsetup{main}{head|h1|pre|span}{*} \stopxmlsetups \xmlmapval{span}{n}{\bf\red} \startxmlsetups span \start \xmlval{span}{\xmlatt{#1}{class}}{} \xmlflush{#1} \stop \stopxmlsetups \startxmlsetups pre \start \tttf %\xmlflush{#1} %\xmlflushlinewise{#1} \xmlflushspacewise{#1} \stop \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] Standardmakeup
Thank you Wolfgang. I do not remember but there was a time where \godown would not work without the strut. So I have mistaken this. And indeed the result is ok whithout the start- stoplines. Thanks! Willi On 20 Oct 2011, at 15:42, Wolfgang Schuster wrote: Am 19.10.2011 um 22:03 schrieb Willi Egger: Hi, Hans told me, that one needs to set before and after for the lines to nil. Indeed that solves the problem as long as you do not want to insert extra white space between the lines. The effect of moving down the lines occurs also with inserting an empty line. Add \vfill before \stopstandardmakeup. \setupmakeup[standard][top=,bottom=] \setuplines[before=,after=] \starttext \startstandardmakeup[doublesided=no,page=yes] \strut \godown[.25\textheight] \startalignment[middle] \startlines {\bfd Der Titel} \blank[line] {\bf De Untertitel} \stoplines \stopalignment \stopstandardmakeup \stoptext You don’t need the lines environment because with the blank you get two separate lines and the \strut is a bad idea because you get at the top a extra line with the command. \startstandardmakeup[doublesided=no,align=middle,page=yes] \godown[.25\textheight] {\bfd Der Titel} \blank[line] {\bf De Untertitel} \vfill \stopstandardmakeup Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] processing style inside verbatim in XML
Hello, Is there any simple way to typeset the following example properly in ConTeXt? I have an example of text that has to obey lines and spaces, but I would like to apply some color to make it more readable. The attachment contains an example of HTML which displays fine in my browser, and it should look similar with ConTeXt. I have problems with literal typesetting of span class=... (that should have applied style instead), but maybe I only have wrong settings in my parser. When I use \xmlsetfunction{main}{pre}{lxml.displayverbatim}, then I cannot color the numbers. When I use, according to Wolfgang's suggestion, \startxmlsetups pre \setuplines[style=mono,space=yes] \startlines \xmlflush{#1} \stoplines \stopxmlsetups then all the spaces are eaten up by XML parser (or somewhere else), so that I don't get the desired result. Any ideas about this? I'm also sending a self-contained example with \setuplines which doesn't really work in the desired way. Thank you very much, Mojca . h y p h e n a t i o n . - 1n a 1t i o 2i o h e2n h e n5a t h e n a4 h y3p h n2a t o2n - . h y3p h e2n5a4t2i o2n. hyp.tex Description: TeX document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Standardmakeup
Am 19.10.2011 um 22:03 schrieb Willi Egger: Hi, Hans told me, that one needs to set before and after for the lines to nil. Indeed that solves the problem as long as you do not want to insert extra white space between the lines. The effect of moving down the lines occurs also with inserting an empty line. Add \vfill before \stopstandardmakeup. \setupmakeup[standard][top=,bottom=] \setuplines[before=,after=] \starttext \startstandardmakeup[doublesided=no,page=yes] \strut \godown[.25\textheight] \startalignment[middle] \startlines {\bfd Der Titel} \blank[line] {\bf De Untertitel} \stoplines \stopalignment \stopstandardmakeup \stoptext You don’t need the lines environment because with the blank you get two separate lines and the \strut is a bad idea because you get at the top a extra line with the command. \startstandardmakeup[doublesided=no,align=middle,page=yes] \godown[.25\textheight] {\bfd Der Titel} \blank[line] {\bf De Untertitel} \vfill \stopstandardmakeup 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] Standardmakeup
Hi, Hans told me, that one needs to set before and after for the lines to nil. Indeed that solves the problem as long as you do not want to insert extra white space between the lines. The effect of moving down the lines occurs also with inserting an empty line. \setupmakeup[standard][top=,bottom=] \setuplines[before=,after=] \starttext \startstandardmakeup[doublesided=no,page=yes] \strut \godown[.25\textheight] \startalignment[middle] \startlines {\bfd Der Titel} \blank[line] {\bf De Untertitel} \stoplines \stopalignment \stopstandardmakeup \stoptext Willi On 19 Oct 2011, at 19:54, Wolfgang Schuster wrote: Am 19.10.2011 um 17:05 schrieb Willi Egger: Hi, When using the \startstandardmakeup ... \stopstandardmakeup the text gets vertically centered on the page. Normally \setupmakeup[standard][top=,bottom=] would produce the text vertically aligned normally. However in the beta of today \setupmakeup[standard][top=,bottom=] has no effect and the text is aligned vertically centered. - Do I miss something? Make a example, I can’t reproduce your mentioned results. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Spurious space when using space=on with \startlines
Hi, \startlines with the space=on option produces a spurious space. Is that intended? I don't see a reason to introduce a space. \setuplines [style=mono] \starttext % for whatever \startlines for {\it whatever} \stoplines % for whatever \startlines [space=on] for {\it whatever} \stoplines % Workaround % for whatever \startlines [space=on] for {\it{}whatever} % or for{\it whatever} \stoplines \stoptext Regards Marco Patzer ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] Spurious space when using space=on with \startlines
Am 16.10.2011 um 16:31 schrieb Marco: Hi, \startlines with the space=on option produces a spurious space. Is that intended? I don't see a reason to introduce a space. \setuplines [style=mono] \starttext % for whatever \startlines for {\it whatever} \stoplines % for whatever \startlines [space=on] for {\it whatever} for \italic{whatever} You can use the commands \italic, \bold etc. which accept the text as argument or you can define your own commands with \definehighlight or \definestyle which will then also accept a argument like \italic above. 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] \crlf breaks alignment inheritance
Am 26.05.2011 um 16:02 schrieb Marco Pessotto: So what's the correct way to force a line break without starting a new paragraph, like \\ in LaTeX? Maybe the paragraph is marked also by more spacing, and that particular linebreak is not meant to be a paragraph ending. Like, e.g., for poems. And I believed the \crlf was the correct way to do it. Please correct me if I'm wrong. To suppress whitespace between paragraph you can use the packed environment. For poems i suggest to use the lines environment where the end of each line is also the end of a paragraph, you can also change the alignment of the content with the align key of the environment, e.g. \startlines[align=middle] … \stoplines or change the settings global (i.e. \setuplines[align=middle]). 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] \crlf breaks alignment inheritance
Wolfgang Schuster schuster.wolfg...@googlemail.com writes: Am 26.05.2011 um 16:02 schrieb Marco Pessotto: So what's the correct way to force a line break without starting a new paragraph, like \\ in LaTeX? Maybe the paragraph is marked also by more spacing, and that particular linebreak is not meant to be a paragraph ending. Like, e.g., for poems. And I believed the \crlf was the correct way to do it. Please correct me if I'm wrong. To suppress whitespace between paragraph you can use the packed environment. For poems i suggest to use the lines environment where the end of each line is also the end of a paragraph, you can also change the alignment of the content with the align key of the environment, e.g. \startlines[align=middle] … \stoplines or change the settings global (i.e. \setuplines[align=middle]). Wolfgang Ok, thanks for your answers. -- 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] Why do \startlines and \crlf give different results in this example?
Am 12.03.2011 um 05:48 schrieb mathew: % First request no space before \setuplines[before=\nowhitespace,after=\nowhitespace] % Now use startlines... \framed[width=fit,align=right]{\startlines One Two Three\stoplines} \framed [width=fit,align=right,strut=no] {\startlines[before=,after=] One Two Three \stoplines} % ...then compare with \crlf. \framed[width=fit,align=right]{One\crlf Two\crlf Three} \framed [width=fit,align=right] {One\\Two\\Three} 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] Why do \startlines and \crlf give different results in this example?
% First request no space before \setuplines[before=\nowhitespace,after=\nowhitespace] % Now use startlines... \framed[width=fit,align=right]{\startlines One Two Three\stoplines} % ...then compare with \crlf. \framed[width=fit,align=right]{One\crlf Two\crlf Three} Why do these give different results, and how do I make the former behave like the latter? mathew -- URL:http://www.pobox.com/~meta/ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] HOWTO: Typesetting Poetry in ConTeXt
Am 16.09.2010 um 01:12 schrieb Aditya Mahajan: On Wed, 15 Sep 2010, John Haltiwanger wrote: In general though, it is completely unnecessary, as poetry generally has no need to be defined in macros. But it's the edge cases, where I live :) On the contrary, typesetting poerty can be very tricky. This is what I did once to typeset the divine comedy. Don't ask how I figured out the right value of the inbetween key :) \setupindenting [medium,yes] \setuplines[inbetween={\crlf\par\setupindenting[next]\testpage[3]},indenting=next] You don’t need \testpage to keep the lines together, with the “option=packed” setting there won’t happen a linebreak between the text but the ”preference” keyword for \blank allows one. \setuplines [option=packed, inbetween={\blank[preference,line]\setupindenting[next]}, indenting=next] 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] \setuplines[space=on] (was: HOWTO: Typesetting Poetry in ConTeXt)
On 2010-09-15 22:26:38, John Haltiwanger wrote: Apologies, as a very significant aspect of this process was omitted in the previous email! Don't forget to do: \setuplines[space=on] Hi all, I'm sorry to hijack the thread but I have trouble understanding how the [space=on] works. In the following example: ···8 \setuplines[space=on] \starttext \startlines A one, two, a one two three four Half a {\em{bee}}, philosophically, must, ipso facto, half not be. But half the bee has got to be, vis a vis its entity. {\bf D'you see}? But can a {\em bee} be said to be or not to be an entire bee, when half the bee is {\em{}not a bee}, due to some ancient injury? \stoplines \stoptext ···8 the spaces after the formatting commands “\em” and “\bf” are respected unless the following token starts a group. Is this working as expected? Another question: How can I reproduce MkII's behaviour of indicating the spaces in MkIV? Thanks for the help, Philipp Btw, @John: thanks for your additions to the \[start|stop]lines wiki page, I just had need for the command for the first time and it's a good intro. first! On Wed, Sep 15, 2010 at 9:45 AM, John Haltiwanger john.haltiwan...@gmail.com wrote: I thought I'd give the mailing list a small change of pace---instead of asking how to do it, I will show you :) The short answer is: \starttext My Concrete Poem \startlines All the whitespace will print ! \stoplines \stoptext However, \startlines..\stoplines is not available when defining a macro. I've documented the solution to this situation on my blog: http://drippingdigital.com/blog/2010/09/typesetting-poetry-in-context/ Thanks to Wolfgang Schuster for helping me work it out! ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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 pgpHr5YwXnndX.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] HOWTO: Typesetting Poetry in ConTeXt
Apologies, as a very significant aspect of this process was omitted in the previous email! Don't forget to do: \setuplines[space=on] first! On Wed, Sep 15, 2010 at 9:45 AM, John Haltiwanger john.haltiwan...@gmail.com wrote: I thought I'd give the mailing list a small change of pace---instead of asking how to do it, I will show you :) The short answer is: \starttext My Concrete Poem \startlines All the whitespace will print ! \stoplines \stoptext However, \startlines..\stoplines is not available when defining a macro. I've documented the solution to this situation on my blog: http://drippingdigital.com/blog/2010/09/typesetting-poetry-in-context/ Thanks to Wolfgang Schuster for helping me work it out! ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] HOWTO: Typesetting Poetry in ConTeXt
On Wed, 15 Sep 2010, John Haltiwanger wrote: Apologies, as a very significant aspect of this process was omitted in the previous email! Don't forget to do: \setuplines[space=on] first! On Wed, Sep 15, 2010 at 9:45 AM, John Haltiwanger john.haltiwan...@gmail.com wrote: I thought I'd give the mailing list a small change of pace---instead of asking how to do it, I will show you :) The short answer is: \starttext My Concrete Poem \startlines All the whitespace will print ! \stoplines \stoptext However, \startlines..\stoplines is not available when defining a macro. What do you mean by that these macros are not available? Doesn't the following work? (untested, but I will be really surprised if it doesn't work) \def\startpoety {\startlines % All the remaining setup } \def\stoppoety {%whatever setup you want \stoplines} 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] HOWTO: Typesetting Poetry in ConTeXt
I don't usually define macros like that (isn't that more of a \definestartstop kind of deal?). On Wed, Sep 15, 2010 at 10:38 PM, Aditya Mahajan adit...@umich.edu wrote: On Wed, 15 Sep 2010, John Haltiwanger wrote: Apologies, as a very significant aspect of this process was omitted in the previous email! Don't forget to do: \setuplines[space=on] first! On Wed, Sep 15, 2010 at 9:45 AM, John Haltiwanger john.haltiwan...@gmail.com wrote: I thought I'd give the mailing list a small change of pace---instead of asking how to do it, I will show you :) The short answer is: \starttext My Concrete Poem \startlines All the whitespace will print ! \stoplines \stoptext However, \startlines..\stoplines is not available when defining a macro. What do you mean by that these macros are not available? Doesn't the following work? (untested, but I will be really surprised if it doesn't work) \def\startpoety {\startlines % All the remaining setup } \def\stoppoety {%whatever setup you want \stoplines} 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 ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] HOWTO: Typesetting Poetry in ConTeXt
On Wed, 15 Sep 2010, John Haltiwanger wrote: In general though, it is completely unnecessary, as poetry generally has no need to be defined in macros. But it's the edge cases, where I live :) On the contrary, typesetting poerty can be very tricky. This is what I did once to typeset the divine comedy. Don't ask how I figured out the right value of the inbetween key :) \setupindenting [medium,yes] \setuplines[inbetween={\crlf\par\setupindenting[next]\testpage[3]},indenting=next] \starttext \startlines Midway upon the journey of our life I found myself within a forest dark, For the straightforward pathway had been lost. Ah me! how hard a thing it is to say What was this forest savage, rough, and stern, Which in the very thought renews the fear. So bitter is it, death is little more; But of the good to treat, which there I found, Speak will I of the other things I saw there. I cannot well repeat how there I entered, So full was I of slumber at the moment In which I had abandoned the true way. But after I had reached a mountain's foot, At that point where the valley terminated, Which had with consternation pierced my heart, ... \stoplines \stoptext Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] HOWTO: Typesetting Poetry in ConTeXt
On Wed, Sep 15, 2010 at 11:12 PM, Aditya Mahajan adit...@umich.edu wrote: On Wed, 15 Sep 2010, John Haltiwanger wrote: In general though, it is completely unnecessary, as poetry generally has no need to be defined in macros. But it's the edge cases, where I live :) On the contrary, typesetting poerty can be very tricky. This is what I did once to typeset the divine comedy. Don't ask how I figured out the right value of the inbetween key :) \setupindenting [medium,yes] \setuplines[inbetween={\crlf\par\setupindenting[next]\testpage[3]},indenting=next] \starttext \startlines Midway upon the journey of our life I found myself within a forest dark, For the straightforward pathway had been lost. Ah me! how hard a thing it is to say What was this forest savage, rough, and stern, Which in the very thought renews the fear. So bitter is it, death is little more; But of the good to treat, which there I found, Speak will I of the other things I saw there. I cannot well repeat how there I entered, So full was I of slumber at the moment In which I had abandoned the true way. But after I had reached a mountain's foot, At that point where the valley terminated, Which had with consternation pierced my heart, ... \stoplines \stoptext Yes, but this is an example of what I am saying: in general \startlines..\stoplines is enough (albeit here with some extra stuff integrated into \setuplines[inbetween=]). It seems to me that pretty much only if you are doing something generative would you need to worry about the specifics of buffers and defining macros for typesetting poetry (as was my case with writing a dedication page in a pandoc template). No \startpoem..\stoppoem, or even \poem (though now I am having some nice ideas for weird poetry.. as I said, I spend a lot of time with edge cases ;) Interestingly, this conversation has cleared up a few lingering details in my mind re: ConTeXt. Maybe a poetry typesetting tutorial is a worthy way to explain some key concepts? I'd be really curious to see your edition of the Inferno, by the way. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] table, setuptable, TWO
Hello, in the following example (context iv): 1. \setuptable[rulethickness=0.04em] does not work 2. i wish that \NC 1 \NC \NC WOULD be something like \NC \TWO \center{1} \NC ? - \enableregime[utf] \setupindenting[yes, 3mm] \setupwhitespace[6mm] \mainlanguage[fr] \setupbodyfont[sansserif, 12pt] \definepapersize[monpapier][width=210mm, height=297mm] \definebodyfont[10pt][tt][bf=cmbtt10] \setuplines[space=on] \setupheadertexts[chapter] \setuppagenumbering[alternative=doublesided,location={footer,inleft}, command=\inframed] \language[fr] \setuphead[chapter][page=no, textstyle=cap, numberstyle=bold, after={\blank\hrule\blank}] \setuphead[title][after={\blank\hrule\blank}] \starttext \setupinterlinespace[line=1.1ex] [...] \subject{Sequences} {\setupinterlinespace[line=3ex]\midaligned \setuptable[rulethickness=0.04em] % = \starttable[|r|r|r|l|r|r|r|r|r|r|r|r|] \HL \NC n \NC \bf temps \NC \bf min:sec \NC \bf genre \NC 1 \NC \NC 2 \NC \NC 3 \NC \NC 4 \NC \SR % == \HL \NC 0\NC 0\NC 0: 0\NC venter1 \NC 1\NC 9 \NC 1 \NC 9 \NC 1 \NC 9 \NC 1\NC 9 \FR \NC 1\NC 80\NC 1:20\NC ad lib.\NC \NC \NC \NC \NC \NC \NC \NC \MR \NC 21\NC 1180\NC 19:40\NC FIN\NC \LR \stoptable } \stoptext -- René Bastian www.pythoneon.org www.musiques-rb.org http://www.soundsurvey.org.uk/ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] table, setuptable, TWO
Am 20.04.10 11:39, schrieb R. Bastian: Hello, in the following example (context iv): 1. \setuptable[rulethickness=0.04em] does not work \setuptables[...] 2. i wish that \NC 1 \NC \NC WOULD be something like \NC \TWO \center{1} \NC \NC \TWO \ReFormat[c]{1} \NC ? \enableregime[utf] \setupindenting[yes, 3mm] \setupwhitespace[6mm] \mainlanguage[fr] \setupbodyfont[sansserif, 12pt] \definepapersize[monpapier][width=210mm, height=297mm] \definebodyfont[10pt][tt][bf=cmbtt10] \setuplines[space=on] \setupheadertexts[chapter] \setuppagenumbering[alternative=doublesided,location={footer,inleft}, command=\inframed] \language[fr] \setuphead[chapter][page=no, textstyle=cap, numberstyle=bold, after={\blank\hrule\blank}] \setuphead[title][after={\blank\hrule\blank}] is this setup in any way relevant for you example? \starttext \setupinterlinespace[line=1.1ex] [...] \subject{Sequences} {\setupinterlinespace[line=3ex]\midaligned \midaligned {... \starttable ... \stoptable} or \placetable[force,none]{} {... \starttable ... \stoptable} 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] table: vertical distance
Am 17.04.10 11:35, schrieb Wolfgang Werners-Lucchini: Hallo, I have to typeset a division and have two diverent solutions but they both have problems. \setuplines[style=type] \startlines 110011:11=10001 11 ... ~0 \stoplines \stoptext \setuplines[style=type,space=on] \startlines \formula{\tt 110011:11=10001} 11 -- 00 00 -- 00 00 -- 01 00 -- 11 11 -- 0 \stoplines You can also look at the xlop package http://ctan.org/tex-archive/macros/generic/xlop/ 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] code
On Fri, 09 Apr 2010 12:00:05 +0200 Wolfgang Schuster schuster.wolfg...@googlemail.com scribit: Am 09.04.10 11:20, schrieb R. Bastian: Hello, how to translate in context the following plain tex: \font\fgras = cmbtt10 {\tt {\obeylines {\fgras def} ra(): \ \ \ \ a = 3 \ \ \ \ b = 4 } } MkII: \setuplines[space=on] \starttext \startlines\tt %\startlines[style=mono] % works only in MkIV {\bf def} ra(): a = 3 b = 4 \stoplines \stoptext Wolfgang ___ 1. I use 'context -result=y source.tex'; is this mkii or mkiv ? (mkii seems to be an optional flag) 2. what is the Context font for cmitt10 ? -- René Bastian www.pythoneon.org www.musiques-rb.org http://www.soundsurvey.org.uk/ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] code
On Fri, 16 Apr 2010 11:31:00 +0200 R. Bastian rbast...@free.fr scribit: On Fri, 09 Apr 2010 12:00:05 +0200 Wolfgang Schuster schuster.wolfg...@googlemail.com scribit: Am 09.04.10 11:20, schrieb R. Bastian: Hello, how to translate in context the following plain tex: \font\fgras = cmbtt10 {\tt {\obeylines {\fgras def} ra(): \ \ \ \ a = 3 \ \ \ \ b = 4 } } MkII: \setuplines[space=on] \starttext \startlines\tt %\startlines[style=mono] % works only in MkIV {\bf def} ra(): a = 3 b = 4 \stoplines \stoptext Wolfgang ___ 1. I use 'context -result=y source.tex'; is this mkii or mkiv ? (mkii seems to be an optional flag) 2. what is the Context font for cmitt10 ? {\it{} ...} works - but i would the same as \bold{} -- René Bastian www.pythoneon.org www.musiques-rb.org http://www.soundsurvey.org.uk/ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- René Bastian www.pythoneon.org www.musiques-rb.org http://www.soundsurvey.org.uk/ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] code
On Fri, 09 Apr 2010 12:00:05 +0200 Wolfgang Schuster schuster.wolfg...@googlemail.com scribit: \setuplines[space=on] \starttext \startlines\tt %\startlines[style=mono] % works only in MkIV compiled by context (== mak iv ?) \startlines[style=mono] prints [style=mono] {\bf def} ra(): a = 3 b = 4 \stoplines \stoptext Wolfgang - the sign | (vertical bar) seems to be a special char (context/mkiv) it is only compiled if present in pairs | text | the message: File ended while use of \next \type{|} works - -- René Bastian www.pythoneon.org www.musiques-rb.org http://www.soundsurvey.org.uk/ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] code
Am 09.04.10 11:20, schrieb R. Bastian: Hello, how to translate in context the following plain tex: \font\fgras = cmbtt10 {\tt {\obeylines {\fgras def} ra(): \ \ \ \ a = 3 \ \ \ \ b = 4 } } MkII: \setuplines[space=on] \starttext \startlines\tt %\startlines[style=mono] % works only in MkIV {\bf def} ra(): a = 3 b = 4 \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] code
On Fri, 09 Apr 2010 12:00:05 +0200 Wolfgang Schuster schuster.wolfg...@googlemail.com scribit: Am 09.04.10 11:20, schrieb R. Bastian: Hello, how to translate in context the following plain tex: \font\fgras = cmbtt10 {\tt {\obeylines {\fgras def} ra(): \ \ \ \ a = 3 \ \ \ \ b = 4 } } MkII: \setuplines[space=on] \starttext \startlines\tt %\startlines[style=mono] % works only in MkIV {\bf def} ra(): a = 3 b = 4 \stoplines \stoptext Wolfgang Thanks Wolfhang. It goes better, but there is still a little bug: {\bf def} inserts a white space in front of the line Compare: {\bf def} ra(): def ra(): a = 3 b = 4 -- René Bastian www.pythoneon.org www.musiques-rb.org http://www.soundsurvey.org.uk/ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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] code
On Fri, Apr 09 2010, R. Bastian wrote: but remains that every {\bf } introduces a white space; how to force context to make a backspace ? \setuplines[space=on] \starttext \startlines[style=mono] {\bf{}def} ra(): a = 3 b = 4 \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] code
On Fri, Apr 9, 2010 at 5:24 PM, Peter Münster pmli...@free.fr wrote: On Fri, Apr 09 2010, R. Bastian wrote: but remains that every {\bf } introduces a white space; how to force context to make a backspace ? \setuplines[space=on] \starttext \startlines[style=mono] {\bf{}def} ra(): a = 3 b = 4 \stoplines \stoptext Cheers, Peter I'm not able to see any white space in mkiv \showframe \starttext \font\fgras = lmmonolt10-bold.otf at 12pt \ruledvbox{\tt\setupinterlinespace[line=1ex] {\obeylines {\fgras def} ra(): \ \ \ \ a = 3 \ \ \ \ b = 4 \vskip1\lineheight {\fgras def} ra(): \ \ \ \ a = 3 \ \ \ \ b = 4 } } \stoptext -- luigi ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] code
On Fri, Apr 09 2010, luigi scarso wrote: On Fri, Apr 09 2010, R. Bastian wrote: but remains that every {\bf } introduces a white space; I'm not able to see any white space in mkiv Bastian refers to Wolfgang's solution with \setuplines[space=on]. 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] Hanging indent in startstoplines for poems
Hello, thanks for the help, attached snippet seems to work. So I guess my question basicly was caused by misunderstandings in using define/setup commands. Is there a document describing the grammar of context---how to use or to combine \setupsomething, \definesomething ttartstosomethig or \setupanything{something=[]}? Wolfgang Schuster wrote: % style={\setupalign[flushleft,nothyphenated]}, style={\raggedright\nohyphens}, Sorry for stupid question, but is there a difference between \nohyphens and \nothyphenated ? Thanks Torsten %- snip -- \setupoutput[dvi] \setupwhitespace[1.2em] \definestartstop[verse] [command={% \setupwhitespace[1.2em]% },style={% \raggedright\nohyphens% },before={% \setuplines[indenting={yes,-2em,first}]% \setupnarrower[left=2em]% \startnarrower[left]% blockindent only left \startlines% },after={% \stoplines% \stopnarrower% \setuplines[indenting={no}]% must be reseted \endgraf% }] \starttext Three lines, first should be broken: \startverse FIRST---this should be one line, please remove linebreaks, made by the mail programms, until HERE. SECOND---next line without carriage return or line feed, THIRD---startstoplines accept linebreaks, so this is a new line. FOURTH---fourth line also do not make much words. \stopverse \stoptext %- snip -- ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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 Text with Embedded Formatting Commands (MkIV)
Am 13.12.2009 um 12:26 schrieb Tad Ashlock: As noted at http://wiki.contextgarden.net/Verbatim_text#Embedded_formatting_commands, the embedded formatting commands in verbatim text don't work in MkIV. Are there any plans to fix this capability soon? I'm planning on working on a project on over the holiday break that will need it. I'm not pushing to change your priorities. If it's not going to be fixed soon, then I'll implement a simple verbatim module that supports embedded formatting commands that will do until the official module works. I just don't want to waste that effort if verbatim is going to be fixed soon anyway. When you don't need syntax highlighting you can use \startlines \setuplines[space=on] \startlines\tt IF A==B THEN do this ELSE do that END \stoplines 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] \starbuffer in own macros
Am 19.10.2009 um 00:50 schrieb Wolfgang Schuster:Am 18.10.2009 um 12:02 schrieb Andreas Harder:Before I help you provide us with more information, e.g. should the text in the bufferappear also in the complete text or do you it only in the snippet?Sorry, that I did not make myself clear. The real setup is: I've a lot of line numbered text in the appendix of the document. In the body I'd like to cite out of it (with the same line numbers as in the source/appendix). The appendix should stay unchanged.For the beginning you can play with this code, it has to be changedin a few parts (e.g. make \setuplines local) but it's what I can readfrom your description above and the code you showed in the previous message.Thank you very much for your help!I adapted your solution and it works as intended.There is an inherent "problem" as one can see in the attachment, but since mostly I cite a whole paragraph it's not a real problem. I think therefore you used the lines-environment? test-linenumbering6.tex Description: Binary data Again many thanks! 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] \starbuffer in own macros
Am 18.10.2009 um 12:02 schrieb Andreas Harder: Before I help you provide us with more information, e.g. should the text in the buffer appear also in the complete text or do you it only in the snippet? Sorry, that I did not make myself clear. The real setup is: I've a lot of line numbered text in the appendix of the document. In the body I'd like to cite out of it (with the same line numbers as in the source/appendix). The appendix should stay unchanged. For the beginning you can play with this code, it has to be changed in a few parts (e.g. make \setuplines local) but it's what I can read from your description above and the code you showed in the previous message. \def\doifelsesamelinereference#1#2#3% {\doifreferencefoundelse{lr:b:#1} {\edef\fline{\currentreferencedefault}% was \currentreferencetext \doifreferencefoundelse{lr:e:#1} {\edef\tline{\currentreferencedefault}% was \currentreferencetext \ifx\fline\tline#2\else#3\fi} {\unknownreference{#1}#2}} {\unknownreference{#1}#2}} \def\startMyCite[#1]% {\def\stopMyCite {\setuplines[before=,after=]% \startlines\startline[#1]\getbuffer[#1]\stopline[#1]\stoplines \savebuffer[#1]}% \dostartbuffer[#1][startMyCite][stopMyCite]} \def\getMyCite[#1]% {\doifreferencefoundelse{lr:b:#1} {\startlinenumbering[\currentreferencedefault]} \startlinenumbering \startlines\readfile{\jobname-#1.tmp}{}{}\stoplines \stoplinenumbering} \starttext \startbodymatter test text test text test text test text test text test text test text test text test text test text test text test text test text she told: \getMyCite[test] % perhaps better \getMyCite[test] test text test text test text test text test text test text test text test text test text test text test text test text test text \stopbodymatter \startappendices \startlinenumbering We thrive in information--thick worlds because of our marvelous and everyday ca- pacity to select, edit, single out, structure, highlight, group, pair, merge, harmo- nize, synthesize, focus, \startMyCite[test] organize, condense, reduce, boil down, choose, categorize, catalog, classify, list, abstract, scan, look into, idealize, isolate, discriminate, dis- tinguish, screen, pigeonhole, pick over, sort, integrate, blend, inspect, filter, lump, skip, smooth, chunk, average, approximate, cluster, aggregate, outline, summarize, itemize, review, dip into, flip through, browse, glance into, leaf through, \stopMyCite skim, re- fine, enumerate, glean, synopsize, winnow the wheat from the chaff and separate the sheep from the goats. \stoplinenumbering \stopappendices \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] startlines
Hi Hans, here is a new attempt to get a more generalized version of the startlines macros, now mkiv only. Wolfgang \unprotect \def\linesparameter #1{\csname\dolinesparameter{\??rg\@@lines} #1\endcsname} \def\dolinesparameter #1#2{\ifcsname#1#2\endcsname#1#2\else \expandafter\dolinesparentparameter\csname#1\s!parent\endcsname#2\fi} \def\dolinesparentparameter#1#2{\ifx#1\relax\s!empty\else \dolinesparameter#1#2\fi} \getparameters [\??rg] [\c!option=, \c!before=\blank, \c!after=\blank, \c!inbetween=\blank, \c!indenting=\v!no, \c!space=\v!default] \def\definelines {\dodoubleempty\dodefinelines} \def\dodefinelines[#1][#2]% {\getparameters[\??rg#1][\s!parent=\??rg,#2]% \setvalue{\e!start#1}{\dostartlines[#1]}% \setvalue{\e!stop #1}{\dostoplines}} \def\setuplines {\dodoubleempty\dosetuplines} \def\dosetuplines[#1][#2]% {\doifelsenothing{#2} {\getparameters[\??rg][#1]} {\def\docommand##1{\getparameters[\??rg##1][#2]}% \processcommacommand[#1]\docommand}} \def\dostartlines[#1]% {\bgroup \edef\@@lines{#1}% \linesparameter\c!before \pushmacro\checkindentation \whitespace \begingroup \setupindenting[\linesparameter\c!indenting]% \typesettinglinestrue \setupwhitespace[\v!none]% \obeylines \ignorespaces \gdef\afterfirstobeyedline % tzt two pass, net als opsomming {\gdef\afterfirstobeyedline {\nobreak \doifnot{\linesparameter\c!option}\v!packed{\global\let \afterfirstobeyedline\relax}}}% \def\obeyedline {\par \futurelet\next\dobetweenthelines}% \activatespacehandler{\linesparameter\c!space}% \GotoPar} \def\dostoplines {\endgroup \popmacro\checkindentation \linesparameter\c!after \egroup} \def\dobetweenthelines {\doifmeaningelse\next\obeyedline {\linesparameter\c!inbetween} {\afterfirstobeyedline}} \definelines[\v!lines] \protect \definelines[verse][before={\blank[3*line]},after={\blank[3*line]}] \starttext line 1 \startlines line 2 line 3 \stoplines line 4 \startverse line 5 line 6 \stopverse line 7 \startlines line 8 line 9 \stoplines \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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] verses together
Ciro Soto wrote: I am writing a book with poems and need to maintain four, sometimes five, lines together in the same page. I don't know in advance which four lines will be split at the end of the page. How would I implement this? Using \testpage[n] works, only if I know in advance where the the split happens. add this to your local cont-new.tex file (after \protect): \def\startlines {\@@rgbefore \pushmacro\checkindentation \whitespace %\page[\v!preference]} gaat mis na koppen, nieuw: later \nobreak \begingroup \setupindenting[\@@rgindenting]% \typesettinglinestrue \setupwhitespace[\v!none]% \obeylines \ignorespaces \gdef\afterfirstobeyedline % tzt two pass, net als opsomming {\gdef\afterfirstobeyedline {\nobreak \doifnot\@@rgoption\v!packed{\global\let\afterfirstobeyedline\relax}}}% \def\obeyedline {\par \futurelet\next\dobetweenthelines}% \activatespacehandler\@@rgspace \GotoPar} \def\dobetweenthelines {\doifmeaningelse\next\obeyedline {\@@rginbetween} {\afterfirstobeyedline}} \setuplines [\c!option=, \c!before=\blank, \c!after=\blank, \c!inbetween=\blank, \c!indenting=\v!no, \c!space=\v!default] -- -- -- -- test: (the packed option is new) \setuplines[indenting={yes,medium,odd},option=packed] % no yes odd even \starttext \dorecurse{33}{test\par} \startlines first second third fourth first second third fourth first second third fourth first second third fourth \stoplines \stoptext - 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] looking for equivalence to LaTeX algorithm package
On Sun, Nov 30, 2008 at 5:09 PM, Zhaopeng Xing [EMAIL PROTECTED] wrote: Hi, Does anyone know how to describe algorithm procedures in similar way as LaTeX algorithmic and algorithm packages? I tried to search it on wiki but found nothing. Thanks. \starttext \setuplines[space=yes] \startlines $sum \leftarrow 0$ \bold{for} $i \leftarrow 1,n$ \bold{do} $sum \leftarrow sum + i$ \bold{end for} \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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] looking for equivalence to LaTeX algorithm package
Thank you, Walfgang. I will try. It is a good exercise. 2008/12/1 Wolfgang Schuster [EMAIL PROTECTED] On Sun, Nov 30, 2008 at 5:09 PM, Zhaopeng Xing [EMAIL PROTECTED] wrote: Hi, Does anyone know how to describe algorithm procedures in similar way as LaTeX algorithmic and algorithm packages? I tried to search it on wiki but found nothing. Thanks. \starttext \setuplines[space=yes] \startlines $sum \leftarrow 0$ \bold{for} $i \leftarrow 1,n$ \bold{do} $sum \leftarrow sum + i$ \bold{end for} \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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- Zhaopeng XING Tinbergen Institute ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] looking for equivalence to LaTeX algorithm package
Am 30.11.2008 um 17:09 schrieb Zhaopeng Xing: Hi, Does anyone know how to describe algorithm procedures in similar way as LaTeX algorithmic and algorithm packages? I tried to search it on wiki but found nothing. Thanks. Feel free to write your own module. \definefloat[algorithm][algorithms] \definestartstop [algorithm] [before=\startlines, after=\stoplines, commands=\directsetup{algorithm}] \startsetups algorithm \def\STATE {\hskip1em} \def\REQUIRE {{\bf Require: }} \def\ENSURE{{\bf Ensure: }} \def\IF ##1{\bgroup\doadaptleftskip{1em}{\bf if} ##1 {\bf then}} \def\ENDIF {{\bf end if}\par\egroup} \def\WHILE ##1{\bgroup\doadaptleftskip{1em}{\bf while} ##1 {\bf do}} \def\ENDWHILE {{\bf end while}\par\egroup} \definecomplexorsimple\ELSE \def\simpleELSE {{\bf else}} \def\complexELSE[##1]{{\bf else} $//$ ##1} \stopsetups %\setuplines[before=,after=] \starttext \startbuffer[algorithm] \startalgorithm \REQUIRE $n \geq 0 \vee x \neq 0$ \ENSURE $y = x^n$ \STATE $y \Leftarrow 1$ \IF{$n 0$} \STATE $X \Leftarrow 1 / x$ \STATE $N \Leftarrow -n$ \ELSE \STATE $X \Leftarrow x$ \STATE $N \Leftarrow n$ \ENDIF \WHILE{$N \neq 0$} \IF{$N$ is even} \STATE $X \Leftarrow X \times X$ \STATE $N \Leftarrow N / 2$ \ELSE[$N$ is odd] \STATE $y \Leftarrow y \times X$ \STATE $N \Leftarrow N - 1$ \ENDIF \ENDWHILE \stopalgorithm \stopbuffer \typebuffer \getbuffer %\placealgorithm % {Calculate $y = x^n$} % {\framed[frame=off,align=right,width=fit,strut=no] {\getbuffer[algorithm]}} \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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt-ifying Kile
# \processaction # \processallactionsinset \processblocks[names][names] # \processcommacommand # \processcommalist # \processfirstactioninset \processpage[names][yes|no] # \processXMLbuffer # \processXMLelement # \processXMLfile # \processXMLfilegrouped # \product \program[name] # \project # \protect \publication[reference] \quotation{text} \quote{text} \ran{text} # \readfile \ref[t|p|r|s|e][reference] \reference[reference]{text} \referral[options] \referraldate \register[text]{register+register+register} \reservefloat[options][text][references]{text} \reset[names] # \resetlayer \resetmarking[name] \rightaligned{text} \Romannumerals{text} \romannumerals{text} \rotate[settings]{text} # \saveXMLasdata # \saveXMLdata # \saveXMLelement # \sbox \scale[options]{text} # \scratchbox # \scratchcounter # \scratchdimen # \scratchskip \screen \section[references]{text} \seeregister[text]{text}{text+text+text} \selectblocks[names][names][critererium] \selectpaper[options] \selectversion # \setcollector # \setevalue # \setevariables # \setflag # \setfontstrut # \setgvalue # \setgvariables # \setlayer # \setlayerframed # \setlocalhsize # \setstrut \settextvariable[name]{text} \setupalign[options] \setuparranging[options] # \setupattachments \setupbackground[options] \setupbackgrounds[position][position][state][settings] \setupblackrules[options] \setupblank[options] \setupblock[names][options] \setupbodyfont[options] \setupbodyfontenvironment[settings][settings] \setupbottom[settings][settings] \setupbottomtexts[text|margin|edge][text|section|date|mark|pagenumber][text|section|date|mark|pagenumber] \setupbuffer[name][options] \setupbuttons[state][settings] \setupcapitals[title=yes|no][sc=yes|no] \setupcaption[name][settings] \setupcaptions[options] \setupclipping[options] \setupcolor[name] \setupcolors[options] \setupcolumns[options] \setupcombinations[options] \setupcombinedlist[name][levels and options] \setupcomment[options] \setupdescriptions[names][options] # \setupencoding \setupenumerations[names][settings] \setupexternalfigures[options] \setupfield[name][label|horizontal|vertical|frame][settings] \setupfields[names][reset|label|horizontal|vertical|frame][options][settings][settings] \setupfillinlines[options] \setupfillinrules[options] \setupfloat[name][options] \setupfloats[options] \setupfloatsplitting[options] # \setupFLOWcharts # \setupFLOWlines # \setupFLOWshapes # \setupfontsynonym \setupfooter[text|margin|edge][options] \setupfootertexts[text|margin|edge][text|section|date|mark|pagenumber][text|section|date|mark|pagenumber] \setupfootnotedefinition[settings] \setupfootnotes[options] \setupforms[method=HTML|FDF] \setupformulae[options] \setupframed[options] \setupframedtexts[options] \setuphead[sections][options] \setupheader[text|margin|edge][options] \setupheadertexts[text|margin|edge][text|section|date|mark|pagenumber][text|section|date|mark|pagenumber] \setupheadnumber[section][number|+number|-number] \setupheads[options] \setupheadtext[language code][name=text] \setuphyphenmark[sign=-|--|---|( )|=|/] \setupindentations[names][options] \setupindenting[none|small|medium|big|next|first|normal|odd|even|dimension] \setupinmargin[left|right|number][options] \setupinteraction[options] \setupinteractionbar[options] \setupinteractionscreen[options] \setupinterlinespace[reset|small|medium|auto|big|on|off][options] \setupitemgroup[name][number|each][options][options] \setupitems[options] \setuplabeltext[language code][name=text] \setuplanguage[language code][settings] # \setuplayer \setuplayout[options] \setuplegend[options] \setuplinenumbering[options] \setuplines[options] \setuplinewidth[dimension] \setuplist[names][options] \setupmakeup[name][options] \setupmarginblocks[options] \setupmarginrules[level=number|rulethickness=dimension] \setupmarking[name][options] \setupnarrower[options] \setupnumbering[options] \setupoppositeplacing[options] \setupoutput[names] \setuppagenumber[number][state=start|stop|keep] \setuppagenumbering[options] \setuppagetransitions[options] \setuppalet[name] \setuppaper[options] \setuppapersize[typesetting papersize][printing papersize] \setupparagraphnumbering[options] \setupparagraphs[name][number|each][options] \setuppositioning[options] \setupprofiles[options] \setupprograms[directory=text] \setuppublications[options] \setupquote[options] \setupreferencelist[names][options] \setupreferencing[options] \setupregister[singular][name][options] \setuprotate[options] \setuprule[name][options] # \setups \setupscreens[options] \setupsection[name][name][options] \setupsectionblock[name][options] \setupsorting[name][options] \setupspacing[broad|packed] \setupstrut[yes|no|cap|text] \setupsubpagenumber[options] \setupsymbolset[name] \setupsynchronization[state=start|stop] \setupsynchronizationbar[options] \setupsynonyms[name][options] \setupsystem[options] \setuptab[options] # \setupTABLE \setuptables[options] \setuptabulate[name][options] \setuptext[text|margin|edge][options
Re: [NTG-context] Semi-verbatim - preserve whitespace - don't escape characters
On Sat, 8 Dec 2007, Wolfgang Schuster wrote: 2007/12/7, [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi. I'm working on a document processor that has multiple backends for different output formats (XHTML, nroff, plain text, ConTeXt). The processor uses s-expression syntax with commands such as: (para this is a paragraph) The various backends then convert this statement in their own way (using p/p tags in XHTML, for example). There is one command that allows rendering of external files based on whatever backend is selected: (render file) The XHTML backend includes file, escaping all 'illegal' characters such as , , etc. The ConTeXt backend reads the file and also escapes characters, placing their TeX equivalent in the output - $\}$, $\backslash$ etc. Both backends place the contents of file directly in the output, they don't, for example, use the object tags in XHTML, or any ConTeXt file inclusion directives. This is desirable for many reasons that are out of scope for this post... The problem I am having is that one may do this: (para-verbatim (render file)) The para-verbatim tag is meant to preserve whitespace in the output. For example, this becomes: precontents of file/pre in the XHTML output. Unfortunately, I've hit a wall when it comes to the ConTeXt equivalent: The ConTeXt backend reads in file and prints it to the output, escaping all reserved TeX characters, as mentioned earlier, but unfortunately there doesn't seem to be the equivalent of: \preservewhitespace contents of file \stoppreservingwhitespace \starttyping is too heavy handed in that it also escapes characters rather than just preserving whitespace (they've already been escaped by my document processor, as mentioned earlier). What I need is a directive that says preserve whitespace but does not escape reserved TeX characters. Does any such thing exist in ConTeXt? Unfortunately, I'm inexperienced with TeX so I don't know how feasible this is. \setuplines[space=yes] followed by \startlines verbatin text \stoplines Note that everything between start-stop lines is normal tex code. 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Semi-verbatim - preserve whitespace - don't escape characters
On Sat, 8 Dec 2007 09:44:52 -0500 (EST) Aditya Mahajan [EMAIL PROTECTED] wrote: On Sat, 8 Dec 2007, Wolfgang Schuster wrote: 2007/12/7, [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi. I'm working on a document processor that has multiple backends for different output formats (XHTML, nroff, plain text, ConTeXt). The processor uses s-expression syntax with commands such as: (para this is a paragraph) The various backends then convert this statement in their own way (using p/p tags in XHTML, for example). There is one command that allows rendering of external files based on whatever backend is selected: (render file) The XHTML backend includes file, escaping all 'illegal' characters such as , , etc. The ConTeXt backend reads the file and also escapes characters, placing their TeX equivalent in the output - $\}$, $\backslash$ etc. Both backends place the contents of file directly in the output, they don't, for example, use the object tags in XHTML, or any ConTeXt file inclusion directives. This is desirable for many reasons that are out of scope for this post... The problem I am having is that one may do this: (para-verbatim (render file)) The para-verbatim tag is meant to preserve whitespace in the output. For example, this becomes: precontents of file/pre in the XHTML output. Unfortunately, I've hit a wall when it comes to the ConTeXt equivalent: The ConTeXt backend reads in file and prints it to the output, escaping all reserved TeX characters, as mentioned earlier, but unfortunately there doesn't seem to be the equivalent of: \preservewhitespace contents of file \stoppreservingwhitespace \starttyping is too heavy handed in that it also escapes characters rather than just preserving whitespace (they've already been escaped by my document processor, as mentioned earlier). What I need is a directive that says preserve whitespace but does not escape reserved TeX characters. Does any such thing exist in ConTeXt? Unfortunately, I'm inexperienced with TeX so I don't know how feasible this is. \setuplines[space=yes] followed by \startlines verbatin text \stoplines Note that everything between start-stop lines is normal tex code. you mean start/stoplines need style and color keys. Aditya 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Whitespace significance without verbatim
On Thu, 29 Nov 2007, Mike Santy wrote: Is there an environment that preserves whitespace (like typing), but still processes \bf \it and other text formatting commands (unlike typing). \setuplines[space=yes] \startlines write what you want {\bf Either bold} or not \stoplines 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] extra spacing between verse and chorus
2007/7/15, Vyatcheslav Yatskovsky [EMAIL PROTECTED]: Hello, Please, help me with the following. The \vbox and \bgroup\egroup tags are intend to keep a verse on a page, but they also add extra spacing (an extra line?) between the verse and chorus. How to get rid of it? \definestartstop [verse] [before=\vbox\bgroup\startlines, after=\stoplines\egroup] \definestartstop [chorus] [before=\startnarrower\startlines, after=\stoplines\stopnarrower] \setuplines[before=\nowhitespace,after=\nowhitespace] Wolfgang \starttext \startverse We all came out to Montreux, On the Lake Geneva shoreline. To make records with a mobile, We didn't have much time. But Frank Zappa and the Mothers, Were at the best place around, But some stupid with a flare gun, Burned the place to the ground. \stopverse \startchorus Smoke on the water, a fire in the sky. Smoke on the water... \stopchorus \stoptext -- Best, Vyatcheslav ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Pagebreak only after stanzas
Aditya Mahajan wrote: On Sat, 14 Apr 2007, Bert Tr�ger wrote: Hi, i am a fresh convert to Context from Latex and deeply impressed by it's ability to set multiple pages on one page, even doublesided ones. For setting a collection of poems I use \obeylines and \smallskip to arrange them on the page. Pagebreaks should only be possible between stanzas at the \smallskip-mark. Could somebody tell me, how to achieve this? Probably, the easiest way to do that will be to add a bit of a markup. Something like (untested) \setuplines[after={\blank[small]}] %or after=\smallskip \defineframedtext[stanza][width=\textwidth,before=\startlines,after=\stoplines] \startstanza . . \stopstanza \start \interlinepenalty\plustenthousand stanze \par \stop \keeplinestogether{4} stanza may also work (untested) - 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 - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Pagebreak only after stanzas
Hi again, I have tried to implement Adityas suggestions. Now pagebreaks are correct. But how can I minimize the whitespace between stanzas. There shouldn't be much more than a \smallskip. I tried to look it up in the contextgarden wiki, but an entry on verses seems to be missing, so I could wikify the solutions. Thanks in advance Chris A minimal example looks like: \setuppapersize[A6][A6] \setuplayout[ topspace=1cm,backspace=1cm,header=0pt,footer=0pt,margin=.5cm,height=middle,width=middle,] \usetypescriptfile[type-gyr] \usetypescript[times][texnansi] \mainlanguage[de] \enableregime[utf] \setupbodyfont[times,9pt] \setupindenting[medium, no] \setupframedtexts[width=\textwidth,height=fit,frame=on] \starttext \subsection{Novalis—An Tieck} \obeylines \startframedtext Ein Kind voll Wehmut und voll Teue, Verstoßen in ein fremdes Land, Ließ gern das Glänzende und Neue, Und blieb dem Alten zugewandt. \stopframedtext \startframedtext Nach langem Suchen, langem Warten, Nach manchem mühevollen Gang, Fand es in einem öden Garten Auf einer längst verfallenen Bank \stopframedtext \startframedtext Ein altes Buch mit Gold verschlossen, Und nie gehörte Worte drin; Und, wie des Frühlings zarte Sprossen, So wuchs in ihm ein innrer Sinn. \stopframedtext \startframedtext Und wie es sitzt, und liest, und schauet In den Kristall der neuen Welt, An Gras und Sternen sich erbaut, Und dankbar auf die Kniee fällt: \stopframedtext \startframedtext So hebt sich sacht aus Gras und Kräutern Bedächtiglich ein alter Mann, Im schlichten Rock, und kommt mit heiterm Gesicht ans fromme Kind heran. \stopframedtext \startframedtext Bekannt, doch heimlich sind die Züge So kindlich und so wunderbar; Es spielt die Frühlingsluft der Wiege Gar seltsam mit dem Silberhaar. \stopframedtext \startframedtext Das Kind fasst bebend seine Hände, Es ist des Buches hoher Geist, Der ihm der sauren Wallfahrt Ende Und seines Vaters Wohnung weist. \stopframedtext \startframedtext Du kniest auf meinem öden Grabe, So öffnet sich der heilge Mund, Du bist der Erbe meiner Habe, Dir werde Gottes Tiefe kund. \stopframedtext \startframedtext Auf jenem Berg als armer Knabe Hab ich ein himmlisch Buch gesehn, Und konnte nun durch diese Gabe In alle Kreaturen sehn. \stopframedtext \startframedtext Es sind an mir durch Gottes Gnade Der höchsten Wunder viel geschehn; Des neuen Bunds geheime Lade Sahn meine Auge offen stehn. \stopframedtext \startframedtext Ich habe treulich aufgeschrieben, Was innre Lust mir offenbart, Und bin verkannt und arm geblieben, Bis ich zu Gott gerufen ward. \stopframedtext \startframedtext Die Zeit ist da, und nicht verborgen Soll das Mysterium mehr sein. In diesem Buche bricht der Morgen Gewaltig in die Zeit hinein. \stopframedtext \startframedtext Verkündiger der Morgenröte, Des Friedens Bote sollst du sein. Sanft wie die Luft in Harf und Flöte Hauch ich dir meinen Atem ein. \stopframedtext \startframedtext Gott sei mit dir, geh hin und wasche Die Augen dir mir Morgentau. Sei treu dem Buch und meiner Asche, Und bade dich im ewgen Blau. \stopframedtext \startframedtext Du wirst das letzte Reich verkünden, Das tausend Jahre soll bestehen; Wirst überschwänglich Wesen finden, Und Jakob Böhmen wieder sehn. \stopframedtext \stoptext On 4/14/07, Aditya Mahajan [EMAIL PROTECTED] wrote: On Sat, 14 Apr 2007, Bert Trüger wrote: Hi, i am a fresh convert to Context from Latex and deeply impressed by it's ability to set multiple pages on one page, even doublesided ones. For setting a collection of poems I use \obeylines and \smallskip to arrange them on the page. Pagebreaks should only be possible between stanzas at the \smallskip-mark. Could somebody tell me, how to achieve this? Probably, the easiest way to do that will be to add a bit of a markup. Something like (untested) \setuplines[after={\blank[small]}] %or after=\smallskip \defineframedtext[stanza][width=\textwidth,before=\startlines,after=\stoplines] \startstanza \stopstanza Since framedtext is a box, it will not break across pages. Aditya ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Pagebreak only after stanzas
On Sun, 15 Apr 2007 15:27:20 +0200 Bert Trüger [EMAIL PROTECTED] wrote: Hi again, I have tried to implement Adityas suggestions. Now pagebreaks are correct. But how can I minimize the whitespace between stanzas. There shouldn't be much more than a \smallskip. I tried to look it up in the contextgarden wiki, but an entry on verses seems to be missing, so I could wikify the solutions. Thanks in advance Chris A minimal example looks like: \setuppapersize[A6][A6] \setuplayout[ topspace=1cm,backspace=1cm,header=0pt,footer=0pt,margin=.5cm,height=middle,width=middle,] \usetypescriptfile[type-gyr] \usetypescript[times][texnansi] \mainlanguage[de] \enableregime[utf] \setupbodyfont[times,9pt] \setupindenting[medium, no] \setupframedtexts[width=\textwidth,height=fit,frame=on] \starttext \subsection{Novalis—An Tieck} \obeylines \startframedtext Ein Kind voll Wehmut und voll Teue, Verstoßen in ein fremdes Land, Ließ gern das Glänzende und Neue, Und blieb dem Alten zugewandt. \stopframedtext \startframedtext Nach langem Suchen, langem Warten, Nach manchem mühevollen Gang, Fand es in einem öden Garten Auf einer längst verfallenen Bank \stopframedtext \stoptext Hi Bert, can you file with these settings \setupframedtexts [framedtext] [width=\textwidth, height=fit, before=, after=] \setuplines [before=\startframedtext, after=\stopframedtext] \starttext \subsection{Novalis--An Tieck} \startlines Ein Kind voll Wehmut und voll Teue, Verstoßen in ein fremdes Land, Ließ gern das Glänzende und Neue, Und blieb dem Alten zugewandt. \stoplines \startlines Nach langem Suchen, langem Warten, Nach manchem mühevollen Gang, Fand es in einem öden Garten Auf einer längst verfallenen Bank \stoplines \stoptext Wolfgang ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Pagebreak only after stanzas
On Sat, 14 Apr 2007, Bert Trüger wrote: Hi, i am a fresh convert to Context from Latex and deeply impressed by it's ability to set multiple pages on one page, even doublesided ones. For setting a collection of poems I use \obeylines and \smallskip to arrange them on the page. Pagebreaks should only be possible between stanzas at the \smallskip-mark. Could somebody tell me, how to achieve this? Probably, the easiest way to do that will be to add a bit of a markup. Something like (untested) \setuplines[after={\blank[small]}] %or after=\smallskip \defineframedtext[stanza][width=\textwidth,before=\startlines,after=\stoplines] \startstanza \stopstanza Since framedtext is a box, it will not break across pages. Aditya ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] typesetting verse?
On Wed, 23 Aug 2006, Hans Hagen wrote: Derek Schmidt wrote: Hi, Another simple question--have at it! I'd like to typeset some poetry. It should be indented, obey lines, and the lines should be close together, not like separate paragraphs. So far I've got \definestartstop[verse][commands=\obeylines] What next? \startlines...\stoplines has provisions for odd/even indentation and such also, indentation settings can handle odd/even stuff Aparantly not! The following simple example does not give me indenting of odd lines (unless I misunderstood the feature) \setupindenting[medium] \setuplines[indenting=odd] \starttext \startlines first second third fourth \stoplines \stoptext Aditya ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] typesetting verse?
Aditya Mahajan wrote: On Wed, 23 Aug 2006, Hans Hagen wrote: Derek Schmidt wrote: Hi, Another simple question--have at it! I'd like to typeset some poetry. It should be indented, obey lines, and the lines should be close together, not like separate paragraphs. So far I've got \definestartstop[verse][commands=\obeylines] What next? \startlines...\stoplines has provisions for odd/even indentation and such also, indentation settings can handle odd/even stuff Aparantly not! The following simple example does not give me indenting of odd lines (unless I misunderstood the feature) \setupindenting[medium] \setuplines[indenting=odd] \starttext \startlines first second third fourth \stoplines \stoptext \showframe \starttext \setupindenting[medium,first] \setuplines[indenting=no] \startlines first second third fourth first second third fourth \stoplines \setuplines[indenting=yes] \startlines first second third fourth first second third fourth \stoplines \setuplines[indenting=odd] \startlines first second third fourth first second third fourth \stoplines \setuplines[indenting=even] \startlines first second third fourth first second third fourth \stoplines \page \setupindenting[no] first \par second \par third \par fourth \blank first \par second \par third \par fourth \blank \setupindenting[yes] first \par second \par third \par fourth \blank first \par second \par third \par fourth \blank \setupindenting[odd] first \par second \par third \par fourth \blank first \par second \par third \par fourth \blank \setupindenting[even] first \par second \par third \par fourth \blank first \par second \par third \par fourth \blank \setupindenting[next] first \par second \par third \par fourth \blank first \par second \par third \par fourth \blank \setupindenting[first] first \par second \par third \par fourth \blank first \par second \par third \par fourth \blank \stoptext - 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 - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] typesetting verse?
On Wed, 23 Aug 2006, Derek Schmidt wrote: Aditya, With the first group of code, I get indenting=yes actually appearing in there; yet the lines aren't indented or closer together (vertically). I removed the '%' but that didn't seem to make a difference. Sorry, that should have been \setuplines[indenting=yes]. Have a look at the code posted by Hans sometime back. Aditya On 8/23/06, Aditya Mahajan [EMAIL PROTECTED] wrote: On Tue, 22 Aug 2006, Derek Schmidt wrote: Hi, Another simple question--have at it! I'd like to typeset some poetry. It should be indented, \startnarrower \stopnarrower obey lines, \startlines ... \stoplines (it is more customizable than \obeylines) You can actually say \setupindenting[medium] \startlines[indenting=yes] (other options are no, yes, odd, even) and see which one you like. and the lines should be close together, not like separate paragraphs. \setupinterlinespace[line=2em] \endgraf (default is 2.4 em) So far I've got \definestartstop[verse][commands=\obeylines] So you can try \def\startverse% {\bgroup \setupinterlinespace[line=2em] \startlines[indenting=yes]} \def\stopverse% {\stoplines \endgraf\egroup} You could have also done the equivalent \definestartstop[verse][before={\setupinterlinespace[line=2em]\startlines}, after={\stoplines\endgraf}] Aditya ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context -- Aditya Mahajan, EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam || Ph: 7342624008 ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] typesetting verse?
Ok guys, thanks. I eventually went with this: \setupindenting[medium,first] \def\startverse% {\bgroup \setupinterlinespace[medium] \setuplines[indenting=yes] \startlines} \def\stopverse% {\stoplines \endgraf\egroup} On 8/23/06, Aditya Mahajan [EMAIL PROTECTED] wrote: On Wed, 23 Aug 2006, Derek Schmidt wrote: Aditya, With the first group of code, I get indenting=yes actually appearing in there; yet the lines aren't indented or closer together (vertically). I removed the '%' but that didn't seem to make a difference. Sorry, that should have been \setuplines[indenting=yes]. Have a look at the code posted by Hans sometime back. Aditya On 8/23/06, Aditya Mahajan [EMAIL PROTECTED] wrote: On Tue, 22 Aug 2006, Derek Schmidt wrote: Hi, Another simple question--have at it! I'd like to typeset some poetry. It should be indented, \startnarrower \stopnarrower obey lines, \startlines ... \stoplines (it is more customizable than \obeylines) You can actually say \setupindenting[medium] \startlines[indenting=yes] (other options are no, yes, odd, even) and see which one you like. and the lines should be close together, not like separate paragraphs. \setupinterlinespace[line=2em] \endgraf (default is 2.4 em) So far I've got \definestartstop[verse][commands=\obeylines] So you can try \def\startverse% {\bgroup \setupinterlinespace[line=2em] \startlines[indenting=yes]} \def\stopverse% {\stoplines \endgraf\egroup} You could have also done the equivalent \definestartstop[verse][before={\setupinterlinespace[line=2em]\startlines}, after={\stoplines\endgraf}] Aditya ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context -- Aditya Mahajan, EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam || Ph: 7342624008 ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] \startlines and whitespace
On Tue, 16 May 2006, frantisek holop wrote: hi there, i am puzzled about the following issue. there's extra whitespace between the centered line and startlines, while when using \crlf, there is not. \startlines is an environment i guess (i come from latex) and some environments sometimes add extra whitespace in latex, if i recall correctly. when i use \nowhitespace between midaligned and startlines, the whitespace is smaller, but still there, depending on where the actual text is on the page. how can i get rid of the whitespace entirely? Use the before and after mechanism. \setuplines[before={\startnarrower[3cm]},after=\stopnarrower] \midaligned{test} \startlines There snores -- I mean sleeps -- my wife so frail. There snores -- I mean sleeps -- my wife so frail. \stoplines -- Aditya ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] \startlines and whitespace
hmm, on Tue, May 16, 2006 at 06:27:12PM -0400, Aditya Mahajan said that Use the before and after mechanism. \setuplines[before={\startnarrower[3cm]},after=\stopnarrower] \midaligned{test} \startlines There snores -- I mean sleeps -- my wife so frail. There snores -- I mean sleeps -- my wife so frail. \stoplines thanks for the tip. sometimes there still is extra whitespace. but \nowhitespace seems to supress them without problems. i think i should also add, that the document has \setuptolerance [strict] so it's not verystrict... -f -- we're born free and taxed to death. ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] \page inside a block
frantisek holop wrote: hi there, the following is a minimal example of the layout i am working on. ---%- % output=pdftex \enableregime[latin2] \setuppapersize [A5][A5] \defineparagraphs [poem][n=2] \setupparagraphs [poem][1][width=.35\textwidth] \setupparagraphs [poem][2][rule=on] \starttext \startpoem \section{poem} \poem\startlines line 1 line 2 \page line 3 line 4 \stoplines\stoppoem \stoptext ---%- when the poem gets long, i need to start a new page obviously. but page is not working. what am i missing here? that it's unbreakable stuff (vbox) also, using \page is one thing, good for me, so i could tell, flush the page right here, but i thought i'll get an automatic pagebreak when the text gets to the bottom sorry if this is a very silly question, just getting my feet wet with context thanks actually, this is a rather complex situation; one could use a tabulate the complication is in the line and in the fact that you want to use a section command \setuppapersize[A5][A5] \starttext \setupcolors[state=start] \definetextbackground [poem] [state=start, location=paragraph, background=color, backgroundcolor=red] \definehead[Poem][section] \setuphead[Poem][alternative=poemtitle,before={\blank[2*big]},after={\vskip-\lineheight},page=,style=\bfa] % works, but may not be that robust) % % \defineheadplacement[poemtitle][horizontal]#1#2% % {\margintitle{\hskip\measure{SavedLeftSkip}#1\enspace#2}} \defineheadplacement[poemtitle][vertical]#1#2% {\setupparagraphintro[first][{\llap{\hbox to \leftskip{#1\enspace#2\hss}}}]} \setuplines[before=,after=] \def\StartPoem#1% {\startnarrower[5*left] % \expanded{\definemeasure[SavedLeftSkip][\the\leftskip]} \Poem{#1} \starttextbackground[poem] \startlines} \def\StopPoem {\stoplines \stoptextbackground \stopnarrower} \showframe \StartPoem{xxx} line 1 line 2 \StopPoem \setuptextbackground [poem] [mp=mpos:par:poem] \startuseMPgraphic{mpos:par:poem} for i = 1 upto nofmultipars : draw leftboundary multipars[i] shifted (-.5EmWidth,0) dashed evenly withpen pencircle scaled 1pt withcolor .8red ; endfor ; \stopuseMPgraphic \StartPoem{zzz} line 1 line 2 \StopPoem \startuseMPgraphic{mpos:par:poem} for i = 1 upto nofmultipars : draw multipars[i] enlarged .5ExHeight rightenlarged -.5ExHeight dashed evenly withpen pencircle scaled 1pt withcolor .8red ; endfor ; \stopuseMPgraphic \StartPoem{qqq} line 1 line 2 line 3 \dorecurse{100}{line 4:\recurselevel\par} \StopPoem \stoptext I leave it up to you (or others) to wikify this example. It looks more complex than it is. By using a mp graphic you have more options watch what happens if you add \page \startuseMPgraphic{mpos:par:poem} for i = 1 upto nofmultipars : multipars[i] := multipars[i] enlarged .5ExHeight rightenlarged -.5ExHeight; drawoptions ( dashed evenly withpen pencircle scaled 1pt withcolor .8red ) ; if multilocs[i] = 1 : draw llcorner multipars[i] -- ulcorner multipars[i] -- urcorner multipars[i] -- lrcorner multipars[i] ; elseif multilocs[i] = 3 : draw ulcorner multipars[i] -- llcorner multipars[i] -- lrcorner multipars[i] -- urcorner multipars[i] ; else : draw leftboundary multipars[i] ; draw rightboundary multipars[i] ; fi ; endfor ; \stopuseMPgraphic \StartPoem{hhh} \dorecurse{200}{line \recurselevel\par} \StopPoem - 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 - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Dropped caps, \startlines\stoplines, and indentation question
Radhelorn wrote:Adrian Drury wrote: Hello, I'm having trouble using dropped caps within \startlines\stoplines. I'm trying to typeset some poetry and I'm using \setuplines[space=yes]. I'd like to use dropped caps and have the indented lines be additionally indented by any space at the beginning of the lines. See the following example - the first part shows roughly the result I want (but with manual formatting/spacing), the second part shows the result of \DroppedCaps inside \startlines\stoplines, and the third part uses the lettrine module. The lettrine module comes close, but Nindent doesn't seem to affect the indented lines within \startlines\stoplines. \usemodule[lettrine] \def\MyDroppedCaps% { \DroppedCaps {} {Serif} {2\baselineskip} {2pt} {1\baselineskip} {2} } \setuplines[space=yes] \starttext \MyDroppedCaps S{\sc umer} is icumen in,\crlf \hbox to .6em{}Lhude sing cuccu!\crlf Groweth sed, and bloweth med,\crlf \hbox to .6em{}And springth the wude nu---\crlf \hbox to 3.3em{}Sing cuccu! \startlines \MyDroppedCaps S{\sc umer} is icumen in, Lhude sing cuccu! Groweth sed, and bloweth med, And springth the wude nu--- Sing cuccu! \stoplines \startlines \lettrine{S}{umer} is icumen in, Lhude sing cuccu! Groweth sed, and bloweth med, And springth the wude nu--- Sing cuccu! \stoplines \stoptext Any suggestions for how to do this? I'm a beginning ConTeXt user, so if there's a better/different way to do this, I'd be happy to hear it! Also, I read the list in digest form. For the benefit of people using threaded mail readers, is there a better way to reply to individual messages than replying to the digest message and editing the Subject line appropriately? Thanks very much, Adrian Drury ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-contextTry\startlines \vbox{\lettrine{S}{umer} is icumen in,\crlf Lhude sing cuccu!}Groweth sed, and bloweth med,And springth the wude nu---Sing cuccu!\stoplines--Radhelorn [EMAIL PROTECTED]Thank you very much for your suggestion - it does most of what I want to do. I have a follow-up question if anybody would like to provide more help! Because lines in \startlines\stoplines with \setuplines[space=yes] can be indented by space characters, I want to set Nindent for the dropped cap to (N * width of space character), so lines can be indented by the exact same amount they would be with spaces in \startlines\stoplines. Is there a way to calculate the width of some number of characters (or a string of characters) to use as a dimension parameter? For example, a macro that returns the width in points of 5 space characters in the current font? I figured hardcoding the width of a space as a percentage of an em might work, but would probably not be consistent across fonts. Is that true, or is it really that simple? I'd also be happy with a way to preserve spaces in the text inside the vbox (and ignore any Nindent dimension calculation), because then I could just add the appropriate number of spaces for indentation after the \crlf, like this: \vbox{\lettrine{S}{umer} is icumen in,\crlf 2 spacesLhude sing cuccu!}, as I do in \startlines\stoplines.Thanks very much,Adrian Drury ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context