ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Rule under length of last line
Date: Mon, 31 Jul 2006 21:12:40 +0200	[thread overview]
Message-ID: <44CE5628.4050802@wxs.nl> (raw)
In-Reply-To: <44CE4226.3050908@elvenkind.com>

Taco Hoekwater wrote:
> 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.
>   
i was thinking of that as a third solution but somehow you trust \setlastlinewidth more than i do -) 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

  reply	other threads:[~2006-07-31 19:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-31 16:59 Duncan Hothersall
2006-07-31 17:47 ` Taco Hoekwater
2006-07-31 19:12   ` Hans Hagen [this message]
2006-08-01  7:43     ` Taco Hoekwater
2006-07-31 18:56 ` Hans Hagen
     [not found] <mailman.132.1154372189.2039.ntg-context@ntg.nl>
2006-07-31 19:33 ` Duncan Hothersall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44CE5628.4050802@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).