TOC : Changing the interline spacing of titles, for long titles on multiple lines
Hi, Is there a way to have, in the table of contents, the titles (of chapters, sections, subsections, etc.) with a different interline spacing than the rest of the TOC ?My TOC interline spacing is set at 1.5 (4.2ex), but I would like to have the long titles on multiples lines being only single interline spaced (2.8ex).Is there something I could add in the \setuplist[chapter] command ? Thanks for any hint ! \setupinterlinespace[line=4.2ex] % 1.5 interline \setuplabeltext[chapter=CHAPITRE~]\define[3]\ChapterList{ \blank\par\noindent\currentlistsymbol\crlf #2\enspace\listdots\enspace #3\par\blank[0.1cm]}\setupcombinedlist[content][level=3,alternative=c]\setuplist[chapter][ label=yes, alternative=command, command=\ChapterList, ] \starttext \completecontent \startbodymatter\chapter{THIS VERY VERY VERY VERY VERY VERY VERY VERY LONG TITLE SHOULD BE SINGLE INTERLINE-SPACED (line=2.8ex)}\section{THIS VERY VERY VERY VERY LONG TITLE SHOULD BE SINGLE INTERLINE-SPACED (line=2.8ex)}\subsection{THIS VERY VERY VERY VERY LONG TITLE SHOULD BE SINGLE INTERLINE-SPACED (line=2.8ex)}\stopbodymatter \stoptext Mathieu
Am 25.05.2011 um 00:18 schrieb Mathieu DUPONT:
Hi,
Is there a way to have, in the table of contents, the titles (of chapters, sections, subsections, etc.) with a different interline spacing than the rest of the TOC ? My TOC interline spacing is set at 1.5 (4.2ex), but I would like to have the long titles on multiples lines being only single interline spaced (2.8ex). Is there something I could add in the \setuplist[chapter] command ?
Thanks for any hint !
Something like this? \setuplist[chapter][ label=yes, alternative=c,style={\switchtobodyfont[10pt]\bf\setuplocalinterlinespace[line=4.2ex]}, before={\blank[line]},after={\blank[halfline]} ] \setuplist[section,subsection][ label=yes, alternative=c,style={\switchtobodyfont[10pt]\setuplocalinterlinespace[line=2.8ex]}, before={\blank[line]},after={\blank[halfline]} ] \starttext \completecontent \startbodymatter \chapter{THIS VERY VERY VERY VERY VERY VERY VERY VERY LONG TITLE\\SHOULD BE BOLD INTERLINE-SPACED (line=4.2ex)} \section{THIS VERY VERY VERY VERY LONG TITLE SHOULD BE SINGLE INTERLINE-SPACED (line=2.8ex)} \subsection{THIS VERY VERY VERY VERY LONG TITLE SHOULD BE SINGLE INTERLINE-SPACED (line=2.8ex)} \stopbodymatter \stoptext Steffen
Actually, the \setuplocalinterlinespace[line=4.2ex] command allowed me to get what I wanted.Thank you very much !What I did (see below for the interested) is I putbefore={\setuplocalinterlinespace[line=2.8ex]\blank[halfline]to change the interline space of titles, but I also addedafter={\setuplocalinterlinespace[line=4.2ex]in order to put it back to the global setting of the page.That way, it interferes less with the rest of the layout, and I don't have to reajust interline spacing everywhere. Again, thanks for your help, it is greatly appreciated. \setupinterlinespace[line=4.2ex] \setuplabeltext[chapter=CHAPITRE~]\setupcombinedlist[content][level=3,alternative=c,]\define[3]\ChapterList{ \setuplocalinterlinespace[line=2.8ex] \blank \par\noindent\currentlistsymbol\crlf #2\enspace\listdots\enspace #3\par \setuplocalinterlinespace[line=4.2ex] }\setuplist[chapter][ label=yes, alternative=command, command=\ChapterList, ]\setuplist[section][ before={\setuplocalinterlinespace[line=2.8ex]\blank[halfline]}, margin=0cm, width=1.25cm, distance=0cm, after={\setuplocalinterlinespace[line=4.2ex]}, ]\setuplist[subsection][ before={\setuplocalinterlinespace[line=2.8ex]\blank[halfline]}, margin=1.25cm, after={\setuplocalinterlinespace[line=4.2ex]}, ] \starttext \completecontent \startbodymatter\chapter{THIS VERY VERY VERY VERY VERY VERY LONG TITLE SHOULD BE SINGLE INTERLINE-SPACED (line=2.8ex)}\section{THIS VERY VERY VERY VERY LONG TITLE SHOULD BE SINGLE INTERLINE-SPACED (line=2.8ex)}\subsection{THIS VERY VERY VERY LONG TITLE SHOULD BE SINGLE INTERLINE-SPACED (line=2.8ex)}\stopbodymatter \stoptext Mathieu
From: context@st.estfiles.de Date: Wed, 25 May 2011 10:04:04 +0200 To: ntg-context@ntg.nl Subject: Re: [NTG-context] TOC : Changing the interline spacing of titles, for long titles on multiple lines
Am 25.05.2011 um 00:18 schrieb Mathieu DUPONT:
Hi,
Is there a way to have, in the table of contents, the titles (of chapters, sections, subsections, etc.) with a different interline spacing than the rest of the TOC ? My TOC interline spacing is set at 1.5 (4.2ex), but I would like to have the long titles on multiples lines being only single interline spaced (2.8ex). Is there something I could add in the \setuplist[chapter] command ?
Thanks for any hint !
Something like this?
\setuplist[chapter][ label=yes, alternative=c,style={\switchtobodyfont[10pt]\bf\setuplocalinterlinespace[line=4.2ex]}, before={\blank[line]},after={\blank[halfline]} ]
\setuplist[section,subsection][ label=yes, alternative=c,style={\switchtobodyfont[10pt]\setuplocalinterlinespace[line=2.8ex]}, before={\blank[line]},after={\blank[halfline]} ]
\starttext
\completecontent
\startbodymatter \chapter{THIS VERY VERY VERY VERY VERY VERY VERY VERY LONG TITLE\\SHOULD BE BOLD INTERLINE-SPACED (line=4.2ex)} \section{THIS VERY VERY VERY VERY LONG TITLE SHOULD BE SINGLE INTERLINE-SPACED (line=2.8ex)} \subsection{THIS VERY VERY VERY VERY LONG TITLE SHOULD BE SINGLE INTERLINE-SPACED (line=2.8ex)} \stopbodymatter
\stoptext
Steffen ___________________________________________________________________________________ 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 25.05.2011 um 00:18 schrieb Mathieu DUPONT:
Hi,
Is there a way to have, in the table of contents, the titles (of chapters, sections, subsections, etc.) with a different interline spacing than the rest of the TOC ? My TOC interline spacing is set at 1.5 (4.2ex), but I would like to have the long titles on multiples lines being only single interline spaced (2.8ex). Is there something I could add in the \setuplist[chapter] command ?
Thanks for any hint !
\setupinterlinespace[line=4.2ex] % 1.5 interline
\setuplabeltext[chapter=CHAPITRE~] \define[3]\ChapterList{ \blank\par\noindent\currentlistsymbol\crlf #2\enspace\listdots\enspace #3\par\blank[0.1cm]} \setupcombinedlist[content][level=3,alternative=c] \setuplist[chapter][ label=yes, alternative=command, command=\ChapterList, ]
\starttext
\completecontent
\start\setupinterlinespace[line=2.8ex] \completecontent \stop Wolfgang
Interesting command to know.Thank you. However I only wanted the titles to be 2.8ex and the rest of the TOC to be 4.2ex.Please see previous message for the solution I got. Thanks Wolfgang. Mathieu From: schuster.wolfgang@googlemail.com Date: Wed, 25 May 2011 17:36:04 +0200 To: ntg-context@ntg.nl Subject: Re: [NTG-context] TOC : Changing the interline spacing of titles, for long titles on multiple lines Am 25.05.2011 um 00:18 schrieb Mathieu DUPONT:Hi, Is there a way to have, in the table of contents, the titles (of chapters, sections, subsections, etc.) with a different interline spacing than the rest of the TOC ?My TOC interline spacing is set at 1.5 (4.2ex), but I would like to have the long titles on multiples lines being only single interline spaced (2.8ex).Is there something I could add in the \setuplist[chapter] command ? Thanks for any hint ! \setupinterlinespace[line=4.2ex] % 1.5 interline \setuplabeltext[chapter=CHAPITRE~]\define[3]\ChapterList{ \blank\par\noindent\currentlistsymbol\crlf #2\enspace\listdots\enspace #3\par\blank[0.1cm]}\setupcombinedlist[content][level=3,alternative=c]\setuplist[chapter][ label=yes, alternative=command, command=\ChapterList, ] \starttext \completecontent \start\setupinterlinespace[line=2.8ex]\completecontent\stop 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 25.05.2011 um 17:42 schrieb Mathieu DUPONT:
Interesting command to know. Thank you.
However I only wanted the titles to be 2.8ex and the rest of the TOC to be 4.2ex. Please see previous message for the solution I got.
This is the same as you do (the \blank’s in your example use the reduced interlinespace too) but with less lineskip changes. \define\PlaceContent {\bgroup \title{Contents} \setupinterlinespace[line=2.8ex] \placecontent \stop} \starttext \PlaceContent ... \stoptext Wolfgang
When I run this code, every lines of the TOC become 2.8ex.What I needed is every lines to be 2.8ex, except for the last line of each title, which should be 4.2 ex.In other words, all short titles that fit on one line will be 4.2ex (they're all last lines), but, only for the long titles on multiple lines, their first lines will be 2.8ex and their last line will be 4.2ex.To resume the result I seek, the TOC is 4.2ex, but when a long title is on multiple lines it should stick together (2.8ex). Mathieu From: schuster.wolfgang@googlemail.com Date: Wed, 25 May 2011 17:49:18 +0200 To: ntg-context@ntg.nl Subject: Re: [NTG-context] TOC : Changing the interline spacing of titles, for long titles on multiple lines Am 25.05.2011 um 17:42 schrieb Mathieu DUPONT:Interesting command to know.Thank you. However I only wanted the titles to be 2.8ex and the rest of the TOC to be 4.2ex.Please see previous message for the solution I got. This is the same as you do (the \blank’s in your example usethe reduced interlinespace too) but with less lineskip changes. \define\PlaceContent {\bgroup \title{Contents} \setupinterlinespace[line=2.8ex] \placecontent \stop} \starttext\PlaceContent...\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 ___________________________________________________________________________________
Am 25.05.2011 um 18:02 schrieb Mathieu DUPONT:
When I run this code, every lines of the TOC become 2.8ex. What I needed is every lines to be 2.8ex, except for the last line of each title, which should be 4.2 ex. In other words, all short titles that fit on one line will be 4.2ex (they're all last lines), but, only for the long titles on multiple lines, their first lines will be 2.8ex and their last line will be 4.2ex. To resume the result I seek, the TOC is 4.2ex, but when a long title is on multiple lines it should stick together (2.8ex).
You want something like this? \starttext \setbox0\vbox{\input ward\par} \doloop {\setupinterlinespace[line=2.8ex] \ifdim\ht0<\lineheight \setupinterlinespace[line=4.2ex] \box0 \exitloop \else \setbox2\vsplit0 to \baselineskip \box2 \fi} \stoptext Wolfgang
That's interesting. I am sure how to integrate it in my TOC though. I would have to replace both \box0 and \box2 by something like \placecontent[current] or \placecurrentcontent. Does such a thing exist ? Mathieu From: schuster.wolfgang@googlemail.com Date: Wed, 25 May 2011 18:12:37 +0200 To: ntg-context@ntg.nl Subject: Re: [NTG-context] TOC : Changing the interline spacing of titles, for long titles on multiple lines Am 25.05.2011 um 18:02 schrieb Mathieu DUPONT:When I run this code, every lines of the TOC become 2.8ex.What I needed is every lines to be 2.8ex, except for the last line of each title, which should be 4.2 ex.In other words, all short titles that fit on one line will be 4.2ex (they're all last lines), but, only for the long titles on multiple lines, their first lines will be 2.8ex and their last line will be 4.2ex.To resume the result I seek, the TOC is 4.2ex, but when a long title is on multiple lines it should stick together (2.8ex). You want something like this? \starttext \setbox0\vbox{\input ward\par} \doloop {\setupinterlinespace[line=2.8ex] \ifdim\ht0<\lineheight \setupinterlinespace[line=4.2ex] \box0 \exitloop \else \setbox2\vsplit0 to \baselineskip \box2 \fi} \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 ___________________________________________________________________________________
Am 25.05.2011 um 19:48 schrieb Mathieu DUPONT:
That's interesting.
I am sure how to integrate it in my TOC though.
I would have to replace both \box0 and \box2 by something like \placecontent[current] or \placecurrentcontent.
Does such a thing exist ?
You need your list command for this but for me such a layout is confusing and looks like something went wrong with your document. Wolfgang
participants (3)
-
Mathieu DUPONT
-
Steffen Wolfrum
-
Wolfgang Schuster