> On 23 Oct 2021, at 14:51, Gerben Wierda via ntg-context <ntg-context@ntg.nl> 
> wrote:
> 
> 
>> On 23 Oct 2021, at 15:34, Wolfgang Schuster 
>> <wolfgang.schuster.li...@gmail.com> wrote:
>> 
>>  Gerben Wierda via ntg-context schrieb am 23.10.2021 um 15:20:
>>> I’d like a book with chapters to have sections/parts, e.g. something that 
>>> groups a few \chapter elements together. Is there support for this in LMTX? 
>>> I.e. in such a way that it also shows up in the table of contents?
>> 
>> You can use \part.
> 
> Yes. Thanks. But that leads to additional questions:
> - how do I get the parts to show up in the table of contents? Because I tried 
> \part but it did not show up
> - how do I let chapters number on (not restart in each part, and not a x.y 
> number but simply ‘2. Chapter’
> - what is a good way to create actual RHS ‘title’ pages for each chapter?
> - how do I get parts to number with Roman numerals?

I define my own versions of \part and \chapter (called \Part and \Chapter) and 
specify a different display style using setups. The definition for \Part is 
below, \Chapter is very similar so I haven't included it.

%% Double rule above part title
\startsetups PartSetup
 \setupheader[state=empty]
 \par
 \startMPcode
   draw (0,2mm)--(TextWidth,2mm) withpen pensquare scaled 1.5mm ;
   draw (0,0)--(TextWidth,0) withpen pensquare scaled 1.0mm ;
   clip currentpicture to unitsquare yscaled 1cm xscaled TextWidth
 \stopMPcode
\stopsetups

\define[2]\placePartTitle{\midaligned{#2}}
%% The above line is what I use. You want Roman numerals so maybe adapt it to:
%% \define[2]\placePartTitle{\midaligned{\convertnumber[Romannumerals][#1] #2}}

\definehead [Part] [part]
\setuphead[Part]
 [ page=right,
   placehead=yes,
   style={\stylePartTitle}, %% this is just from a \definefont
   before={\setups{PartSetup}},
   command=\placePartTitle,
 ]

With \setuplayout[location=doublesided] this then comes out on the RHS.

For the ToC, I use:

\setuplist [alternative=b]
\setuplist [Part]
 [ headnumber=no,
   margin=0cm,
   width=0cm,
   distance=0cm,
   style=\tocStylePartTitle,
 ]
\setuplist [Chapter]
 [ headnumber=no,
   margin=1em,
   width=0cm,
   distance=0cm,
 ]
\setupcombinedlist [content] [list={Part,Chapter}]

then \placecontent prints the chapter titles indented under each part.

HTH
—
Bruce Horrocks
Hampshire, UK



—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to