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
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 -----------------------------------------------------------------
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
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 -----------------------------------------------------------------
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
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
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
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
___________________________________________________________________________________
Tommaso Gordini schrieb am 02.07.2020 um 16:48:
Taco, this works! Thank you!
Now (last question), it's possibile to centering in the middle of the page the whole verse block ? You can use the framedtext environment but the content can no longer split across pages.
\starttext \startframedtext[middle][frame=off,width=fit] \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 \stopframedtext \stoptext Wolfgang
Thanks, Wolfgang. Your example works, but the verse indentation ( \setuplines[indenting=three]) is lost. There's a way to preserve it? Tommy
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 < illinguista1972@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
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
participants (5)
-
Floris van Manen
-
Hans Hagen
-
Taco Hoekwater
-
Tommaso Gordini
-
Wolfgang Schuster