Difference between revisions of "Command/setuphead"
From ConTeXt wiki
< Command
(using labels for parts) |
|||
Line 354: | Line 354: | ||
\stoptext | \stoptext | ||
</context> | </context> | ||
+ | |||
+ | |||
+ | == Setting label of a part == | ||
+ | |||
+ | In MkIV, if you want parts to be labeled as "Part 1" etc., the following isn't sufficient (but works in MkII): | ||
+ | |||
+ | <context mode="mkiv" source="yes" text="because it produces"> | ||
+ | \setuphead[part][placehead=yes] | ||
+ | |||
+ | \starttext | ||
+ | \part{A part} | ||
+ | |||
+ | \stoptext | ||
+ | </context> | ||
+ | |||
+ | For MkIV, add <code>bodypartlabel=part</code> to the <code>setuphead</code>: | ||
+ | |||
+ | <context mode="mkiv" source="yes"> | ||
+ | \setuphead[part][placehead=yes, bodypartlabel=part] | ||
+ | |||
+ | \starttext | ||
+ | \part{A part} | ||
+ | |||
+ | \stoptext | ||
+ | </context> | ||
+ | |||
+ | (Thanks to Wolfgang Schuster on the mailing list for this information.) | ||
== Example of hidden sections == | == Example of hidden sections == |
Revision as of 12:29, 31 August 2013
\setuphead
Syntax
Description
- style: See manual "Context: an excursion" section 31.3 Style and size switch in commands, e.g. for large, bold, sans serif section headers use 'style=\tfa\bf\ss'.
- page
- yes: The section header must be on the top of a new page
- left: The section header must be on the top of an even page
- right: The section header must be on the top of an odd page
- continue
- yes: If the section immeadiately follows a chapter it will be on the same page even though page=yes.
- no: If the section immeadiately follows a chapter it will start on a new page.
- header/footer: Set a particular header style, see \setupheader.
Example
\setuppapersize[A5] \setuplabeltext[chapter=CHAPTER~] \setuphead[chapter][ header=empty, alternative=middle, style=bold, numbercommand=\groupedcommand{}{\blank[2cm]}, after={\blank[3cm]}, ] \starttext \chapter{Title of chapter} The first paragraph begins 3 cm below the title. In this chapter, we will discuss... \stoptext
produces
More examples
A big space before a smaller space behind the heading:
\setuphead [subject] [before={\blank[2*big]}, after={\blank[big]}, style=bold] \starttext \subject{Headline 1} text text text text text text text text text text text text text text text vtext text text text text text text text text text text text text\par \subject{Headline 2} text text text text text text text text text text text text text text text vtext text text text text text text text text text text text text\par \stoptext
produces
Setting label of a new section head
\definehead[mychapter][chapter][bodypartlabel=mychapter] \setuplabeltext[en][mychapter=My Chapter~] \starttext \mychapter{Animals} \stoptext
produces
Setting label of a part
In MkIV, if you want parts to be labeled as "Part 1" etc., the following isn't sufficient (but works in MkII):
\setuphead[part][placehead=yes] \starttext \part{A part} \stoptext
because it produces
For MkIV, add bodypartlabel=part
to the setuphead
:
\setuphead[part][placehead=yes, bodypartlabel=part] \starttext \part{A part} \stoptext
(Thanks to Wolfgang Schuster on the mailing list for this information.)
\setupheadnumber[section] [8] \setupheadnumber[subsection] [3] \setupheadnumber[subsubsection][5] \setuphead[section,subsection][placehead=hidden] \setuphead[subsubsection] [placehead=yes] \starttext \section{} % hidden 8th section \subsection{} % hidden 3rd section \subsubsection{This is complete numbering of subsubsection} % view 9.4.6 subsubsection \stoptext
produces
See also
Help from ConTeXt-Mailinglist/Forum
All issues with: