[NTG-context] correct vertical alignment in ToC

jbf roma83537 at gmail.com
Wed Sep 30 04:05:37 CEST 2020

A quick look at the attached pdf extract from my current Table of 
Contents will demonstrate the problem. I need authors names, chapter 
titles and/or date range to line up correctly underneath each other, but 
because of the definitions I am working with (see below how the current 
result has been acheived) I do not know how to get these precise margin 
(I presume?) distances.

So, for example, the author for the Preface needs to line up directly 
under the author for the Foreword. And the title for Chapters One/Two 
and the date range for Chapter Three likewise. The 'Context' item is a 
\section and I have got that more or less to line up by using an \hspace 
definition, but I know that using two very different definitions is 
likely to cause problems. (Alternatively, they could all line up under 
the title for Chapter One, so a bit further in. What *has to happen* is 
that they all line up accurately under each other, whichever solution I 

My real problem  is that I do not know how get these specific distances 
from the left-hand side using the definitions I have. If I knew how to 
get, say, 3cm in from the margin for Chapter authors/titles/date ranges 
(given the definition below) and section authors (given its definition 
below), I could solve this problem, but everything I have tried does not 
seem to work. Wolfgang had given me the ChapterListCommand definition, 
and I think Hraban the SectionTocentry:


      \hbox to 2.5cm{\currentlistsymbol\hss}% number + labeltext
        \currentlistentrytitle % title
        \hfill\currentlistentrypagenumber % pagenumber

Is there somewhere in here that I can specify my distances other than 
the \hbox 2.5cm? Note that I obviously also have (e.g. for the Preface, 
but I have others for Foreword, etc.):



  \definehspace[twoem][2.5 em]

   #1\hspace[twoem]% title


The [twoem] definition (in fact it is 2.5 em) was how I got the 
'Context' author to roughly line up under the other items, but I have 
noticed that in some repetitions of this section, they do not line up 
exactly even so.

Hope somebody can help - in the end I suppose I can open it in a PDF 
editing program and shift items under each other, but I want to achieve 
the correct result using ConTeXt, understandably.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200930/b69bfe4f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: toc.pdf
Type: application/pdf
Size: 42899 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200930/b69bfe4f/attachment-0001.pdf>

More information about the ntg-context mailing list