From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/108646 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jbf Newsgroups: gmane.comp.tex.context Subject: Re: styling individual parts of ToC entry Date: Mon, 7 Sep 2020 09:31:14 +1000 Message-ID: <34768053-eaf7-66bf-29e6-592f1ab8cb96@gmail.com> References: <433fcd16-6e58-3eef-d8e3-004c99e3d6e5@gmail.com> <419ca9fd-d29e-93cb-feeb-8bc4362a599e@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8670060503529033259==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40397"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: mailing list for ConTeXt users To: Wolfgang Schuster Original-X-From: ntg-context-bounces@ntg.nl Mon Sep 07 01:31:50 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kF48T-000AP8-Vo for gctc-ntg-context-518@m.gmane-mx.org; Mon, 07 Sep 2020 01:31:50 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2BDC0164835; Mon, 7 Sep 2020 01:31:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S6EAHvohnNfy; Mon, 7 Sep 2020 01:31:24 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id DE0ED164C8D; Mon, 7 Sep 2020 01:31:23 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id AE723164C8D for ; Mon, 7 Sep 2020 01:31:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QpKI9XBZpIGs for ; Mon, 7 Sep 2020 01:31:20 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.210.173; helo=mail-pf1-f173.google.com; envelope-from=roma83537@gmail.com; receiver= Original-Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 919ED164835 for ; Mon, 7 Sep 2020 01:31:20 +0200 (CEST) Original-Received: by mail-pf1-f173.google.com with SMTP id c142so7664135pfb.7 for ; Sun, 06 Sep 2020 16:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=winGhtTGr1o+ow2vEeaIFlUaCXqYAxOCrHnMFn9uToU=; b=sROkRDnkR/+jig4miQQFjG/iJ0Xe9eCPi7fUoyGgRauBpVSamTuU5DkKKC75dgCSPe UiK7GVZKXpsT24SvfeDrDQpf/lv/oX4TnE1Vm3eDI+3I4UspA6rQ2sl1C+B+Yr2TEj1a qnos5WZYwKPCrF7FNbEUQSKUNDuhqI9biSDtwjJ6h6kMg+Qar+zhgm4vGpAJbEBzvBaX i0uBZcGnGufGEQRXdlzXiCK8DFVj4Y1jpmmABX490IYr2ySQ7I7bEXWdXUec3yqJuwxm d4pxwgh13VEKkCIvqNy5ghPctJMIvvwZGZL9cSdJnQN5NluLvBunsH7LNwWu4A9FXqHA 967w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=winGhtTGr1o+ow2vEeaIFlUaCXqYAxOCrHnMFn9uToU=; b=Ntcgv+d6t6N441G9ZIn1FGHtzdmQ2Sh9rXT0jV7gB1KlsZYrO7B/Jjnicx5hObAyZ6 cSukyby7zAqMvHD0XbpxXqO41nAKP44SEEEYCB0ggcyimPVeebgbLfulq94aeyYBzRtx kC2SBmS961kpBdLZ1hWNSAYkzRuhe5W++Nr+8+b8vjIY4+cva4JJFB5sS+wk6xnF0TsN /91o1Vg48Nslc5kQ0A/ME66F+AQzepVv3a6PQceXbGT4xDx9p3WfRVcsgrQ3NYr+kPf0 KD6p+3VmGVE6gkMAVtXz4py6VaCq7Kn+FAWIhykmazcoSlG+EGuJ6tuF62uvjf0nbunk ckoA== X-Gm-Message-State: AOAM533+ZnYhPP0oVOYkdpoYIMYgTYQR5981/b0859hqeOEP7ZAUvER7 i9ABVS/AwjhpGq28KJVdhvvTBrqfFHuI/g== X-Google-Smtp-Source: ABdhPJzOjpcQBMm67hMqc3RX2UrG3SfbUnzbq+38lh6bdITxebuGZKy105VxBItEe6JaFKN2RVtREw== X-Received: by 2002:a63:5f03:: with SMTP id t3mr14755446pgb.258.1599435078039; Sun, 06 Sep 2020 16:31:18 -0700 (PDT) Original-Received: from [192.168.0.100] ([120.21.207.15]) by smtp.gmail.com with ESMTPSA id j10sm13404804pff.171.2020.09.06.16.31.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Sep 2020 16:31:17 -0700 (PDT) In-Reply-To: <419ca9fd-d29e-93cb-feeb-8bc4362a599e@gmail.com> Content-Language: en-US X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:108646 Archived-At: This is a multi-part message in MIME format. --===============8670060503529033259== Content-Type: multipart/alternative; boundary="------------D51C42F408F65666DFF96D09" Content-Language: en-US This is a multi-part message in MIME format. --------------D51C42F408F65666DFF96D09 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 --------------D51C42F408F65666DFF96D09 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

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
--------------D51C42F408F65666DFF96D09-- --===============8670060503529033259== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============8670060503529033259==--