ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* TOC labeltext and no partlabel
@ 2021-08-25  0:02 Adam Reviczky via ntg-context
  2021-08-25 10:46 ` Wolfgang Schuster via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Reviczky via ntg-context @ 2021-08-25  0:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Adam Reviczky


[-- Attachment #1.1: Type: text/plain, Size: 913 bytes --]

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

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

[-- Attachment #1.2: Type: text/html, Size: 1437 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: TOC labeltext and no partlabel
  2021-08-25  0:02 TOC labeltext and no partlabel Adam Reviczky via ntg-context
@ 2021-08-25 10:46 ` Wolfgang Schuster via ntg-context
  2021-08-25 13:41   ` Adam Reviczky via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2021-08-25 10:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Adam Reviczky via ntg-context
  Cc: Wolfgang Schuster, Adam Reviczky

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: TOC labeltext and no partlabel
  2021-08-25 10:46 ` Wolfgang Schuster via ntg-context
@ 2021-08-25 13:41   ` Adam Reviczky via ntg-context
  0 siblings, 0 replies; 3+ messages in thread
From: Adam Reviczky via ntg-context @ 2021-08-25 13:41 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: Adam Reviczky, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1934 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 2808 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-25 13:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25  0:02 TOC labeltext and no partlabel Adam Reviczky via ntg-context
2021-08-25 10:46 ` Wolfgang Schuster via ntg-context
2021-08-25 13:41   ` Adam Reviczky via ntg-context

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).