That's interesting.

I am sure how to integrate it in my TOC though.

I would have to replace both \box0 and \box2 by something like \placecontent[current] or \placecurrentcontent.

Does such a thing exist ?



Mathieu





From: schuster.wolfgang@googlemail.com
Date: Wed, 25 May 2011 18:12:37 +0200
To: ntg-context@ntg.nl
Subject: Re: [NTG-context] TOC : Changing the interline spacing of titles, for long titles on multiple lines


Am 25.05.2011 um 18:02 schrieb Mathieu DUPONT:


When I run this code, every lines of the TOC become 2.8ex.
What I needed is every lines to be 2.8ex, except for the last line of each title, which should be 4.2 ex.
In other words, all short titles that fit on one line will be 4.2ex (they're all last lines), but, only for the long titles on multiple lines, their first lines will be 2.8ex and their last line will be 4.2ex.
To resume the result I seek, the TOC is 4.2ex, but when a long title is on multiple lines it should stick together (2.8ex).

You want something like this?

\starttext

\setbox0\vbox{\input ward\par}

\doloop
  {\setupinterlinespace[line=2.8ex]
   \ifdim\ht0<\lineheight
     \setupinterlinespace[line=4.2ex]
     \box0
     \exitloop
   \else
     \setbox2\vsplit0 to \baselineskip
     \box2
   \fi}

\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 ___________________________________________________________________________________