Problem with \definehead
Hello, please look at the following minimal example: ---- \definehead[chapterMiddle][chapter] \setuphead[chapterMiddle][align=middle] \definehead[sectionMiddle][section] % Try to comment this line! \definecombinedlist[content][part,chapter,chapterMiddle] \setupcombinedlist[content][alternative=c] \setuplist [chapter,chapterMiddle] [alternative=b,before=\blank,after=\blank,style=bold] % Commands \def\startTitlePage{ \bgroup \let\chapter=\chapterMiddle } \def\stopTitlePage{% \egroup \page } %%% \starttext \placecontent % = TOC \page \chapter{Cha1} \startTitlePage \chapter{Cha2} \stopTitlePage \stoptext ---- Its goal is to define \(start/stop)TitlePage command in which heads will be centred (although they are not mid-aligned by default). (I don't know if my approach is the best - I'm using \chapterMiddle instead of \chapter for this, which is defined as mid-aligned). A \chapterMiddle is derrived from \chapter and has middle alignment. I would need to do a similar thing with \sectionMiddle. The problem is that when I derive a next style - "\definehead[sectionMiddle][section]" (try to comment the proper line), look of the TOC changes (?!) - some extra space before "Cha2" appears; see both test21.pdf and test22.pdf. So how to keep the same look of the TOC? And - would you recommend any better solution how to define \(start/stop)command which would force heads to be mid-aligned? (All compiled with the latest beta, WinXP.) Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
... A simplified piece of code - the result still depends on presence of "\definehead[sectionMiddle][section]": ---- \definehead[chapterMiddle][chapter] \setuphead[chapterMiddle][align=middle] \definehead[sectionMiddle][section] % Try to comment this line! \definecombinedlist[content][chapter,chapterMiddle] %%% \starttext \placecontent \page \chapter{Cha1} \chapterMiddle{ChaM} \chapter{Cha3} \stoptext ---- Any idea? Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
Am 23.06.2011 um 11:03 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
Its goal is to define \(start/stop)TitlePage command in which heads will be centred (although they are not mid-aligned by default).
(I don't know if my approach is the best - I'm using \chapterMiddle instead of \chapter for this, which is defined as mid-aligned).
A \chapterMiddle is derrived from \chapter and has middle alignment.
I would need to do a similar thing with \sectionMiddle.
The problem is that when I derive a next style - "\definehead[sectionMiddle][section]" (try to comment the proper line), look of the TOC changes (?!) - some extra space before "Cha2" appears; see both test21.pdf and test22.pdf.
So how to keep the same look of the TOC?
And - would you recommend any better solution how to define \(start/stop)command which would force heads to be mid-aligned?
Don’t misuse headings for your titlepage. As a titlepage is something special you can use \midaligned, \definedfont etc. to format it, e.g. \starttext \starttextmakeup[align=middle] \definedfont[SansBold sa 2]My Document \stoptextmakeup … \stoptext Wolfgang
Don’t misuse headings for your titlepage. As a titlepage is something special you can use \midaligned, \definedfont etc. to format it, e.g.
Thanks for the answer, but - - to describe better my situation: I'm not creating a typical book, but a special kind of report, with many code generated by Lua, many \typefiles and many included PDFs. And here, there are heads being used as: - "normal" heads (left-aligned; appended by normal text) and - "title-like" heads (mid-aligned) which should stand alone on a page (e.g. being appended by other pdf documents on the next page). Both kinds of heads should be numbered and should be involved to TOC; so in this point of view, they have the same status. So e.g.: --- (page) --- Chapter 1 <- Normally left-aligned Section 1.1 <- Normally left-aligned Some text some text some text some text --- (page) --- Chapter 2 <- Mid-aligned Section 2.1 <- Mid-aligned --- (page) --- +------------+ | Another | | pdf | +------------+ --- (page) --- So "Chapter 1" and "Section 1.1" are "normal" heads, probably typeset by \chapter and \section. As my primary intention was not to "force" normal heads to be aligned otherwise, I derived new head styles \chapterMiddle and \sectionMiddle, which are used to generate "Chapter 2" and "Section 2.1". But the problem is that TOC becomes visually "crashed" once \sectionMiddle has been defined. So how to solve it? Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
participants (2)
-
Procházka Lukáš Ing. - Pontex s. r. o.
-
Wolfgang Schuster