[NTG-context] Typesetting poetry with particular indenting

Taco Hoekwater taco at elvenkind.com
Thu Jul 2 15:56:38 CEST 2020


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 <illinguista1972 at gmail.com> 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






More information about the ntg-context mailing list