[NTG-context] another surprising change (line break in TOC)

Wolfgang Schuster schuster.wolfgang at googlemail.com
Tue Jan 17 23:41:59 CET 2012


Am 17.01.2012 um 13:14 schrieb Steffen Wolfrum:

> 
> Am 17.01.2012 um 12:19 schrieb luigi scarso:
> 
>> Probably a bug, but this is ok
>> \definelistplacement[MyListItemIT][none]#1#2#3%
>> {\hfill\kern-1em\it#1%
>> \hfill\strut\crlf\strut\hfill\hphantom{\tf#3}%
>> \framedtext[frame=off,offset=overlay,align=middle,style=bold]%
>> {#2}%
>> \hfill\tf#3
>> }
> 
> 
> Not really ok. That's a pitfall with minimal examples ... "the devil is in the details" ;o)
> For getting it minimal I wrote \bf, but in the original file it is used as a bold style with a certain size and a certain interlineskip: \TOCstyleBF
> 
> And this interlineskip is ignored in your solution, test the following please:
> 
> 
> \def\TOCstyleBF{\switchtobodyfont[9pt]\bf\setupinterlinespace[line={40pt}]}
> 
> \definelistplacement[MyListItemIT][none]#1#2#3%
>   {\hfill\kern-1em\it#1\hfill\strut\crlf\strut\hfill\hphantom{\tf#3}\framedtext[frame=off,offset=overlay,align=middle,style=TOCstyleBF]{#2}\hfill\tf#3} % here the interlinespace is ignored
> %   {\hfill\kern-1em\it#1\hfill\strut\crlf\strut\hfill\hphantom{\tf#3}\framedtext[frame=off,offset=overlay]{\TOCstyleBF\midaligned{#2}}\hfill\tf#3} % here the interlinespace worked


You should try to make your code more readable.

\definelistplacement[MyListItemIT][none]#1#2#3%
   {\maxaligned\bgroup
      \rlap{\it#1}%
      \framed[frame=off,align=middle,location=bottom,width=broad,foregroundstyle=\TOCstyleBF]{#2}%
      \llap{\tf#3}%
    \egroup}

Wolfgang


More information about the ntg-context mailing list