From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113220 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Duncan Hothersall via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: A book with sections Date: Sun, 24 Oct 2021 09:33:35 +0100 Message-ID: References: <35ec9724-0d9e-a492-716f-149febf6e4bb@gmail.com> <04BC4E71-1BC6-4708-8F46-0B61996981AD@scorecrow.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2637818115190910651==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31066"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Duncan Hothersall To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 24 10:34:31 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1meYxa-0007rp-L9 for gctc-ntg-context-518@m.gmane-mx.org; Sun, 24 Oct 2021 10:34:30 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A71C8267CDE; Sun, 24 Oct 2021 10:33:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RnB0HyFPvoRW; Sun, 24 Oct 2021 10:33:56 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 297DD267D5C; Sun, 24 Oct 2021 10:33:56 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6A427267D5C for ; Sun, 24 Oct 2021 10:33:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 40EL_RGxMSir for ; Sun, 24 Oct 2021 10:33:53 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.182; helo=mail-lj1-f182.google.com; envelope-from=dh@capdm.com; receiver= Original-Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 11522267CDE for ; Sun, 24 Oct 2021 10:33:52 +0200 (CEST) Original-Received: by mail-lj1-f182.google.com with SMTP id r6so3002107ljg.6 for ; Sun, 24 Oct 2021 01:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=capdm.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ze1nrpRVir2Z5iVOqyISYIKDm8t8X7BlTK8pSmkKkhQ=; b=iSyJg5F8cnvVn9pIhSQuq8cW4CbdnDMhOfCy+w8MslYIJb0s0tcbPpRz9Oao5/KQDp wdjCrdchbVOWnHhUmJlByZod0fdcrm7LoqbUYeYriK1URLGToIbtYX4/8X21iAuOQ64j pMJukzi3TqKAnNzoJUDHLQhXa7sPJxuHjMVMQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ze1nrpRVir2Z5iVOqyISYIKDm8t8X7BlTK8pSmkKkhQ=; b=6Ecq+SM0dP4P2qaPBvDj5dZrJW95NfSYaWwmGLUxqyI91EmnV0y6fPCLgRzGSUJ07T PNX+eykm2OqnAWC1XsSvWwPZK9odVbY18O7uY2G0W9VOPSrcrwgiSZUqrXMJuA1aFblU sL5rcDbNksJMESxZ/nPo3hv4Y+RHru+S1R22j4ItTwDbplPU9+WeeRctNNhellX3N28o aNDNXCKRbFxC4WpgRpRiOQ+pr9gIX6FQkiKD5l2aEl0uaVZsTMn8C4wfFusL8Bq5HqMu YoU+00GMxKQW56+I1sex+MSVtlapESnjk+YQwG340JWAlv9gHgpc1LsUkpiyDkjE4oCk r4Bw== X-Gm-Message-State: AOAM532cIld59oklXcqiYM4qimJaqk/XPJdZwp/b8aeLQ4vFtWG+mjlS 0XC/bwbCead0CEhHfRkBj45qy72hpWNj+W5BkDWWbul78A+5lWjr X-Google-Smtp-Source: ABdhPJyVTRWSFXPO0YMhgNiwulrV/brKSgdhyXAUhj9yNbNK7oF/dI90Rv3buRkvOGiBc9ul+6MaGkbyvXnB+WWPufI= X-Received: by 2002:a2e:a4b6:: with SMTP id g22mr11595490ljm.191.1635064431702; Sun, 24 Oct 2021 01:33:51 -0700 (PDT) In-Reply-To: <04BC4E71-1BC6-4708-8F46-0B61996981AD@scorecrow.com> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:113220 Archived-At: --===============2637818115190910651== Content-Type: multipart/alternative; boundary="000000000000a3136905cf151a16" --000000000000a3136905cf151a16 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Worth just quickly noting that the default for \part is placehead=3Dno. You need to explicitly set placehead=3Dyes for it to actually output the headin= g. 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.lists@gmail.com> wrote: > >> > >> =EF=BB=BF Gerben Wierda via ntg-context schrieb am 23.10.2021 um 15:20= : > >>> I=E2=80=99d like a book with chapters to have sections/parts, e.g. so= mething > that groups a few \chapter elements together. Is there support for this i= n > 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 =E2=80=982. Chapter=E2=80=99 > > - what is a good way to create actual RHS =E2=80=98title=E2=80=99 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=3Dempty] > \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 i= t > to: > %% \define[2]\placePartTitle{\midaligned{\convertnumber[Romannumerals][#1= ] > #2}} > > \definehead [Part] [part] > \setuphead[Part] > [ page=3Dright, > placehead=3Dyes, > style=3D{\stylePartTitle}, %% this is just from a \definefont > before=3D{\setups{PartSetup}}, > command=3D\placePartTitle, > ] > > With \setuplayout[location=3Ddoublesided] this then comes out on the RHS. > > For the ToC, I use: > > \setuplist [alternative=3Db] > \setuplist [Part] > [ headnumber=3Dno, > margin=3D0cm, > width=3D0cm, > distance=3D0cm, > style=3D\tocStylePartTitle, > ] > \setuplist [Chapter] > [ headnumber=3Dno, > margin=3D1em, > width=3D0cm, > distance=3D0cm, > ] > \setupcombinedlist [content] [list=3D{Part,Chapter}] > > then \placecontent prints the chapter titles indented under each part. > > HTH > =E2=80=94 > Bruce Horrocks > Hampshire, UK > > > > =E2=80=94 > 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 > > _________________________________________________________________________= __________ > --=20 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 * --000000000000a3136905cf151a16 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Worth just quickly noting that the defaul= t for \part is placehead=3Dno. You need to explicitly set placehead=3Dyes f= or it to actually output the heading. See=C2=A0https://wiki.contextgarden.net/Comman= d/_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> wr= ote:
>
>
>> On 23 Oct 2021, at 15:34, Wolfgang Schuster <wolfgang.schuster.list= s@gmail.com> wrote:
>>
>> =EF=BB=BF Gerben Wierda via ntg-context schrieb am 23.10.2021 um 1= 5:20:
>>> I=E2=80=99d like a book with chapters to have sections/parts, = e.g. something that groups a few \chapter elements together. Is there suppo= rt 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 =E2=80=982. Chapter=E2=80=99
> - what is a good way to create actual RHS =E2=80=98title=E2=80=99 page= s 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 \Par= t is below, \Chapter is very similar so I haven't included it.

%% Double rule above part title
\startsetups PartSetup
=C2=A0\setupheader[state=3Dempty]
=C2=A0\par
=C2=A0\startMPcode
=C2=A0 =C2=A0draw (0,2mm)--(TextWidth,2mm) withpen pensquare scaled 1.5mm ;=
=C2=A0 =C2=A0draw (0,0)--(TextWidth,0) withpen pensquare scaled 1.0mm ;
=C2=A0 =C2=A0clip currentpicture to unitsquare yscaled 1cm xscaled TextWidt= h
=C2=A0\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]
=C2=A0[ page=3Dright,
=C2=A0 =C2=A0placehead=3Dyes,
=C2=A0 =C2=A0style=3D{\stylePartTitle}, %% this is just from a \definefont<= br> =C2=A0 =C2=A0before=3D{\setups{PartSetup}},
=C2=A0 =C2=A0command=3D\placePartTitle,
=C2=A0]

With \setuplayout[location=3Ddoublesided] this then comes out on the RHS.
For the ToC, I use:

\setuplist [alternative=3Db]
\setuplist [Part]
=C2=A0[ headnumber=3Dno,
=C2=A0 =C2=A0margin=3D0cm,
=C2=A0 =C2=A0width=3D0cm,
=C2=A0 =C2=A0distance=3D0cm,
=C2=A0 =C2=A0style=3D\tocStylePartTitle,
=C2=A0]
\setuplist [Chapter]
=C2=A0[ headnumber=3Dno,
=C2=A0 =C2=A0margin=3D1em,
=C2=A0 =C2=A0width=3D0cm,
=C2=A0 =C2=A0distance=3D0cm,
=C2=A0]
\setupcombinedlist [content] [list=3D{Part,Chapter}]

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

HTH
=E2=80=94
Bruce Horrocks
Hampshire, UK



=E2=80=94
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________


--
Duncan Hothersall,= Operations Director
= CAPDM Limited - Online Program Enablers
0131 677 2400= =C2=A0=C2=A0www.capdm.com
Registered in Scotland: SC168970=C2=A0 =C2=A0 =C2=A0 =C2=A0VA= T: 682 846 983
Registered address:=C2=A020 = Forth Street Edinburgh EH1 3LH UK

Capture,= author, publish, deliver and manage your learning materials.
--000000000000a3136905cf151a16-- --===============2637818115190910651== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============2637818115190910651==--