[NTG-context] Align TOC section numbers flushright

Idris Samawi Hamid ادريس سماوي حامد Idris.Hamid at colostate.edu
Mon Jun 25 21:42:06 CEST 2018


On Mon, 25 Jun 2018 13:17:40 -0600, Wolfgang Schuster  
<schuster.wolfgang at gmail.com> wrote:

>
>
> Idris Samawi Hamid ادريس سماوي حامد schrieb:
>> \setuphead[chapter]   [conversion=R]
>>
>> \setuplist[chapter][width=2.8em]
>>
>> \definecombinedlist
>> [content]
>> [chapter]
>> [level=chapter,
>> alternative=c,
>> numberalign=flushright]
>
> Use \setuplist to change the numeralign setting, you need also a
> distance value.
>
> \setuplist
>    [chapter]
>    [alternative=c,
>     width=2.8em,
>     distance=1em,
>     numberalign=flushright]

Many thanks. Had come up with this awkward workaround:

\define[1]\FLUSHRIGHT{\hfill#1\hbox to0.7em{}}

\setuplist[chapter][width=2.8em]
\setuplist[chapter][stopper=.,numbercommand=\FLUSHRIGHT]

Does the attached tex file look correct?

\setuplist
   [chapter]
   [alternative=c,
    width=1.85em,
    distance=0.5em,
    numberalign=flushright,
    level=chapter]

\definecombinedlist
[content]
[chapter]

If one turns on \showframe, one sees that the width value does not prevent  
crossing the left side of the textblock (a good thing). OTOH, getting the  
TOC numerals to lineup with the left side is a matter of trial and error.  
[width=1.85em comes close]

And if the document is changed so that the wider roman numerals are not  
needed, then one has to reset the width value, again by trial and error.

So is there a way to make the left side of the textblock flush with the  
widest roman? It's by no means urgent, but sine we are supposed to be able  
to automate nearly everything.. -)

> The attached file shows which values are valid for \setupcombinedlist.

Ah, our npp-4-context config files for calltips need updating, I have

\definecombinedlist [NAME]
[LIST]
[INHERIT: \setuplist]

but that should be

\definecombinedlist [NAME]
[LIST]
[INHERIT: \setupcombinedlist]

Many thanks.

Idris
-- 
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scratch.pdf
Type: application/pdf
Size: 30893 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20180625/5f36124c/attachment-0001.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scratch.tex
Type: application/x-tex
Size: 1490 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20180625/5f36124c/attachment-0001.tex>


More information about the ntg-context mailing list