Have to confess I am still not getting far with the final problem in a
book that is now fully laid out: frontmatter through to appendices is
all correct and working, but the Table of Contents not the way I need it
(as explained earlier and listed in a previous email).
My latest effort focuses on just one item, the Foreword, since if I get
that right, I can apply the same logic to sections. Chapters are already
working correctly, thanks to Wolfgang's ChapterListCommand and I am
assuming I need that for the several frontmatter 'chapters'.
I was earlier using \title for foreword, preface and notes to
contributors, but have abandoned that as complicating things, and am now
using \chapter, since it does not produce a numbered item - however, it
is producing the label 'Chapter' which I don't want for these item. You
can see below how I tried to avoid that, but it failed. My MWE addition
to what Wolfgang provided is:
\definehead [foreword] [chapter]
\setuphead [foreword]
\setuplist [foreword]
[label=foreword,
alternative=command,
command=\ChapterListCommand]% definition not included here. It was
given in an earlier response from Wolfgang.
.... And in the frontmatter itself:
\startchapter[foreword][title={\ss Foreword}][author={A. Uthor}]
..........
Of course, even if it did work, given the ChapterListCommand, it would
probably put the author on a line below Foreword, instead of on the same
line. There are four different components in the ToC, all needing to be
arranged a bit differently, which is why I haven't got my head around
what I need to do. They are:
(1) Foreword author name
(2) Chapter no. Title
author name
(3) Chapter no. Title 1
Title 2 or subtitle
author name
(4) Chapter no. Title
Section
author name
Julian
On 7/9/20 4:57 pm, Wolfgang Schuster wrote:
jbf schrieb am 07.09.2020 um 01:31:
Yes, Wolfgang, that corrects the minor problem of including the
author name correctly, even when there is no year range. Thank you.
But since I use \title, not \chapter, for the frontmatter items, (
Foreword, Preface, A note on Contributors), the ChapterListCommand
clearly does not apply, so currently my ToC looks as follows (leaving
out the pg numbers which correctly align right):
Foreword
A. Uthor
Preface
A. Uthor
A note on contributors
Chapter One Year range
A. Uthor
What I want is for 'Foreword', 'Preface' and 'A note on Contributors'
to align flushleft with Chapter One, but with author names still
where they should be (Foreword and Preface have authors, 'A note...'
does not have an author).
So I tried creating a TitleListCommand which copies the
ChapterListCommand. But where I run into difficulties then is with a
new lot of \setuplist to accommodate that. There are three different
labels involved (Foreword, Preface, and A note on Contributors).
And why is it that even with the current setup, 'Foreword' has
aligned with author name, not with 'Preface' and 'A note...'? All
three are \title, after all.
All in all this is a most complicated ToC! What I need is for the ToC
to look like I show it below, and you will note the additional
complication of Chapter Two which does not have an author, but
instead it is the SECTIONS in the Chapter that have authors!
I'm sure if I can get on top of all this somehow, no future ToC is
ever going to cause me problems! The body of the book is all looking
good, all 300 pages of it. It is just the automatically produced ToC
that is causing the headaches.
Foreword A. Uthor pg no.
Preface A. Uthor "
A note on Contributors "
Chapter One Chapter Title
A. Uthor "
Chapter Two Chapter title
A section Context
A. Uthor "
Another section Reflection
A. Author "
So what I have below as an MWE is fundamentally what you gave me (I
have left out the correctly working ChapterListCommand), altered for
\title, but I haven't got the setups below correct because I don't
know how to do it. I have replaced unknowns with a question mark!
And at the moment I have nothing for the 'sections' with authors I
need for Chapter Two. I assume I would set up a third definition
called \SectionListCommand. Sections will have different labels too -
one will be called 'Context', the other 'Reflection'.
\define[3]\TitleListCommand
{\hbox\bgroup
\hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
\vtop\bgroup
\hsize\dimexpr\makeupwidth-3cm\relax
\doifsomething{\rawstructurelistuservariable{year}}
{{\it\structurelistuservariable{year}}\crlf}%
\currentlistentrytitle % title
\doifsomething{\rawstructurelistuservariable{author}}
{\crlf{\structurelistuservariable{author}}}%
\hfill\currentlistentrypagenumber % pagenumber
\egroup
\egroup}
\setuplist
[chapter]
[label=chapter,
alternative=command,
command=\ChapterListCommand]
\setuplist
[title]
[label=?,
alternative=command,
command=\TitleListCommand]
\setuplabeltext
[en]
[chapter={\bf Chapter }]
\setuplabeltext
[en]
[title={\bf ? }] %There needs to be three different labels
You need extra headings for the forward and preface
\definehead [forward] [chapter]
\definehead [preface] [chapter]
to have full control about their layout.
I can provide you a solution for your problems but you have to create
a complete minimal example (including forward and preface titles) first.
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________