[NTG-context] Calling in chapter number in list={}
Henning Hraban Ramm
texml at fiee.net
Thu Mar 17 11:18:00 CET 2022
Hi Julian,
have fun with:
\currentlistentrylocation
= Laufende Nummer des Listeneintrags \namedstructureheadlocation{section}
= Abschnittsnummer der angegebenen Hierarchiestufe (chapter, section usw.)
\currentlistentrynumber
= Abschnittsnummer des aktuellen Listen eintrags
\currentlistentrytitle
= Überschrift des aktuellen Listeneintrags
\currentlistentrypagenumber
= Seitenzahl des aktuellen Listeneintrags
(in German, because I copied it from my book)
If you use \setuplist[command=...], you should set
alternative=interactive, otherwise you don’t get bookmarks and links.
\define[3]\MeinEintrag{#3: #2 (#1)} % Seite: Titel (Nummer)
\setuplist[alternative=interactive,command=\MeinEintrag]
or define your own alternative:
\definelistalternative[j][renderingsetup=list:jbf]
\startsetups[list:jbf]
... \currentlist...
\stopsetups
HTH
Hraban
Am 16.03.22 um 22:03 schrieb jbf via ntg-context:
> I wonder if there is a way I can call in the chapter number in the TOC,
> although that number is not used for chapters as such. I know the
> chapter number is 'remembered' anyway, so there is probably a way I can
> call it in just for the TOC.
>
> The context for this question is the layout for book which comprises
> individual contributions, and each contribution has its own
> author/copyright (hence the individual chapters bear a title without a
> number, but the editor who has compiled these wants them numbered in the
> TOC).
>
> I currently call the author name in the TOC with:
>
> \define[1]\SectionTocEntry{%
>
> \leftaligned{#1}\par% title. \leftaligned is needed
>
> \hskip1cm\relax\doifnot{\structurelistuservariable{author}}{}{\structurelistuservariable{author}}%
>
> }
>
> \setuphead[chapter] of course includes number=no.
>
> \setuplist[chapter] is currently set as:
>
> [label=yes,distance=1.2cm,style=normal,before=\blank,after=\blank,textstyle=normal,alternative=c,textcommand=\SectionTocEntry,]
>
> And for the moment I simply use, as part of the \startchapter[]
> description: list={1. This is the rather long title of the first
> chapter, with the number included at the beginning}.
>
> While that gives me the number of the chapter, it does not give me
> correct indentation when the chapter title runs to more than one line.
> What I would prefer to do is to be able to call the chapter number
> automatically with placing 1., 2., etc. in list={}.
>
> Julian
More information about the ntg-context
mailing list