ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Henning Hraban Ramm <texml@fiee.net>
Subject: Re: fancy chapter setup
Date: Mon, 13 Jan 2020 22:48:59 +0100	[thread overview]
Message-ID: <d6b3dcad-cfb0-0ce6-c428-26bb99213299@gmail.com> (raw)
In-Reply-To: <855400B9-C09C-4054-A3C4-D870CDC2EE2D@fiee.net>

Henning Hraban Ramm schrieb am 13.01.2020 um 19:21:
>> Am 2020-01-12 um 16:07 schrieb Henning Hraban Ramm <texml@fiee.net>:
>>
>> Since the structureuservariables of a section aren’t defined in that section’s "before", I would need a macro or buffer to define the contents of that epigraph page, like this:
>>
>> That’s possible, but ugly. I would really like to set those quotes and image names in the chapter command.
> Finally I used the after parameter and needed to define different section commands for chapters with and without epigraph (i.e. starting on a left or right page). When I had that distinction and the \page command in my setup, the header text changed too early.

\definedataset[chapter]

\startsetups[chapter:leftpage]

     \page[left]

     \doglobal\increment\ChapterData

     \doifsomething{\datasetvariable{chapter}{\ChapterData}{subtitle}}
         {
             \starttabulate
             \NC Title    \EQ 
\datasetvariable{chapter}{\ChapterData}{title} \NC\NR
             \NC Subtitle \EQ 
\datasetvariable{chapter}{\ChapterData}{subtitle} \NC\NR
             \stoptabulate
         }

     \page[right]

\stopsetups

\startsetups[chapter:savedata]

     \setdataset
         [chapter]
         [\ChapterData]
         [   title=\structurevariable{title},
          subtitle=\structureuservariable{subtitle}]

\stopsetups

\setuphead
   [chapter]
   [page=,
    beforesection=\directsetup{chapter:leftpage},
    insidesection=\directsetup{chapter:savedata}]

\setuppagenumbering[alternative=doublesided]

\starttext

\startchapter[title={My Normal Text}]
\input knuth
\stopchapter

\startchapter[title={My Fancy Story}][subtitle={I thought that was real.}]
\input tufte
\stopchapter

\startchapter[title={Another Fancy Story}][subtitle={Never mind the 
bollocks.}]
\input zapf
\stopchapter

\startchapter[title={Another Normal Text}]
\input knuth
\stopchapter

\stoptext

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-01-13 21:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-11 15:04 Henning Hraban Ramm
2020-01-11 18:49 ` Rik Kabel
2020-01-11 19:24   ` Henning Hraban Ramm
2020-01-12 13:40   ` Henning Hraban Ramm
2020-01-12 15:07     ` Henning Hraban Ramm
2020-01-13 18:21       ` Henning Hraban Ramm
2020-01-13 21:48         ` Wolfgang Schuster [this message]

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=d6b3dcad-cfb0-0ce6-c428-26bb99213299@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=texml@fiee.net \
    /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).