[NTG-context] Rule under length of last line

Duncan Hothersall dh at capdm.com
Mon Jul 31 18:59:59 CEST 2006

I've had a last-minute impossible request for a typesetting style, and
having already told the person it can't be done in the time available,
wondered whether it can actually be done at all.

The request is for a subsection heading to have a continuous horizontal
rule under both its number and title, at a distance of about 6pt from
the baseline (i.e. not underlining), extending just the length of the
heading. I can do that by setting both number and title in a TABLE,
setting the offsets and specifying the bottom frame to be on - no problem.

However, the tricky part is that where a longer title runs beyond one
line, the line should only appear under the last line, and only to the
length of the last line of text.

In other words, for viewers with fixed width fonts:

1.1.1 Short title

1.1.2 Longer title which wraps onto a
      second line like this

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.

I have to say I think it's quite ugly, but can anyone give me a pointer
as to how it could be done? Is there a box left at the end of a par
which shows the width of the last line?

As I say, I've already said no, so this is just out of interest, no



More information about the ntg-context mailing list