TOC : Chapter title under its number (separate lines)
Hi, Is there a simple way to obtain the following result in the table of content : ContentsCHAPTER 1Title of chapter 21.1 Title of section 2 (the chapter title underneath its number and left aligned, just like everything else) The following code used to do the job with MkII but it doesn't anymore with MkIV : \setuplabeltext[chapter=CHAPTER~]\setuplist[chapter][label=yes, style={\blank[0cm]}] \starttext \startfrontmatter\completecontent\stopfrontmatter \startbodymatter\chapter{Title of chapter}\section{Title of section}\stopbodymatter \stoptext Instead, I get something like this (I hope it turns out readable through the email) : Contents CHAPTER 1 Title of chapter 21.1 Title of section 2 where the 2 lines of the chapter, together with their alignment with the frame, get tossed to the right... Thanks in advance ! Mathieu
Am 24.05.2011 um 00:59 schrieb Mathieu DUPONT:
Hi,
Is there a simple way to obtain the following result in the table of content :
Contents CHAPTER 1 Title of chapter 2 1.1 Title of section 2
(the chapter title underneath its number and left aligned, just like everything else)
The following code used to do the job with MkII but it doesn't anymore with MkIV :
\setuplabeltext[chapter=CHAPTER~] \setuplist[chapter][label=yes, style={\blank[0cm]}]
\starttext
\startfrontmatter \completecontent \stopfrontmatter
\startbodymatter \chapter{Title of chapter} \section{Title of section} \stopbodymatter
\stoptext
Instead, I get something like this (I hope it turns out readable through the email) :
Contents CHAPTER 1 Title of chapter 2 1.1 Title of section 2
where the 2 lines of the chapter, together with their alignment with the frame, get tossed to the right...
I do get with MkIV the first example like you expect but “style={\blank[0cm]}” is the wrong way. Such a layout can be easily done with your own list-command for chapter but the labeltext is tricky: \setuplabeltext[chapter=CHAPTER~] % \define[3]\ChapterList % no label! % {#1\crlf#2\wordright{#3}} % \define[3]\ChapterList % fixed label, wrong for appendices! % {\labeltext{chapter}#1\crlf#2\wordright{#3}} \define[3]\ChapterList {\currentlistsymbol\crlf#2\wordright{#3}} \setuplist[chapter][label=yes,alternative=command,command=\ChapterList] \starttext \startfrontmatter \completecontent \stopfrontmatter \startbodymatter \chapter{Title of chapter} \section{Title of section} \stopbodymatter \stoptext Wolfgang
That was very useful !! Again, thank you very much Wolfgang ! Mathieu From: schuster.wolfgang@googlemail.com Date: Tue, 24 May 2011 13:42:41 +0200 To: ntg-context@ntg.nl Subject: Re: [NTG-context] TOC : Chapter title under its number (separate lines) Am 24.05.2011 um 00:59 schrieb Mathieu DUPONT:Hi, Is there a simple way to obtain the following result in the table of content : ContentsCHAPTER 1Title of chapter 21.1 Title of section 2 (the chapter title underneath its number and left aligned, just like everything else) The following code used to do the job with MkII but it doesn't anymore with MkIV : \setuplabeltext[chapter=CHAPTER~]\setuplist[chapter][label=yes, style={\blank[0cm]}] \starttext \startfrontmatter\completecontent\stopfrontmatter \startbodymatter\chapter{Title of chapter}\section{Title of section}\stopbodymatter \stoptext Instead, I get something like this (I hope it turns out readable through the email) : Contents CHAPTER 1 Title of chapter 21.1 Title of section 2 where the 2 lines of the chapter, together with their alignment with the frame, get tossed to the right... I do get with MkIV the first example like you expect but “style={\blank[0cm]}”is the wrong way. Such a layout can be easily done with your own list-commandfor chapter but the labeltext is tricky: \setuplabeltext[chapter=CHAPTER~] % \define[3]\ChapterList % no label!% {#1\crlf#2\wordright{#3}} % \define[3]\ChapterList % fixed label, wrong for appendices!% {\labeltext{chapter}#1\crlf#2\wordright{#3}} \define[3]\ChapterList {\currentlistsymbol\crlf#2\wordright{#3}} \setuplist[chapter][label=yes,alternative=command,command=\ChapterList] \starttext \startfrontmatter\completecontent\stopfrontmatter \startbodymatter\chapter{Title of chapter}\section{Title of section}\stopbodymatter \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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
If now I add the line : \setupcombinedlist[content][alternative=c] it doesn't add the dots to the chapter lines anymore,and I can't add \setuplist[chapter][alternative=c] since the "alternative" parameter is already taken by the new "command" Is there a way to add the "dots" option within my new "command", or somewhere else ? Mathieu From: mathieudupont@hotmail.com To: ntg-context@ntg.nl Date: Tue, 24 May 2011 09:09:39 -0400 Subject: Re: [NTG-context] TOC : Chapter title under its number (separate lines) That was very useful !! Again, thank you very much Wolfgang ! Mathieu From: schuster.wolfgang@googlemail.com Date: Tue, 24 May 2011 13:42:41 +0200 To: ntg-context@ntg.nl Subject: Re: [NTG-context] TOC : Chapter title under its number (separate lines) Am 24.05.2011 um 00:59 schrieb Mathieu DUPONT:Hi, Is there a simple way to obtain the following result in the table of content : ContentsCHAPTER 1Title of chapter 21.1 Title of section 2 (the chapter title underneath its number and left aligned, just like everything else) The following code used to do the job with MkII but it doesn't anymore with MkIV : \setuplabeltext[chapter=CHAPTER~]\setuplist[chapter][label=yes, style={\blank[0cm]}] \starttext \startfrontmatter\completecontent\stopfrontmatter \startbodymatter\chapter{Title of chapter}\section{Title of section}\stopbodymatter \stoptext Instead, I get something like this (I hope it turns out readable through the email) : Contents CHAPTER 1 Title of chapter 21.1 Title of section 2 where the 2 lines of the chapter, together with their alignment with the frame, get tossed to the right... I do get with MkIV the first example like you expect but “style={\blank[0cm]}”is the wrong way. Such a layout can be easily done with your own list-commandfor chapter but the labeltext is tricky: \setuplabeltext[chapter=CHAPTER~] % \define[3]\ChapterList % no label!% {#1\crlf#2\wordright{#3}} % \define[3]\ChapterList % fixed label, wrong for appendices!% {\labeltext{chapter}#1\crlf#2\wordright{#3}} \define[3]\ChapterList {\currentlistsymbol\crlf#2\wordright{#3}} \setuplist[chapter][label=yes,alternative=command,command=\ChapterList] \starttext \startfrontmatter\completecontent\stopfrontmatter \startbodymatter\chapter{Title of chapter}\section{Title of section}\stopbodymatter \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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Am 24.05.2011 um 15:33 schrieb Mathieu DUPONT:
If now I add the line :
\setupcombinedlist[content][alternative=c]
it doesn't add the dots to the chapter lines anymore, and I can't add
\setuplist[chapter][alternative=c]
since the "alternative" parameter is already taken by the new "command"
Is there a way to add the "dots" option within my new "command", or somewhere else ?
\define[3]\ChapterList {\currentlistsymbol\crlf#2\enspace\listdots\enspace#3} Wolfgang
Thank you !However, this resulted in something weird with my appendices, but adding \blank in the front fixes the problem : \define[3]\ChapterList {\blank\currentlistsymbol\crlf#2\enspace\listdots\enspace#3} I am starting to think there is something mysterious with this \blank command... Mathieu From: schuster.wolfgang@googlemail.com Date: Tue, 24 May 2011 16:04:44 +0200 To: ntg-context@ntg.nl Subject: Re: [NTG-context] TOC : Chapter title under its number (separate lines) Am 24.05.2011 um 15:33 schrieb Mathieu DUPONT:If now I add the line : \setupcombinedlist[content][alternative=c] it doesn't add the dots to the chapter lines anymore,and I can't add \setuplist[chapter][alternative=c] since the "alternative" parameter is already taken by the new "command" Is there a way to add the "dots" option within my new "command", or somewhere else ? \define[3]\ChapterList {\currentlistsymbol\crlf#2\enspace\listdots\enspace#3} 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Am 24.05.2011 um 16:13 schrieb Mathieu DUPONT:
Thank you ! However, this resulted in something weird with my appendices, but adding \blank in the front fixes the problem :
\define[3]\ChapterList {\blank\currentlistsymbol\crlf#2\enspace\listdots\enspace#3}
I am starting to think there is something mysterious with this \blank command...
Not really, the commands just ends the last line and inserts a blank line. When you don’t want an empty line you can define the chapter entry as: \define[3]\ChapterList {\par\noindent\currentlistsymbol\crlf#2\enspace\listdots\enspace#3\par} Wolfgang
Things are getting much clearer now.Thank you ! Mathieu From: schuster.wolfgang@googlemail.com Date: Tue, 24 May 2011 16:20:13 +0200 To: ntg-context@ntg.nl Subject: Re: [NTG-context] TOC : Chapter title under its number (separate lines) Am 24.05.2011 um 16:13 schrieb Mathieu DUPONT:Thank you !However, this resulted in something weird with my appendices, but adding \blank in the front fixes the problem : \define[3]\ChapterList {\blank\currentlistsymbol\crlf#2\enspace\listdots\enspace#3} I am starting to think there is something mysterious with this \blank command... Not really, the commands just ends the last line and inserts a blank line.When you don’t want an empty line you can define the chapter entry as: \define[3]\ChapterList {\par\noindent\currentlistsymbol\crlf#2\enspace\listdots\enspace#3\par} 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
On Tue, May 24, 2011 at 01:42:41PM +0200, Wolfgang Schuster wrote:
Am 24.05.2011 um 00:59 schrieb Mathieu DUPONT:
Hi,
Is there a simple way to obtain the following result in the table of content :
Contents CHAPTER 1 Title of chapter 2 1.1 Title of section 2
(the chapter title underneath its number and left aligned, just like everything else)
The following code used to do the job with MkII but it doesn't anymore with MkIV :
\setuplabeltext[chapter=CHAPTER~] \setuplist[chapter][label=yes, style={\blank[0cm]}] \starttext
\startfrontmatter \completecontent \stopfrontmatter
\startbodymatter \chapter{Title of chapter} \section{Title of section} \stopbodymatter
\stoptext
Instead, I get something like this (I hope it turns out readable through the email) :
Contents CHAPTER 1 Title of chapter 2 1.1 Title of section 2
where the 2 lines of the chapter, together with their alignment with the frame, get tossed to the right...
I do get with MkIV the first example like you expect but “style={\blank[0cm]}” is the wrong way. Such a layout can be easily done with your own list-command for chapter but the labeltext is tricky:
\setuplabeltext[chapter=CHAPTER~]
% \define[3]\ChapterList % no label! % {#1\crlf#2\wordright{#3}}
% \define[3]\ChapterList % fixed label, wrong for appendices! % {\labeltext{chapter}#1\crlf#2\wordright{#3}}
\define[3]\ChapterList {\currentlistsymbol\crlf#2\wordright{#3}}
\setuplist[chapter][label=yes,alternative=command,command=\ChapterList]
\starttext
\startfrontmatter \completecontent \stopfrontmatter
\startbodymatter \chapter{Title of chapter} \section{Title of section} \stopbodymatter
\stoptext
Wolfgang
Wolfgang, This solution: [alternative=command,command=\ChapterList] breaks interaction; How can one get [interaction=all] to work? Alan
Am 26.05.2011 um 17:13 schrieb Alan Braslau:
This solution: [alternative=command,command=\ChapterList] breaks interaction; How can one get [interaction=all] to work?
Something like this: \setupinteraction[state=start] \define[3]\ChapterList {\vbox{#1\crlf#2\hfill#3}} \setuplist [chapter] [alternative=vertical, command=\ChapterList, interaction=all] \starttext \completecontent \chapter{One} \chapter{Two} \stoptext I guess i should take a closer look at “horizontal” and “vertical” because the label key has no effect for them. Wolfgang
On Thu, May 26, 2011 at 05:30:55PM +0200, Wolfgang Schuster wrote:
Am 26.05.2011 um 17:13 schrieb Alan Braslau:
This solution: [alternative=command,command=\ChapterList] breaks interaction; How can one get [interaction=all] to work?
Something like this:
\setupinteraction[state=start]
\define[3]\ChapterList {\vbox{#1\crlf#2\hfill#3}}
\setuplist [chapter] [alternative=vertical, command=\ChapterList, interaction=all]
\starttext
\completecontent
\chapter{One} \chapter{Two}
\stoptext
I guess i should take a closer look at “horizontal” and “vertical” because the label key has no effect for them.
Wolfgang
\define[3]\ChapterList {\vbox{\par\noindent\currentlistsymbol#1\crlf#2\enspace\listdots\enspace#3}} \setuplist[chapter][label=yes,alternative=vertical,command=\ChapterList,interaction=all] Almost works. Almost in that all lines get indented by one level, and then the page number (and the title if it is long and multi-line) stick(s) out by this much on the right. The manual is a bit cryptic concerning horizontal and vertical: "As an alternative for none, we can use horizontal and vertical. Both commands have their spacing tuned for typesetting lists in for instance menus." Alan
Am 26.05.2011 um 18:48 schrieb Alan Braslau:
\define[3]\ChapterList {\vbox{\par\noindent\currentlistsymbol#1\crlf#2\enspace\listdots\enspace#3}}
Your \par is useless here because we’re in a box.
\setuplist[chapter][label=yes,alternative=vertical,command=\ChapterList,interaction=all]
Almost works. Almost in that all lines get indented by one level, and then the page number (and the title if it is long and multi-line) stick(s) out by this much on the right.
The manual is a bit cryptic concerning horizontal and vertical: "As an alternative for none, we can use horizontal and vertical. Both commands have their spacing tuned for typesetting lists in for instance menus."
I don’t read the manual very often, so i missed this. There are two ways to have a interactive list: 1. Patch the command alternative 2. Introduce a new alternative which has interactive support plus a few more missing features (e.g. label support) Wolfgang
On Thu, May 26, 2011 at 08:16:21PM +0200, Wolfgang Schuster wrote:
Am 26.05.2011 um 18:48 schrieb Alan Braslau:
\setuplist[chapter][label=yes,alternative=vertical,command=\ChapterList,interaction=all]
Almost works. Almost in that all lines get indented by one level, and then the page number (and the title if it is long and multi-line) stick(s) out by this much on the right.
The manual is a bit cryptic concerning horizontal and vertical: "As an alternative for none, we can use horizontal and vertical. Both commands have their spacing tuned for typesetting lists in for instance menus."
I don’t read the manual very often, so i missed this.
Before asking for help, I always 1) experiment 2) look in the manual(s) 3) search the mailing list 4) consult the wiki 5) try to understand the sources I'm sure that you start with the last step.
There are two ways to have a interactive list:
1. Patch the command alternative
2. Introduce a new alternative which has interactive support plus a few more missing features (e.g. label support)
Wolfgang
In fact, \setuplist [chapter] [label=yes] should work "out of the box". Currently, one must set: \setuplabeltext [chapter=Chapter ] % with trailing space; blank by default \setuplabeltext [appendix=Appendix ] % with trailing space; blank by default (This *should* be included in the language files, not redefined by the user. Indeed, "\setuphead [chapter] [label=no]" could be the default, not blanking out the labeltext.) Secondly, the spacing of the TOC is all wrong. This should not need patching to yield an acceptable result. Alan
As for the interaction patching, in the following example I can't figure out how to have, for the chapter lines, only "CHAPTER 1" being the interaction and not "the title" + "the dots line" + "the page number", as it is the case with this code.The example is minimal, but I left everything I am afraid could be dropped by a solution. Thanks for help ! \setupinteraction[state=start] \setuplabeltext[chapter=CHAPITRE~] \setupcombinedlist[content][ level=3, alternative=c, ] \unprotect\define[3]\ChapterList{\vbox{ \setuplocalinterlinespace[line=2.8ex] \listparameter\c!before \leftskip\listparameter\c!margin \noindent\currentlistsymbol\crlf#2\enspace\listdots\enspace#3 \par \listparameter\c!after \setuplocalinterlinespace[line=4.2ex] }}\protect \setuplist[chapter][ label=yes, alternative=vertical, command=\ChapterList, interaction=all, ] \starttext \startfrontmatter\placecontent\stopfrontmatter \startbodymatter\chapter{CHAPTER}\section{SECTION}\subsection{SUBSECTION}\stopbodymatter \stoptext Mathieu
Date: Fri, 27 May 2011 11:14:26 +0200 From: alan.braslau@cea.fr To: schuster.wolfgang@googlemail.com CC: ntg-context@ntg.nl Subject: Re: [NTG-context] TOC : Chapter title under its number (separate lines)
On Thu, May 26, 2011 at 08:16:21PM +0200, Wolfgang Schuster wrote:
Am 26.05.2011 um 18:48 schrieb Alan Braslau:
\setuplist[chapter][label=yes,alternative=vertical,command=\ChapterList,interaction=all]
Almost works. Almost in that all lines get indented by one level, and then the page number (and the title if it is long and multi-line) stick(s) out by this much on the right.
The manual is a bit cryptic concerning horizontal and vertical: "As an alternative for none, we can use horizontal and vertical. Both commands have their spacing tuned for typesetting lists in for instance menus."
I don’t read the manual very often, so i missed this.
Before asking for help, I always 1) experiment 2) look in the manual(s) 3) search the mailing list 4) consult the wiki 5) try to understand the sources I'm sure that you start with the last step.
There are two ways to have a interactive list:
1. Patch the command alternative
2. Introduce a new alternative which has interactive support plus a few more missing features (e.g. label support)
Wolfgang
In fact, \setuplist [chapter] [label=yes] should work "out of the box".
Currently, one must set: \setuplabeltext [chapter=Chapter ] % with trailing space; blank by default \setuplabeltext [appendix=Appendix ] % with trailing space; blank by default (This *should* be included in the language files, not redefined by the user. Indeed, "\setuphead [chapter] [label=no]" could be the default, not blanking out the labeltext.) Secondly, the spacing of the TOC is all wrong. This should not need patching to yield an acceptable result.
Alan ___________________________________________________________________________________ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
"interaction=sectionnumber" rather than "interaction=all" doesn't seem to help here... Alan On Fri, May 27, 2011 at 09:33:53AM -0400, Mathieu DUPONT wrote:
As for the interaction patching, in the following example I can't figure out how to have, for the chapter lines, only "CHAPTER 1" being the interaction and not "the title" + "the dots line" + "the page number", as it is the case with this code. The example is minimal, but I left everything I am afraid could be dropped by a solution.
Thanks for help !
\setupinteraction[state=start]
\setuplabeltext[chapter=CHAPITRE~]
\setupcombinedlist[content][ level=3, alternative=c, ] \unprotect \define[3]\ChapterList{\vbox{ \setuplocalinterlinespace[line=2.8ex] \listparameter\c!before \leftskip\listparameter\c!margin \noindent\currentlistsymbol\crlf#2\enspace\listdots\enspace#3 \par \listparameter\c!after \setuplocalinterlinespace[line=4.2ex] }} \protect
\setuplist[chapter][ label=yes, alternative=vertical, command=\ChapterList, interaction=all, ] \starttext
\startfrontmatter \placecontent \stopfrontmatter
\startbodymatter \chapter{CHAPTER} \section{SECTION} \subsection{SUBSECTION} \stopbodymatter
\stoptext
Mathieu
No, I had tried that.The problem is obviously caused by all the layers of patching, which I need though. Mathieu
Date: Fri, 27 May 2011 16:00:36 +0200 From: alan.braslau@cea.fr To: ntg-context@ntg.nl Subject: Re: [NTG-context] TOC : Chapter title under its number (separate lines)
"interaction=sectionnumber" rather than "interaction=all" doesn't seem to help here...
Alan
On Fri, May 27, 2011 at 09:33:53AM -0400, Mathieu DUPONT wrote:
As for the interaction patching, in the following example I can't figure out how to have, for the chapter lines, only "CHAPTER 1" being the interaction and not "the title" + "the dots line" + "the page number", as it is the case with this code. The example is minimal, but I left everything I am afraid could be dropped by a solution.
Thanks for help !
\setupinteraction[state=start]
\setuplabeltext[chapter=CHAPITRE~]
\setupcombinedlist[content][ level=3, alternative=c, ] \unprotect \define[3]\ChapterList{\vbox{ \setuplocalinterlinespace[line=2.8ex] \listparameter\c!before \leftskip\listparameter\c!margin \noindent\currentlistsymbol\crlf#2\enspace\listdots\enspace#3 \par \listparameter\c!after \setuplocalinterlinespace[line=4.2ex] }} \protect
\setuplist[chapter][ label=yes, alternative=vertical, command=\ChapterList, interaction=all, ] \starttext
\startfrontmatter \placecontent \stopfrontmatter
\startbodymatter \chapter{CHAPTER} \section{SECTION} \subsection{SUBSECTION} \stopbodymatter
\stoptext
Mathieu
___________________________________________________________________________________ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
participants (3)
-
Alan Braslau
-
Mathieu DUPONT
-
Wolfgang Schuster