[NTG-context] Hanging indent

Wolfgang Schuster schuster.wolfgang at gmail.com
Wed Mar 11 00:41:01 CET 2015


> Am 10.03.2015 um 22:00 schrieb Willi Egger <context at boede.nl>:
> 
> Hello everybody,
> 
> 
> Currently I am typesetting a small dictionary. I want to have hanging indents if the text joined to the expression is longer than one line.
> 
> In the past I had this definitions:
> 
> \defineblank[Afterhangingparagraph][1pc]
> 
> \starttext
> \def\Hangindent{\hangafter=1\hangindent=1em}
> 
> \definestartstop[HangPar]
>     [before={\bgroup\appendtoks\Hangindent\to\everypar},
> 	  after={\egroup\blank[Afterhangingparagraph]}]
> 
> 
> \starttext
> \startHangPar
> 	\input knuth
> \stopHangPar
> 
> \startHangPar
> {\bf Aanslaan,}  aanspreken. Een poging in 't werk stellen. 
> 
> Ik zal dat heertje reis aanslaan. Sla dien broger (man) aan, misschien heeft hij poen (geld). Jongens, er moet aangeslagen worden, daar loopt mooi gajes (menschen daar wat van te halen is).
> \stopHangPar
> \stoptext
> 
> 
> The strange thing is, that the first two paragraphs of the Knuth-text is showing a hanging indent, however the last paragraph does not which is unexpected.  In the example from the dictionary no hanging indentation is shown.
> 
> What do I mis here?

You have to add \par at the end of your environment, i.e.

\definestartstop
  [HangPar]
  [before=\begingroup\EveryPar{\hangafter\plusone\hangindent\emwidth\relax},
   after={\par\endgroup\blank[1pc]}]

Wolfgang


More information about the ntg-context mailing list