[NTG-context] author in ToC and other design complications

jbf roma83537 at gmail.com
Fri Sep 4 06:44:51 CEST 2020


Very much at the conclusion of a complicated book where most if not all 
issues in the body of the text are resolved, but now comes the really 
difficult part: the Table of Contents.

Here is what I am currently using (but it does not produce what I have 
been asked for, which is explained below this MWE):

%------------------------------

\setuphead [subject] [incrementnumber=list]
\setuphead [title] [incrementnumber=list]
\setupcombinedlist
   [content]
[list={chapter,title,section,subsection}]\switchtobodyfont[10.5pt]
\setuplist[chapter][style=normal,alternative=b, before=]

And then I place the ToC using:

\definehead
   [tochead]
   [title]
\starttochead[title={Contents}]
   \placecombinedlist[content]
\stoptochead

%-----------------------------

The last bit ensures that I get the word 'Contents' as the toc title, 
and avoid then getting 'contents' listed as an item with its page 
number. And if I want a relatively straightforward Table of Contents, 
then this mostly works, giving me (e.g.):

Foreword                    iii

One   Chapter title      1

Two    Chapter title      10

etc.

Of course, I would prefer it to say 'Chapter One' not just 'One', so 
that is a minor problem I still have to resolve. But in fact, the 
publisher wants something quite different and I really do not know how 
to go about it. I did look at 'Author in ToC' in the wiki, but that 
referred me to a somewhat complicated Proceedings style, and given that 
my Chapters are all set up anyway, I just couldn't follow that. Am 
hoping there is some other way I can achieve the design that follows:

Foreword            Author's name        iii

Chapter One       Chapter title

                             Author's name       1

Chapter Two        1820-1880

                             Chapter title

                             Author's name       10

I need to add that the current setup to obtain Chapter Two is with 
\setuplabeltext[chapter={{Chapter },{:1820-1880}}] which gives me 
Chapter Two:1820-1880

I had thought that maybe I could get the author with something like

\starttitle[title={\ss Foreword}][author={Author Name}]

Foreword content....

\stoptitle

But that does not produce any author name in the ToC, and in fact the 
Author's name in the Chapter opening page is simply placed manually as a 
right-aligned item in the position where I want it, nothing to do with 
the setup for \chapter (or \title in this case).

Given the above complicated design (or so it seems to me) will I have to 
just set the ToC up manually with a table, or can it be achieved otherwise?

Julian




More information about the ntg-context mailing list