ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: jbf <roma83537@gmail.com>
To: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: styling individual parts of ToC entry
Date: Mon, 7 Sep 2020 09:31:14 +1000	[thread overview]
Message-ID: <34768053-eaf7-66bf-29e6-592f1ab8cb96@gmail.com> (raw)
In-Reply-To: <419ca9fd-d29e-93cb-feeb-8bc4362a599e@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 5524 bytes --]

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

....

Julian
On 6/9/20 5:36 pm, Wolfgang Schuster wrote:
> jbf schrieb am 06.09.2020 um 02:03:
>> Thanks Wolfgang, while I don't pretend to fully understand the setup 
>> you have provided (but am working on doing so!), of course it 
>> provides the correct result for a chapter that has a title, an 
>> author, and a year.
>>
>> My ever-so-complicated book (and its authors!) however, throws one 
>> small further complication into the mix.
>>
>> Where a chapter does not have a year-range, and I either omit that 
>> declaration, or I leave the curly brackets empty (e.g. year={}), then 
>> I find that the author name also does not appear in the ToC. What 
>> adjustment to the \ChapterListCommand do I need to make to 
>> accommodate the following? Possibly an \else statement, but not sure 
>> how to include that:
>>
>> \startchapter [title={Chapter title}] [author={Author Name}]
>
> I forgot to change the argument for the check off the author entry, 
> this should fix it.
>
> \define[3]\ChapterListCommand
>   {\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{\bf\structurelistuservariable{author}}}%
>        \hfill\currentlistentrypagenumber % pagenumber
>      \egroup
>    \egroup}
>
> Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 8278 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2020-09-06 23:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05  1:35 jbf
2020-09-05  8:30 ` Henning Hraban Ramm
2020-09-05  9:16 ` Wolfgang Schuster
2020-09-06  0:03   ` jbf
2020-09-06  7:36     ` Wolfgang Schuster
2020-09-06 23:31       ` jbf [this message]
2020-09-07  6:57         ` Wolfgang Schuster
2020-09-09  6:04           ` jbf
2020-09-09  7:10             ` Wolfgang Schuster
2020-09-09  9:39               ` jbf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34768053-eaf7-66bf-29e6-592f1ab8cb96@gmail.com \
    --to=roma83537@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=wolfgang.schuster.lists@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).