ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Re: Inserting a mini toc into the chapter heading
Date: Fri, 14 Feb 2003 14:32:09 +0100	[thread overview]
Message-ID: <5.1.0.14.1.20030214142846.027cd2a8@server-1> (raw)
In-Reply-To: <ud6lvc8ju.fsf@multiline.com.au>

At 09:10 PM 2/14/2003 +0800, you wrote:
>For all you propeller-heads that like to see bad code here's my
>chapter heading setup:
>
>--------------------------------------------------
>
>%output=pdf
>
>%% chapter head layout
>\setupcolors[state=start]
>\setuplist[section]
>           [style=boldslanted,
>            align=right,
>            interaction=all,
>            symbol=1,
>            width=0.5em,
>            pagenumber=no,
>            before=,
>            after=]
>\setuphead[chapter]
>           [header=empty,
>            numberstyle=ChapterTitleNumberFont,
>            textstyle=ChapterTitleTextFont
>            alternative=command,
>            command=\ContentsHead,
>            page=right,
>            after={\blank[2*big]}]
>\definefont[ChapterTitleTextFont][Serif at 24.9pt]
>\definefont[ChapterTitleNumberFont][SerifBold at 40pt]
>\def\ContentsHead#1#2%
>   {\setupframed[frame=off]

                           ^ add % here to prevent spurious space

>    \framed[width=\hsize,offset=overlay]
>      {\placesidebyside
>         {\doifelsenothing{#1}

or        \doifmodeelse{*sectionnumber}

>            {\framed [width=.6\hsize]{}} % dummy
>            {\framed [width=.6\hsize,offset=1em,strut=no,align=right,
>                      background=screen]
>               {\vi In this chapter: \blank
>                  \placelist[section][criterium=chapter]}}}
>         {\framed [width=.4\hsize,strut=no,align=left]
>                     %% Typeset Chapter Number
>                     {\hbox{\vbox to 24.9pt{% height ChapterTitleTextFont
>                           \vss
>                           #1}}}
>            \vfilll}
>      }%
>    %% Typeset Chapter Title
>    \llap{\lower24.9pt\hbox{#2\hskip0.5em}}}
>
>\showmakeup

i didn't look how it looks (so i will not comment on that)

about bad code: you will always need some low level coding to achieve 
certain effects; also the code does not look that bad -)

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

  reply	other threads:[~2003-02-14 13:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-11  7:55 Guy Worthington
2003-02-11  9:51 ` Patrick Gundlach
2003-02-12  9:01   ` Guy Worthington
2003-02-12 10:15     ` Willi Egger
2003-02-12 11:15       ` Hans Hagen
2003-02-11 12:06 ` Hans Hagen
2003-02-12  8:39   ` Guy Worthington
2003-02-13  3:04     ` Guy Worthington
2003-02-13 16:52       ` Hans Hagen
2003-02-14 11:51         ` Guy Worthington
2003-02-14 13:10           ` Guy Worthington
2003-02-14 13:32             ` Hans Hagen [this message]
2003-02-14 13:50               ` Bruce D'Arcus
2003-02-14 13:52                 ` Adam Lindsay
2003-02-14 20:15                 ` Willi Egger
2003-02-17  1:23                   ` Hans Hagen

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=5.1.0.14.1.20030214142846.027cd2a8@server-1 \
    --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).