Am 17.12.2012 um 21:29 schrieb hanak@wpb.cz:
Hello,
I need to format my chapters in the following way:
- The chapters are centered (midaligned).
- Some chapters are long, so they have to be multilined.
- The chapter title should be in capital letters, but in the header should it be without capitalisation.
- When the chapter title is multilined, only the first line should appear in the header, followed by "...", the same in TOC
- When the chapter title is multilined, I want to choose the point of line break with "\\"
So something like this:
\chapter{FIRST CHAPTER TITLE} (in the header and TOC will be "First chapter title")
\chapter{SECOND CHAPTER TITLE \\ WHICH IS VERY VERY VERY LONG} (in the header and TOC will be "Second chapter title...")
I tried the following setup for the chapter:
\setuphead [chapter] [after={\blank[2*line,fixed]}, header=empty, textcommand=\midaligned, style={\chapterfont\WORD}, sectionset=none, indentnext=no ]
But when I try to process the file, I will get the following error:
structure > sectioning > chapter @ level 2 : 0.1 -> Second chapter title \\ which is very very very looong ! Missing } inserted.
system > tex > error on line 1 in file test.tex: Missing ...
1 >> \environment test_environment 2 3 \startcomponent test19 4 5 \product test 6 7 8 \chapter{Second chapter title \\ which is very very very looong} 9
<inserted text> } <to be read again> \endgroup \\->\endgroup \par \doalignline {\hss }{\hss }\begingroup l.1 Second chapter title \\ which is very very very looong \ctxcommand ...\directlua \zerocount {commands.#1}
\getheadtitle ...lecommand \relax \structuretitle \else \normalexpanded {\no... ... l.10 ...r title \\ which is very very very looong}
If I don't try to enforce line break in the title with "\\", the file is processed without problem, but also without making anyline break at all -- the whole long chapter title is one very long line.
If I don't use "textcommand=\midaligned", I am able to make multiline chapter with my own line break, but the title is left-aligned...
Could anybody tell me, how to make properly the chapter setup according to above described rules?
You can use the “list” and “marking” keys to set separate entries for the header and TOC. \setuphead [chapter] [after={\blank[fixed,2*line]}, header=empty, align=middle, style={\setcharactercasing[WORD]}] \setupheadertexts[chapter] \starttext \completecontent \startchapter[title={First chapter title}] \dorecurse{10}{\input knuth\par} \stopchapter \startchapter[title={Second chapter title\\which is very long},list={Second chapter title …},marking={Second chapter title …}] \dorecurse{10}{\input zapf\par} \stopchapter \stoptext Wolfgang