Re: [NTG-context] A book with sections

2021-10-24 Thread Duncan Hothersall via ntg-context
Worth just quickly noting that the default for \part is placehead=no. You
need to explicitly set placehead=yes for it to actually output the heading.
See https://wiki.contextgarden.net/Command/_section#Parts

On Sun, 24 Oct 2021 at 00:02, Bruce Horrocks via ntg-context <
ntg-context@ntg.nl> wrote:

>
>
> > 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
>
> ___
>


-- 
Duncan Hothersall, Operations Director
CAPDM Limited - Online Program Enablers
0131 677 2400  www.capdm.com
Registered in Scotland: SC168970   VAT: 682 846 983
Registered address: 20 Forth Street Edinburgh EH1 3LH UK


Capture, author, publish, deliver and manage your learning materials.


*Sign up to the CAPDM newsletter here *
___
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
___


Re: [NTG-context] A book with sections

2021-10-23 Thread Bruce Horrocks via ntg-context


> On 23 Oct 2021, at 14:51, Gerben Wierda via ntg-context  
> wrote:
> 
> 
>> On 23 Oct 2021, at 15:34, Wolfgang Schuster 
>>  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
___


Re: [NTG-context] A book with sections

2021-10-23 Thread Pablo Rodriguez via ntg-context
On 10/23/21 3:51 PM, Gerben Wierda via ntg-context wrote:
>> On 23 Oct 2021, at 15:34, Wolfgang Schuster wrote:
>> [...]
>> 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?
Hi Gerben,

I don’t know what actual RHS title pages are:

  \definestructureresetset[default][0,1,1][1]
  \definestructureconversionset[sectionnumbers][R,n][n]
  \setupheads[sectionconversionset=sectionnumbers,
sectionresetset=default]
  \setuphead[part][placehead=yes]
  \setuphead[chapter][sectionsegments=chapter]
  \setuphead[section][sectionsegments=chapter:section]
  \starttext
  \completecontent
  \dorecurse{25}{\part{Part}
  \chapter{Chapter}
  \section{Section}
  \section{Section}}
  \stoptext

Pablo
--
http://www.ousia.tk
___
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
___


Re: [NTG-context] A book with sections

2021-10-23 Thread Wolfgang Schuster via ntg-context

Gerben Wierda schrieb am 23.10.2021 um 15:51:

On 23 Oct 2021, at 15:34, Wolfgang Schuster  
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

I can't reproduce the problem, do you have a example.

- how do I let chapters number on (not restart in each part, and not a x.y 
number but simply ‘2. Chapter’

Use \defineresetset as shown below.

- what is a good way to create actual RHS ‘title’ pages for each chapter?

Use a doublesided layout.

- how do I get parts to number with Roman numerals?

See below.


% Change the number conversion for section titles

\defineconversionset [section] [Romannumerals] [numbers]

\setuphead
  [sectionconversionset=section]

% Show only the chapter value for chapter

\setuphead
  [chapter]
  [sectionsegments=chapter]

% Don't reset the counter for parts and chapters

\defineresetset [default] [0,0] [1]

\starttext

\completecontent

\dorecurse{4}
  {\expanded{\part{Part \recurselevel}}
   \dorecurse{5}{\expanded{\chapter{Chapter \recurselevel

\stoptext

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


Re: [NTG-context] A book with sections

2021-10-23 Thread Gerben Wierda via ntg-context

> On 23 Oct 2021, at 15:34, Wolfgang Schuster 
>  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?

Gerben


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


Re: [NTG-context] A book with sections

2021-10-23 Thread Wolfgang Schuster via ntg-context

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.

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


[NTG-context] A book with sections

2021-10-23 Thread Gerben Wierda via ntg-context
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?

Thanks,


Gerben Wierda (LinkedIn )
R Enterprise Architecture  (main site)
Book: Chess and the Art of Enterprise Architecture 
Book: Mastering ArchiMate 

___
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
___