From: Wolfgang Schuster via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
Adam Reviczky via ntg-context <ntg-context@ntg.nl>
Cc: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>,
Adam Reviczky <reviczky@gmail.com>
Subject: Re: TOC labeltext and no partlabel
Date: Wed, 25 Aug 2021 12:46:00 +0200 [thread overview]
Message-ID: <d99e9ab5-2989-a583-5413-8426a80d2eff@gmail.com> (raw)
In-Reply-To: <CABaoHuvZZc6nMmwtDk+3RaLnuTSK8sqkojX_yUQnc6GbT9jZDw@mail.gmail.com>
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-title-in-toc
>
> 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
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2021-08-25 10:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-25 0:02 Adam Reviczky via ntg-context
2021-08-25 10:46 ` Wolfgang Schuster via ntg-context [this message]
2021-08-25 13:41 ` Adam Reviczky via ntg-context
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d99e9ab5-2989-a583-5413-8426a80d2eff@gmail.com \
--to=ntg-context@ntg.nl \
--cc=reviczky@gmail.com \
--cc=wolfgang.schuster.lists@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).