From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113252 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerben Wierda via ntg-context Newsgroups: gmane.comp.tex.context Subject: Solved: Book setup with LHS-side quotes before chapters/parts, header/footer issues, TOC, etc. Date: Tue, 26 Oct 2021 13:14:30 +0200 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Content-Type: multipart/mixed; boundary="===============0426667442011221474==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33677"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gerben Wierda To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 26 13:15:07 2021 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 1mfKQ6-0008YP-Gr for gctc-ntg-context-518@m.gmane-mx.org; Tue, 26 Oct 2021 13:15:06 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E6056267E85; Tue, 26 Oct 2021 13:14:36 +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 bKZizZiJxARn; Tue, 26 Oct 2021 13:14:34 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id EFB8F267E73; Tue, 26 Oct 2021 13:14:33 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E7EC9267E73 for ; Tue, 26 Oct 2021 13:14:32 +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 pLYX3Cm3US-H for ; Tue, 26 Oct 2021 13:14:31 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=213.125.118.53; helo=mail.rna.nl; envelope-from=gerben.wierda@rna.nl; receiver= Original-Received: from mail.rna.nl (mail.rna.nl [213.125.118.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 93225267E63 for ; Tue, 26 Oct 2021 13:14:31 +0200 (CEST) Original-Received: from hermione.rna.nl (hermione.rna.nl [192.168.2.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.rna.nl (Postfix) with ESMTPSA id 727DD9614EC9 for ; Tue, 26 Oct 2021 13:14:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rna.nl; s=dkim_rsa2048; t=1635246870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=IUyJ1bMkFGBx5/+qxQu//XqDsQkw69LsFKF3nrzdGIw=; b=dFeOcUM3DbZap4UJFwW/sZAVxOikFrO3kukFeD/SqQG/qRbPufp1E9SZTcHmnUMDpohgQO pjwu982qHCqir2CFOAgIP3Ytns0PBIfBoqDADJQAafFUFQD9dlt06En0qwwmouCsrFjxd7 NyBn/jlKkYOs2Cz3m8w5vSF0615Z/X4kKflaxUeqeQFRJpQDxHMjqdlid0MXDzgNuewheZ ay3euteVYkt2+PEh5+mdFP5Wv5bLRNeKKacyMXAtck1IXpR/cS2j0pkNZ+gYmlhoYwvX8d cThtAq3Er4U7BcHE3/NRzqwwO8xwQBjX/4wxBJhsKYxd+XqXSzG06zBD6Qqjng== X-Mailer: Apple Mail (2.3608.120.23.2.7) 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:113252 Archived-At: --===============0426667442011221474== Content-Type: multipart/alternative; boundary="Apple-Mail=_4A0D6E62-0EA3-484C-946A-851A76283ECB" --Apple-Mail=_4A0D6E62-0EA3-484C-946A-851A76283ECB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Thanks to Wolfgang Schuster and Bruce Horrocks I have now a working = solution. I ended up following Bruce=E2=80=99s suggestion of doing a = left hand side (LHS) page opposite the first (RHS) chapter or part page = differently than using after/before modifications of the \chapter and = \part setups as I had been doing years ago (but that book did not have = parts and was done in mkii) The modification of \chapter and \part setups with before=3D and after=3D = never worked in the \component setup in LMTX. Creating a separate = command to run immediately before a \chapter or \part, as suggested by = Bruce, was simpler and and turned out to be more robust. So, this single = file example also works when \components are used. The only issues I have now left are very minimal. In the table of = contents, the abstract for a part has some extra whitespace above, which = the chapter abstracts don=E2=80=99t have. But that is not really a = problem. And getting the part title somewhere more centred on its page = is also left as an issue for later. Example file. In a project/component setup: everything before the = \starttext goes into the environment file, the rest in the product file. %%% %%% Sections that have a LHS preface with a quote %%% \startsetups SectionLHSPageSetup \page[left] \setupheader[state=3Dempty] \start \startalignment[left,nothyphenated] \startnarrower[4*left] \tf\it \stopsetups \definestartstop [SectionLHSPage] [ before=3D{\setups{SectionLHSPageSetup}}, after=3D{\stopnarrower \stopalignment\stop}] \define[1]\SectionPrequote{\startSectionLHSPage #1\stopSectionLHSPage} %%% %%% part is managed here %%% \defineconversionset [part] [Romannumerals] [numbers] \setuplabeltext[en][partlabel=3DPart~] \setuphead [part] [sectionsegments=3Dpart, bodypartlabel=3Dpartlabel, appendixlabel=3D, sectionconversionset=3Dpart, page=3Dyes, header=3Dempty, footer=3Dempty, placehead=3Dyes] \definelist[parttext] \setuplist[parttext][margin=3D1.3em,pagecommand=3D\gobbleoneargument] \define[1]\PartAbstract{\writetolist[parttext]{}{\start\itx#1\stop}} %%% %%% chapter is managed here %%% \definetext [chapterfooter] % name [footer] % vertical location [pagenumber] % content \setuplabeltext[en][appendixchapterlabel=3DAppendix~] \setuphead [chapter] [page=3Dyes, header=3Dempty, bodypartlabel=3D, appendixlabel=3Dappendixchapterlabel, footer=3Dchapterfooter, sectionsegments=3Dchapter, before=3D{\blank[force,2*big]}, after=3D{\blank[3*big]}] \definelist[chaptertext] \setuplist[chaptertext][margin=3D1.3em,pagecommand=3D\gobbleoneargument] = \define[1]\ChapterAbstract{\writetolist[chaptertext]{}{\start\itx#1\stop}}= \defineresetset [default] [0,0] [1] \setupcombinedlist [content] [list=3D{part,parttext,chapter,chaptertext}] \starttext \startfrontmatter \completecontent \SectionPrequote{If you think good architecture is expensive, try bad = architecture\crlf {\tf Brian Foote and Joseph Yoder}} \startchapter[title=3D{One}] \dorecurse{7}{\input tufte \par \input knuth} \stopchapter \stopfrontmatter \startbodymatter \dorecurse{3}{ \SectionPrequote{The world is not \rationals, it is \reals\crlf {\tf = Gerben Wierda}} \part{Title title title} \PartAbstract{This is a part abstract.} \dorecurse{2}{ \SectionPrequote{If you think good architecture is expensive, try bad architecture\crlf {\tf Brian Foote and Joseph Yoder}} \startchapter[title=3D{Two}] \ChapterAbstract{This is a chapter abstract.} \dorecurse{5}{\input tufte \par \input knuth} \stopchapter } } \stopbodymatter \startappendices \defineresetset[default][0,1][1] %% reset , chapter, but not part \setuphead[part][number=3Dno] \SectionPrequote{The world is not \rationals, it is \reals\crlf {\tf = Gerben Wierda}} \part{Title title title} \PartAbstract{This is a part abstract.} \dorecurse{2}{ \SectionPrequote{If you think good architecture is expensive, try bad architecture\crlf {\tf Brian Foote and Joseph Yoder}} \startchapter[title=3D{Two}] \ChapterAbstract{This is a chapter abstract.} \dorecurse{5}{\input tufte \par \input knuth} \stopchapter } \stopappendices \stoptext In a component setup, a part component may look like this: \startcomponent p_partone \product prd_book \project project_book \SectionPrequote{The world is not \rationals, it is \reals\crlf {\tf Gerben Wierda}} \part{Title title title} \PartAbstract{This is a part abstract for a normal part.} \component c_chapter \component c_chapter \stopcomponent and a chapter component like this: \startcomponent c_chapter \product prd_book \project project_book \starttext \SectionPrequote{If you think good architecture is expensive, try bad = architecture\crlf {\tf Brian Foote and Joseph Yoder}} \chapter{An Inconvenient Truth} \ChapterAbstract{This is a chapter abstract.} \setupindenting[next] \placeinitial I{\kap{\bf n the half}} century or so that human kind has = had IT, the IT sector has increasingly wrestled with the fact that IT projects = often fail in one way or another. \dorecurse{7}{\input tufte \par \input knuth} \stoptext \stopcomponent Gerben Wierda (LinkedIn ) R&A Enterprise Architecture (main site) Book: Chess and the Art of Enterprise=C2=A0Architecture = Book: Mastering ArchiMate --Apple-Mail=_4A0D6E62-0EA3-484C-946A-851A76283ECB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Thanks to Wolfgang Schuster and Bruce Horrocks I have now a = working solution. I ended up following Bruce=E2=80=99s suggestion of = doing a left hand side (LHS) page opposite the first (RHS) chapter or = part page differently than using after/before modifications of the = \chapter and \part setups as I had been doing years ago (but that book = did not have parts and was done in mkii)

The modification of \chapter and \part = setups with before=3D and after=3D never worked in the \component setup = in LMTX. Creating a separate command to run immediately before a = \chapter or \part, as suggested by Bruce, was simpler and and turned out = to be more robust. So, this single file example also works when = \components are used.

The only issues I have now left are very minimal. In the = table of contents, the abstract for a part has some extra whitespace = above, which the chapter abstracts don=E2=80=99t have. But that is not = really a problem. And getting the part title somewhere more centred on = its page is also left as an issue for later.

Example file. In a project/component = setup: everything before the \starttext goes into the environment file, = the rest in the product file.

%%%
%%% Sections that have a LHS preface = with a quote
%%%

\startsetups SectionLHSPageSetup
 \page[left]
 \setupheader[state=3Dempty]
 \start
    = \startalignment[left,nothyphenated]
    = \startnarrower[4*left]
        = \tf\it
\stopsetups

\definestartstop = [SectionLHSPage]
 [ = before=3D{\setups{SectionLHSPageSetup}},
   = after=3D{\stopnarrower
    = \stopalignment\stop}]

\define[1]\SectionPrequote{\startSectionLHSPage = #1\stopSectionLHSPage}

%%%
%%% part is managed = here
%%%
\defineconversionset [part] [Romannumerals] = [numbers]
\setuplabeltext[en][partlabel=3DPart~]

\setuphead [part]
  = [sectionsegments=3Dpart,
   = bodypartlabel=3Dpartlabel,
   = appendixlabel=3D,
   sectionconversionset=3Dpart,
   page=3Dyes,
   = header=3Dempty,
   footer=3Dempty,
   = placehead=3Dyes]

\definelist[parttext]
\setuplist[parttext][margin=3D1.3em,pagecommand=3D\gobbleonearg= ument]
\define[1]\PartAbstract{\writetolist[parttext]{}{\start\itx#1\s= top}}

%%%
%%% chapter is managed here
%%%
\definetext
  = [chapterfooter] % name
  [footer]      =   % vertical location
  [pagenumber]    % = content

\setuplabeltext[en][appendixchapterlabel=3DAppendix~]
\setuphead
  [chapter]
  = [page=3Dyes,
   header=3Dempty,
   = bodypartlabel=3D,
   = appendixlabel=3Dappendixchapterlabel,
   = footer=3Dchapterfooter,
   = sectionsegments=3Dchapter,
   = before=3D{\blank[force,2*big]},
   = after=3D{\blank[3*big]}]

\definelist[chaptertext]
\setuplist[chaptertext][margin=3D1.3em,pagecommand=3D\gobbleone= argument]
\define[1]\ChapterAbstract{\writetolist[chaptertext]{}{\start\i= tx#1\stop}}

\defineresetset [default] [0,0] [1]
\setupcombinedlist [content] = [list=3D{part,parttext,chapter,chaptertext}]

\starttext

\startfrontmatter
\completecontent
\SectionPrequote{If you think good = architecture is expensive, try bad architecture\crlf
{\tf = Brian Foote and Joseph Yoder}}
\startchapter[title=3D{One}]
\dorecurse{7}{\input tufte \par \input = knuth}
\stopchapter
\stopfrontmatter

\startbodymatter
\dorecurse{3}{
  \SectionPrequote{The world is not = \rationals, it is \reals\crlf {\tf Gerben Wierda}}
  = \part{Title title title}
  \PartAbstract{This is a part = abstract.}
  \dorecurse{2}{
    \SectionPrequote{If you = think good architecture is expensive, try
bad = architecture\crlf
{\tf Brian Foote and Joseph Yoder}}
  =   \startchapter[title=3D{Two}]
    \ChapterAbstract{This is a = chapter abstract.}
    \dorecurse{5}{\input tufte \par \input = knuth}
    \stopchapter
  }
}
\stopbodymatter
\startappendices
  \defineresetset[default][0,1][1] = %% reset , chapter, but not part
  = \setuphead[part][number=3Dno]
  \SectionPrequote{The world is not = \rationals, it is \reals\crlf {\tf Gerben Wierda}}
  = \part{Title title title}
  \PartAbstract{This is a part = abstract.}
  \dorecurse{2}{
    \SectionPrequote{If you = think good architecture is expensive, try
bad = architecture\crlf
{\tf Brian Foote and Joseph Yoder}}
  =   \startchapter[title=3D{Two}]
    \ChapterAbstract{This is a = chapter abstract.}
    \dorecurse{5}{\input tufte \par \input = knuth}
    \stopchapter
  }
\stopappendices
\stoptext

In a component setup, a part component may look like = this:

\startcomponent p_partone
\product prd_book
\project = project_book

\SectionPrequote{The world is not \rationals, it is = \reals\crlf
{\tf Gerben Wierda}}
\part{Title title = title}
\PartAbstract{This is a part abstract for a normal = part.}
\component c_chapter
\component c_chapter
\stopcomponent

and a chapter component like = this:

\startcomponent c_chapter
\product prd_book
\project = project_book

\starttext

\SectionPrequote{If you think good = architecture is expensive, try bad architecture\crlf
{\tf = Brian Foote and Joseph Yoder}}
\chapter{An Inconvenient = Truth}
\ChapterAbstract{This is a chapter = abstract.}

\setupindenting[next]
\placeinitial I{\kap{\bf n the half}} = century or so that human kind has had IT,
the IT = sector has increasingly wrestled with the fact that IT projects = often
fail in one way or another.

\dorecurse{7}{\input tufte \par \input = knuth}
\stoptext
\stopcomponent



= --Apple-Mail=_4A0D6E62-0EA3-484C-946A-851A76283ECB-- --===============0426667442011221474== 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== --===============0426667442011221474==--