Duncan Hothersall wrote:
> We generate the ConTeXt code from XML, so ideally a solution wouldn't
> require the last line to be set separately, but would just work whether
> the heading was single or multiple line. What I'm really looking for is
> a subsection setup that will automatically do this whatever length of title.

It is easier than you think:

   \def\Myway#1%
     {#1\vrule height 0pt depth 6pt width 0pt}% title + force 6pt
      \optimizedisplayspacingtrue\setlastlinewidth % core-mat macro
      \global\advance\lastlinewidth-\hangindent\par % adjust
      \hrule width \the\lastlinewidth}

   \setuphead[section][textcommand=\Myway]

The key element is \setlastlinewidth, which measures the width
of the final line of the current paragraph.

Cheers, Taco

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to