TOC labeltext and no partlabel
Hi, I have asked this question before, but now I cannot get it working again. https://ntg-context.ntg.narkive.com/lvvdNOQz/the-appendices-envrionment-and-... I want to set partlabels in my TOC but not in the document itself. The desired output would be: --- Contents Chapter 1 Bodypart Appendix A Appendix 1 Bodypart A Appendix --- Based on Wolfgang's example, I am trying this MWE: \setuplabeltext[en][chapter=Chapter~] \setuplabeltext[en][appendix=Appendix~] \setuplist[chapter][label=yes,width=fit,stopper=~] \setuphead[chapter][bodypartlabel=,appendixlabel=] \starttext \startfrontmatter \completecontent[label=section] \stopfrontmatter \startbodymatter \chapter{Bodypart} \stopbodymatter \startappendices \chapter{Appendix} \stopappendices \stoptext But that does not show the labels in the TOC (trying it with LMTX and MKIV). I must be doing something wrong. Any hints? Thanks, Adam
Adam Reviczky via ntg-context schrieb am 25.08.2021 um 02:02:
Hi,
I have asked this question before, but now I cannot get it working again. https://ntg-context.ntg.narkive.com/lvvdNOQz/the-appendices-envrionment-and-...
I want to set partlabels in my TOC but not in the document itself.
The desired output would be: --- Contents Chapter 1 Bodypart Appendix A Appendix
1 Bodypart A Appendix ---
[...]
But that does not show the labels in the TOC (trying it with LMTX and MKIV).
The easy way is to create a new heading for the appendices (e.g. \extrachapter) and set the label you want to use in the list. \setuplist [chapter] [label=chapter] \setuplist [extrachapter] [label=appendix] A complexer solution where you can keep \chapter in the appendices can be achieved with a customized number type and the use of the processor mechanism to set the labels in the list entries. \setuplist [chapter] [width=fit, distance=\spaceamount] \defineconversionset [bodypart:chapternumber] [] [bodypartnumber->n] \defineconversionset [appendix:chapternumber] [] [appendixnumber->A] \setuphead [chapter] [sectionconversionset=chapternumber] \startsectionblockenvironment [frontpart] \defineprocessor [bodypartnumber] [left=Chapter~] \defineprocessor [appendixnumber] [left=Appendix~] \stopsectionblockenvironment \starttext \startfrontmatter \completecontent \stopfrontmatter \startbodymatter \chapter{Bodypart} \stopbodymatter \startappendices \chapter{Appendix} \stopappendices \stoptext Wolfgang
Thank you very much Wolfgang for the explanation, Both solutions make sense now and work great. Regards, Adam On Wed, Aug 25, 2021 at 11:46 AM Wolfgang Schuster < wolfgang.schuster.lists@gmail.com> wrote:
Adam Reviczky via ntg-context schrieb am 25.08.2021 um 02:02:
Hi,
I have asked this question before, but now I cannot get it working again.
https://ntg-context.ntg.narkive.com/lvvdNOQz/the-appendices-envrionment-and-...
I want to set partlabels in my TOC but not in the document itself.
The desired output would be: --- Contents Chapter 1 Bodypart Appendix A Appendix
1 Bodypart A Appendix ---
[...]
But that does not show the labels in the TOC (trying it with LMTX and
MKIV).
The easy way is to create a new heading for the appendices (e.g. \extrachapter) and set the label you want to use in the list.
\setuplist [chapter] [label=chapter] \setuplist [extrachapter] [label=appendix]
A complexer solution where you can keep \chapter in the appendices can be achieved with a customized number type and the use of the processor mechanism to set the labels in the list entries.
\setuplist [chapter] [width=fit, distance=\spaceamount]
\defineconversionset [bodypart:chapternumber] [] [bodypartnumber->n] \defineconversionset [appendix:chapternumber] [] [appendixnumber->A]
\setuphead [chapter] [sectionconversionset=chapternumber]
\startsectionblockenvironment [frontpart]
\defineprocessor [bodypartnumber] [left=Chapter~] \defineprocessor [appendixnumber] [left=Appendix~]
\stopsectionblockenvironment
\starttext
\startfrontmatter \completecontent \stopfrontmatter
\startbodymatter \chapter{Bodypart} \stopbodymatter
\startappendices \chapter{Appendix} \stopappendices
\stoptext
Wolfgang
participants (2)
-
Adam Reviczky
-
Wolfgang Schuster