ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Help with \setuplist number width (for appendices)
@ 2015-03-23  9:29 Robin.Kirkham
  2015-03-23 11:42 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Robin.Kirkham @ 2015-03-23  9:29 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 940 bytes --]

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]

\setuplabeltext[appendix=Appendix\space]

\starttext
\completecontent

\chapter{One}
\chapter{Two}

\startappendices
\chapter{First}
\chapter{Second}
\stopappendices

\stoptext


[-- Attachment #2: contents.pdf --]
[-- Type: application/pdf, Size: 12281 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 3+ messages in thread

* Re: Help with \setuplist number width (for appendices)
  2015-03-23  9:29 Help with \setuplist number width (for appendices) Robin.Kirkham
@ 2015-03-23 11:42 ` Wolfgang Schuster
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2015-03-23 11:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 23.03.2015 um 10:29 schrieb <Robin.Kirkham@csiro.au> <Robin.Kirkham@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
___________________________________________________________________________________
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] 3+ messages in thread

* Re: Help with \setuplist number width (for appendices)
       [not found] <mailman.403.1427184108.2410.ntg-context@ntg.nl>
@ 2015-03-25 10:59 ` Robin.Kirkham
  0 siblings, 0 replies; 3+ messages in thread
From: Robin.Kirkham @ 2015-03-25 10:59 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1431 bytes --]

Am 23.03.2015 um 10:29 schrieb <Robin.Kirkham@csiro.au<mailto:Robin.Kirkham@csiro.au>> <Robin.Kirkham@csiro.au<mailto:Robin.Kirkham@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


[-- Attachment #1.2: Type: text/html, Size: 13907 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2015-03-25 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-23  9:29 Help with \setuplist number width (for appendices) Robin.Kirkham
2015-03-23 11:42 ` Wolfgang Schuster
     [not found] <mailman.403.1427184108.2410.ntg-context@ntg.nl>
2015-03-25 10:59 ` Robin.Kirkham

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