ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Calling in chapter number in list={}
@ 2022-03-16 21:03 jbf via ntg-context
  2022-03-17 10:18 ` Henning Hraban Ramm via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: jbf via ntg-context @ 2022-03-16 21:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: jbf


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

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

[-- Attachment #1.2: Type: text/html, Size: 3265 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] 5+ messages in thread

* Re: Calling in chapter number in list={}
  2022-03-16 21:03 Calling in chapter number in list={} jbf via ntg-context
@ 2022-03-17 10:18 ` Henning Hraban Ramm via ntg-context
  2022-03-17 10:31   ` Jean-Pierre Delange via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2022-03-17 10:18 UTC (permalink / raw)
  To: jbf via ntg-context; +Cc: Henning Hraban Ramm

Hi Julian,
have fun with:

\currentlistentrylocation
= Laufende Nummer des Listeneintrags \namedstructureheadlocation{section}
= Abschnittsnummer der angegebenen Hier­archiestufe (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
___________________________________________________________________________________
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] 5+ messages in thread

* Re: Calling in chapter number in list={}
  2022-03-17 10:18 ` Henning Hraban Ramm via ntg-context
@ 2022-03-17 10:31   ` Jean-Pierre Delange via ntg-context
  2022-03-17 10:36     ` Henning Hraban Ramm via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Pierre Delange via ntg-context @ 2022-03-17 10:31 UTC (permalink / raw)
  To: Henning Hraban Ramm via ntg-context; +Cc: Jean-Pierre Delange


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

Which could be translated in English !

\currentlistentrylocation = Consecutive number of the list entry 
\namedstructureheadlocation{section} = Section number of the specified 
hierarchy level (chapter, section, etc.) \currentlistentrynumber = 
section number of the current list entry \currentlistentrytitle = 
Heading of the current list entry \currentlistentrypagenumber = page 
number of the current list entry

Le 17/03/2022 à 11:18, Henning Hraban Ramm via ntg-context a écrit :
> \currentlistentrylocation
> = Laufende Nummer des Listeneintrags \namedstructureheadlocation{section}
> = Abschnittsnummer der angegebenen Hier­archiestufe (chapter, section 
> usw.)
> \currentlistentrynumber
> = Abschnittsnummer des aktuellen Listen­ eintrags
> \currentlistentrytitle
> = Überschrift des aktuellen Listeneintrags
> \currentlistentrypagenumber
> = Seitenzahl des aktuellen Listeneintrags 

-- 
Jean-Pierre Delange
Ancients&Moderns
Professeur Agrégé de Philosophie (HC)

[-- Attachment #1.2: Type: text/html, Size: 2024 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] 5+ messages in thread

* Re: Calling in chapter number in list={}
  2022-03-17 10:31   ` Jean-Pierre Delange via ntg-context
@ 2022-03-17 10:36     ` Henning Hraban Ramm via ntg-context
  2022-03-17 20:57       ` jbf via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2022-03-17 10:36 UTC (permalink / raw)
  To: Jean-Pierre Delange via ntg-context; +Cc: Henning Hraban Ramm

Am 17.03.22 um 11:31 schrieb Jean-Pierre Delange via ntg-context:
> Which could be translated in English !

Yes, I was a bit lazy and Thunderbird also messed up the line breaking.

HR
___________________________________________________________________________________
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] 5+ messages in thread

* Re: Calling in chapter number in list={}
  2022-03-17 10:36     ` Henning Hraban Ramm via ntg-context
@ 2022-03-17 20:57       ` jbf via ntg-context
  0 siblings, 0 replies; 5+ messages in thread
From: jbf via ntg-context @ 2022-03-17 20:57 UTC (permalink / raw)
  To: Henning Hraban Ramm via ntg-context; +Cc: jbf, mailing list for ConTeXt users

But thanks anyway and also to Jean-Pierre (although I do understand 
sufficient German and could also have made headway in French if it came 
to that!). The \currentlistentry... options were what I needed. I was 
playing with wrong options (for this particular problem) like 
\currentheadnumber.

Julian


On 17/3/22 21:36, Henning Hraban Ramm via ntg-context wrote:

> Am 17.03.22 um 11:31 schrieb Jean-Pierre Delange via ntg-context:
>> Which could be translated in English !
>
> Yes, I was a bit lazy and Thunderbird also messed up the line breaking.
>
> HR
> ___________________________________________________________________________________ 
>
> 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
> ___________________________________________________________________________________ 
>
___________________________________________________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2022-03-17 20:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 21:03 Calling in chapter number in list={} jbf via ntg-context
2022-03-17 10:18 ` Henning Hraban Ramm via ntg-context
2022-03-17 10:31   ` Jean-Pierre Delange via ntg-context
2022-03-17 10:36     ` Henning Hraban Ramm via ntg-context
2022-03-17 20:57       ` jbf 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).