From: "Rob Heusdens" <robheus@xs4all.nl>
To: ntg-context@ntg.nl
Subject: How to use \setuplist for formatting a chapter entry?
Date: Tue, 3 Feb 2015 09:57:36 +0100 [thread overview]
Message-ID: <d181db8d3b0cc65346736004e58392ee.squirrel@webmail.xs4all.nl> (raw)
Hello list,
I have one little problem that I need to solve to finish my work on a
document. I want to format a list entry for the TOC for chapters like
this:
"Hoofdstuk #1 -- #2 . . . . . . . . #3"
Where #1 is the chapter number, #2 is the title and #3 the page number
where the chapter begins.
Of course the ". . . " entry is just like the normal cases where the dots
fill the rest of the line.
I have an *almost* correct solution using numbercommand and setting the
width for the title, but this leaves a gap between the formatted chapter
number and the title, because "chapter 9" and "chapter 10" don't take the
same width.
So, some other solution is needed. I tried using the command option, which
needs 3 arguments, but could not get it to work.
Here is how it looks now:
\define[1]\ChapterNumberToc%
{Hoofdstuk #1 -- }
\definecombinedlist[content][chapter]
\setupcombinedlist[content][level=4, alternative=c]
\setuplist[chapter][headnumber=yes,style=bold,width=8em,numbercommand=\ChapterNumberToc]
\starttext
\completecontent
\dorecurse{5}{
\chapter {Knuth} \input knuth
\chapter {Zapf} \input zapf}
\stoptext
As you can see, there is a different between the 9-th and 10-th chapter,
because title is set at a specific width, and doesn't adapt to the width
of the formatted chapter number entry.
How to solve this, so that the title is placed directly after the
"Hoofdstuk #1 -- " entry, thereafter the filler with dots and finally the
page number at the location where it is now.
Thanks,
Rob
___________________________________________________________________________________
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
___________________________________________________________________________________
next reply other threads:[~2015-02-03 8:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-03 8:57 Rob Heusdens [this message]
2015-02-03 9:13 ` Wolfgang Schuster
2015-02-03 11:15 ` Rob Heusdens
2015-02-03 11:30 ` Wolfgang Schuster
2015-02-03 11:43 ` Rob Heusdens
2015-02-04 11:26 ` Wolfgang Schuster
2015-02-04 14:33 ` Rob Heusdens
2015-02-04 23:49 ` Wolfgang Schuster
2015-02-06 9:44 ` Rob Heusdens
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=d181db8d3b0cc65346736004e58392ee.squirrel@webmail.xs4all.nl \
--to=robheus@xs4all.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).