ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* fancy chapter setup
@ 2020-01-11 15:04 Henning Hraban Ramm
  2020-01-11 18:49 ` Rik Kabel
  0 siblings, 1 reply; 7+ messages in thread
From: Henning Hraban Ramm @ 2020-01-11 15:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-01-13 21:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-11 15:04 fancy chapter setup 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 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).