ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to use \setuplist for formatting a chapter entry?
@ 2015-02-03  8:57 Rob Heusdens
  2015-02-03  9:13 ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Heusdens @ 2015-02-03  8:57 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-02-06  9:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-03  8:57 How to use \setuplist for formatting a chapter entry? Rob Heusdens
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

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).