ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: jbf <roma83537@gmail.com>
Cc: "ntg >> mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: styling individual parts of ToC entry
Date: Sun, 6 Sep 2020 09:36:10 +0200	[thread overview]
Message-ID: <419ca9fd-d29e-93cb-feeb-8bc4362a599e@gmail.com> (raw)
In-Reply-To: <b6926d4f-8ef9-8b55-c6b9-7f1ca435bc79@gmail.com>

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
___________________________________________________________________________________
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  7:36 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 [this message]
2020-09-06 23:31       ` jbf
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=419ca9fd-d29e-93cb-feeb-8bc4362a599e@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=roma83537@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).