# [NTG-context] Help with \setuplist number width (for appendices)

Robin.Kirkham at csiro.au Robin.Kirkham at csiro.au
Wed Mar 25 11:59:51 CET 2015

Am 23.03.2015 um 10:29 schrieb <Robin.Kirkham at csiro.au<mailto:Robin.Kirkham at csiro.au>> <Robin.Kirkham at csiro.au<mailto:Robin.Kirkham at csiro.au>>:

Dear List,

I’m implementing a predefined document style. This requires chapters numbered 1, 2, 3 … and appendices numbered Appendix A, Appendix B, Appendix C, … both in the actual heads and also the table of contents.

The style also requires the chapter numbers in the table of contents to be set in a 12mm column. The MWE below does all this, but for the appendices the number overflows the 12mm width, which is ugly of course. So I need to specify either a width with some stretch so the list layout will adapt, or somehow be able to specify a different width for the appendix entries.

Any help appreciated,

Robin

\setuplist[chapter][
width=12mm,         % but want 30mm for appendices
label=yes,
alternative=c]

\define[1]\ChapterlistNumber
{\dowithnextbox
{\ifdim\nextboxwd<12mm
\simplealignedbox{12mm}{flushleft}{\flushnextbox}%
\else
\simplealignedbox{30mm}{flushleft}{\flushnextbox}%
\fi}
\hbox{#1}}

\setuplist
[chapter]
[width=0pt,
label=yes,
alternative=c,
numbercommand=\ChapterlistNumber]

Wolfgang

Thanks Wolfgang!  I actually tried something a bit like this but couldn’t get it to work. The key is to set the width to 0pt in the \setuplist.

Best wishes from Melbourne,

Robin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20150325/8d19547f/attachment.html>