Re: [NTG-context] Linespacing in TOC
On 11/22/2013 9:44 PM, Jan Tosovsky wrote:
On 2013-11-20 Hans Hagen wrote:
On 11/19/2013 11:48 PM, Jan Tosovsky wrote:
I'd like to tweak a default TOC linespacing...
I've 'invented' this:
\setupcombinedlist[content][list=chapter, alternative=c]
\starttext
\title{Table of Contents} \setupinterlinespace[line=0.8ex] % too small, just for testing \placecontent \setupinterlinespace[line=2.75ex] %\setupinterlinespace[reset]
\startfrontmatter \chapter{Intro}text
text
text \startfrontmatter \startbodymatter \chapter{Chapter}text \stopbodymatter \startbackmatter \chapter{Appendix}text \stopbackmatter \stoptext
I cannot use simply the \completecontent command as the linespacing is effective already between the title and the first entry line... so I am splitting the title and the rest and set the linespacing just before list rendering. Finally I am resetting the value manually.
Are there better ways to tweak linespacing in TOC ?
\title{Table of Contents}
\start \setupinterlinespace[line=0.8ex] % too small, just for testing \placecontent \stop
Thanks for the hint.
But as I found, any value below 2.8ex causes interline inconsistencies when special cases appears, see the extreme below:
\starttext \start \setupinterlinespace[line=1.0ex] \placecontent \stop \chapter{aaaaaaaa}. % line without descenders precedes a line without ascenders \chapter{pppppppp}. % line with descenders is followed with a line with ascenders \chapter{ŠŠŠŠŠŠŠŠ}. % the result is an inconsistent baseline distance \stoptext
Is there any remedy for this? Can I fix the baseline distance somehow?
I have such cases in my TOC :-( (but not so extreme as here)
\definegridsnapping[crap] [fit,0.2] \setuplayout[grid=crap] but if you really need that kind of tweaks you might consider using a better font: if interlinespace is too small you will never get nice results you can try to play with the h/d ratio: \setupinterlinespace[line=2.8ex,height=0.8,depth=0.2] \showstruts \strut x \setupinterlinespace[line=2.8ex,height=0.7,depth=0.3] \showstruts \strut x or you can plug in a command (in the toc handler) that puts each line in a box with manipulated dimensions Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 2013-11-22 Hans Hagen wrote:
On 11/22/2013 9:44 PM, Jan Tosovsky wrote:
On 2013-11-20 Hans Hagen wrote:
On 11/19/2013 11:48 PM, Jan Tosovsky wrote:
I'd like to tweak a default TOC linespacing...
\title{Table of Contents}
\start \setupinterlinespace[line=0.8ex] % too small, just for testing \placecontent \stop
But as I found, any value below 2.8ex causes interline inconsistencies when special cases appears, see the extreme below:
\starttext \start \setupinterlinespace[line=1.0ex] \placecontent \stop \chapter{aaaaaaaa}. % line without descenders precedes a line without ascenders \chapter{pppppppp}. % line with descenders is followed with a line with ascenders \chapter{ŠŠŠŠŠŠŠŠ}. % the result is an inconsistent baseline distance \stoptext
Is there any remedy for this? Can I fix the baseline distance somehow?
\definegridsnapping[crap] [fit,0.2] \setuplayout[grid=crap]
This helps! But... it breaks something else :-( I am confused a bit. What exactly the linespacing is doing? It can set the baseline distance (line=...), but it is not handled correctly? Is that snapping a workaround for this deficiency of a standard solution? All lines in my book have a certain (default) linespacing. TOC entries are rendered (by default) using bigger linespacing. I just wanted to make that TOC distance smaller a bit. Is this really the only solution? \definegridsnapping[crap] [fit] % what was that magic number 0.2 ? \setuplayout[grid=crap] \start \setupinterlinespace[line=2.2ex] \placecontent \stop It works. But that snapping is set globally and it breaks whitespace handling in other parts of my document... It even produces widows/orphans what I haven't seen before. Just smaller gap between TOC lines, just that ;-) Thanks in advance, Jan
participants (2)
-
Hans Hagen
-
Jan Tosovsky