From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/106016 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rik Kabel Newsgroups: gmane.comp.tex.context Subject: Re: fancy chapter setup Date: Sat, 11 Jan 2020 13:49:47 -0500 Message-ID: <7bf16268-905a-d0ed-2953-e98c24ab02bf@rik.users.panix.com> References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0085602549846817474==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="127190"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.3.1 To: ntg-context@ntg.nl, Henning Hraban Ramm Original-X-From: ntg-context-bounces@ntg.nl Sat Jan 11 19:52:33 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 blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iqLq9-000Nim-Sv for gctc-ntg-context-518@m.gmane-mx.org; Sat, 11 Jan 2020 19:50:29 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 26FF4164BE9; Sat, 11 Jan 2020 19:49:54 +0100 (CET) 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 9kF6yYGqcChh; Sat, 11 Jan 2020 19:49:52 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 01FDA164BDC; Sat, 11 Jan 2020 19:49:52 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 568BC164BD4 for ; Sat, 11 Jan 2020 19:49:51 +0100 (CET) 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 CAAQ4Or54OLK for ; Sat, 11 Jan 2020 19:49:50 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=166.84.1.89; helo=mailbackend.panix.com; envelope-from=context@rik.users.panix.com; receiver= Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 71779164BCF for ; Sat, 11 Jan 2020 19:49:50 +0100 (CET) Original-Received: from [192.168.201.21] (cpe-72-228-11-252.nycap.res.rr.com [72.228.11.252]) by mailbackend.panix.com (Postfix) with ESMTPSA id 47w86N6JGqz1PZZ; Sat, 11 Jan 2020 13:49:48 -0500 (EST) In-Reply-To: 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.org gmane.comp.tex.context:106016 Archived-At: This is a multi-part message in MIME format. --===============0085602549846817474== Content-Type: multipart/alternative; boundary="------------A003E409C5BD77DE8792C443" Content-Language: en-US This is a multi-part message in MIME format. --------------A003E409C5BD77DE8792C443 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 1/11/2020 10:04, Henning Hraban Ramm wrote: > Hi all, > I’m trying to setup a book layout where each chapter begins with a quote and an image on the left page, followed by title and text start on the right page. > > While the quote & image thing works, I can’t get the title on the right page, ConTeXt always puts it right of the image, even if that’s as wide as the text width. \page[right] doesn’t do anything. > Where’s my mistake? > > There are also chapters without that intro, therefore I use \doifnot{\structureuservariable{subtitle}}, but those should also start on a right page. I could also use a different section name. But I don’t think that’s the problem. > > (The page number should appear on the right page; it wouldn’t hurt on the left page, but the chapter title should only appear on following pages.) > > Best, Hraban > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > \define[2]\FancyChapter{% > \doifnot{\structureuservariable{subtitle}}{}{% > \startstandardmakeup > \framed[ > width=\textwidth,height=fit, > offset=overlay, > align=flushleft, > ]{% > \definedfont[SerifItalic at 16pt] > \structureuservariable{subtitle}% > } > \framed[width=\textwidth]{% > \externalfigure[dummy][width=\textwidth]% > } > %\hfill\vfill\strut % doesn’t help > \stopstandardmakeup > } > \page[right] > % > \framed[ > width=\textwidth, > offset=overlay, > align=flushleft, > ]{% > \definedfont[Sans at 32pt]%#2 > \structurevariable{title}% > }% > } > > \setupheadertexts[][pagenumber][pagenumber][chapter] > \setuphead[chapter][ > page=left, > number=no, > header=high, > command=\FancyChapter, > ] > > \starttext > > \startchapter[title={My Normal Text}] > > \input knuth > > \stopchapter > > \startchapter[title={My Fancy Story}] > [subtitle={\quotation{I thought that was real.}}] > > \input tufte > > \stopchapter > > \stoptext > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% For what it is worth, here is how I address this. This lets me place epigraphs on the facing verso of a chapter, or under the section title, and set lettrines and first line treatment for chapters. I set page numbers in a separate overlay to better control the positioning. Perhaps a bit overthought, but it works for me ... \setupheadertexts [][{\it\getmarking[section]}]                   [{\it\getmarking[chapter]}][] \startsetups section:epigraph   \doifelsebuffer{SectionEpigraph}     {\getbuffer  [SectionEpigraph]      \resetbuffer[SectionEpigraph]}     {\donothing} \stopsetups \startsetups chapter:epigraph   \setupheadertexts [][][][]   \doifelsebuffer{ChapterEpigraph}     {\doifoddpageelse       {\page[left]}       {\donothing}      \centerbox{\getbuffer[ChapterEpigraph]}      \resetbuffer[ChapterEpigraph]     }     {\donothing}   \page[right]   \setupheadertexts [][{\it\getmarking[section]}]                     [{\it\getmarking[chapter]}][] \stopsetups \startsectionblockenvironment[bodypart] \setuphead  [chapter][                       style=\tfc\HeadFont,                       page=yes,                       separator=,                       numbercolor=darkgray,                       alternative=inmargin, before=\directsetup{chapter:epigraph}, after={\resetshownsynonyms[dictionary] \setupsynonyms[dictionary][alternative=first] \doifsomething{\structureuservariable{setFirst}} {\setfirstline[\structureuservariable{setFirst}]} \doif{\structureuservariable{Lettrine}}                              {yes}{\setinitial}},                      ] \setuphead  [section][                       style=\tfb\HeadFont, insidesection=\setups{section:epigraph},                       before={\blank[big]},                       sectionseparatorset=reddot,                       numbercolor=darkgray,                       alternative=inmargin,                      ] \setuphead  [subsection]                      [                       style=\tfa\HeadFont,                       number=no,                       distance=0pt, insidesection=\setups{section:epigraph},                       before={\blank[big]},                       alternative=normal,                       after={\blank[halfline]},                       numbercolor=,                       sectionseparatorset=,                      ] \stopsectionblockenvironment \definefirstline [5W][alternative=word, n=5,style=smallcaps]% and so on as you like \definefirstline [1L][alternative=line,     style=smallcaps] ... \starttext ... \startbuffer[ChapterEpigraph] \startEpigraph% brings in its own formatting The stuff of the epigraph \stopEpigraph \stopbuffer \startchapter[reference={cha:blah},               list={blah},     % toc               marking={blah},  % page heading               bookmark={blah}, % pdf bookmark               title={blah}]    % chapter head              [Lettrine=yes,setFirst=5W] ... \stopchapter \startchapter[reference={cha:more},               title={more stuff}]               [lettrine=yes] ... \stopchapter -- Rik Kabel --------------A003E409C5BD77DE8792C443 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 1/11/2020 10:04, Henning Hraban Ramm wrote:
Hi all,
I’m trying to setup a book layout where each chapter begins with a quote and an image on the left page, followed by title and text start on the right page.

While the quote & image thing works, I can’t get the title on the right page, ConTeXt always puts it right of the image, even if that’s as wide as the text width. \page[right] doesn’t do anything.
Where’s my mistake?

There are also chapters without that intro, therefore I use \doifnot{\structureuservariable{subtitle}}, but those should also start on a right page. I could also use a different section name. But I don’t think that’s the problem.

(The page number should appear on the right page; it wouldn’t hurt on the left page, but the chapter title should only appear on following pages.)

Best, Hraban

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\define[2]\FancyChapter{%
\doifnot{\structureuservariable{subtitle}}{}{%
\startstandardmakeup
  \framed[
    width=\textwidth,height=fit,
    offset=overlay,
    align=flushleft,
  ]{%
    \definedfont[SerifItalic at 16pt]
    \structureuservariable{subtitle}%
  }
  \framed[width=\textwidth]{%
    \externalfigure[dummy][width=\textwidth]%
  }
  %\hfill\vfill\strut % doesn’t help
\stopstandardmakeup
}
\page[right]
%
\framed[
  width=\textwidth,
  offset=overlay,
  align=flushleft,
]{%
  \definedfont[Sans at 32pt]%#2
  \structurevariable{title}%
}%
}

\setupheadertexts[][pagenumber][pagenumber][chapter]
\setuphead[chapter][
  page=left,
  number=no,
  header=high,
  command=\FancyChapter,
]

\starttext

\startchapter[title={My Normal Text}]

\input knuth

\stopchapter

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

\input tufte

\stopchapter

\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

For what it is worth, here is how I address this. This lets me place epigraphs on the facing verso of a chapter, or under the section title, and set lettrines and first line treatment for chapters. I set page numbers in a separate overlay to better control the positioning. Perhaps a bit overthought, but it works for me ...

\setupheadertexts [][{\it\getmarking[section]}]
                  [{\it\getmarking[chapter]}][]

\startsetups section:epigraph
  \doifelsebuffer{SectionEpigraph}
    {\getbuffer  [SectionEpigraph]
     \resetbuffer[SectionEpigraph]}
    {\donothing}
\stopsetups

\startsetups chapter:epigraph
  \setupheadertexts [][][][]
  \doifelsebuffer{ChapterEpigraph}
    {\doifoddpageelse
      {\page[left]}
      {\donothing}
     \centerbox{\getbuffer[ChapterEpigraph]}
     \resetbuffer[ChapterEpigraph]
    }
    {\donothing}
  \page[right]
  \setupheadertexts [][{\it\getmarking[section]}]
                    [{\it\getmarking[chapter]}][]
\stopsetups

\startsectionblockenvironment[bodypart]
\setuphead  [chapter][
                      style=\tfc\HeadFont,
                      page=yes,
                      separator=,
                      numbercolor=darkgray,
                      alternative=inmargin,
                      before=\directsetup{chapter:epigraph},
                      after={\resetshownsynonyms[dictionary]
                        \setupsynonyms[dictionary][alternative=first]
                        \doifsomething{\structureuservariable{setFirst}}
                            {\setfirstline[\structureuservariable{setFirst}]}
                        \doif{\structureuservariable{Lettrine}}
                             {yes}{\setinitial}},
                     ]
\setuphead  [section][
                      style=\tfb\HeadFont,
                      insidesection=\setups{section:epigraph},
                      before={\blank[big]},
                      sectionseparatorset=reddot,
                      numbercolor=darkgray,
                      alternative=inmargin,
                     ]
\setuphead  [subsection]
                     [
                      style=\tfa\HeadFont,
                      number=no,
                      distance=0pt,
                      insidesection=\setups{section:epigraph},
                      before={\blank[big]},
                      alternative=normal,
                      after={\blank[halfline]},
                      numbercolor=,
                      sectionseparatorset=,
                     ]
\stopsectionblockenvironment

\definefirstline [5W][alternative=word, n=5,style=smallcaps]% and so on as you like
\definefirstline [1L][alternative=line,     style=smallcaps]

...

\starttext

...

\startbuffer[ChapterEpigraph]

\startEpigraph% brings in its own formatting

The stuff of the epigraph

\stopEpigraph

\stopbuffer

\startchapter[reference={cha:blah},
              list={blah},     % toc
              marking={blah},  % page heading
              bookmark={blah}, % pdf bookmark
              title={blah}]    % chapter head
             [Lettrine=yes,setFirst=5W]

...

\stopchapter

\startchapter[reference={cha:more},
              title={more stuff}]
              [lettrine=yes]

...

\stopchapter


--
Rik Kabel



--------------A003E409C5BD77DE8792C443-- --===============0085602549846817474== 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== --===============0085602549846817474==--