Difference between revisions of "Command/setuphead"
< Command
Jump to navigation
Jump to search
Line 435: | Line 435: | ||
\input knuth | \input knuth | ||
\stopparagraph | \stopparagraph | ||
− | </context></cd:example><cd:example title="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></cd:example><cd:example title="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"> | <context mode="mkiv" source="yes" text="because it produces"> | ||
Line 458: | Line 458: | ||
(Thanks to Wolfgang Schuster on the mailing list for this information.) | (Thanks to Wolfgang Schuster on the mailing list for this information.) | ||
− | </cd:example></cd:examples> | + | </cd:example><cd:example title="Example of hidden sections"><context mode="mkiv" source="yes" text="produces"> |
+ | \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 | ||
+ | </context></cd:example></cd:examples> | ||
<cd:notes></cd:notes> | <cd:notes></cd:notes> | ||
<cd:seealso> | <cd:seealso> |
Revision as of 17:28, 30 January 2021
Contents
\setuphead
Summary
Former wiki page Command_old/setuphead is under migration to ConTeXtXML extension Command#Pre-existing_pages
Settings
\setuphead[...,...][...=...,...] | |
[...,...] | section |
frontpartlabel | name |
bodypartlabel | name |
appendixlabel | name |
backpartlabel | name |
expansion | yes no xml |
catcodes | name |
sectionresetset | name |
sectionseparatorset | name |
sectionconversionset | name |
conversion | name |
sectionstarter | command processor->command |
sectionstopper | command processor->command |
sectionset | name |
sectionsegments | number number:number number:* number:all section section:section section:* section:all current |
referenceprefix | + - text |
style | style command |
color | color |
textstyle | style command |
textcolor | color |
numberstyle | style command |
numbercolor | color |
coupling | section |
ownnumber | yes no |
beforesection | command |
aftersection | command |
insidesection | command |
incrementnumber | yes no list empty |
placehead | yes no hidden empty section |
number | yes no |
page | see \page |
marking | page reset |
header | start stop high none normal empty nomarking name |
text | start stop high none normal empty nomarking name |
footer | start stop high none normal empty nomarking name |
before | command |
after | command |
inbetween | command |
continue | yes no |
aligntitle | yes no float |
interlinespace | name |
interaction | list reference |
internalgrid | name |
grid | normal standard yes strict tolerant top bottom both broad fit first last high one low none line strut box min max middle math math:line math:halfline math:-line math:-halfline name |
align | see \setupalign |
tolerance | see \setuptolerance |
strut | yes no |
hang | line broad fit none number |
margin | dimension |
indentnext | yes no auto |
alternative | text paragraph normal margin inmargin top middle bottom reverse margintext name |
width | dimension |
numberwidth | dimension |
textwidth | dimension |
distance | dimension |
textdistance | dimension |
commandbefore | command |
commandafter | command |
command | twoarguments |
textcommand | oneargument |
deeptextcommand | oneargument |
numbercommand | oneargument |
deepnumbercommand | oneargument |
location | name |
criterium | strict positive all |
hidenumber | yes no |
Option | Explanation | ||||||
---|---|---|---|---|---|---|---|
expansion |
| ||||||
sectionsegments |
| ||||||
style |
| ||||||
number |
| ||||||
page |
| ||||||
header |
| ||||||
continue |
| ||||||
aligntitle |
|
Description
Examples
First 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
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
Inline headings similar to LaTeX&squo;s \paragraph{}
Modified from (https://tex.stackexchange.com/questions/375922/paragraph-title-in-context-similar-to-latex-paragraph).
\definehead[paragraph][subsubsubsubject] \setuphead [paragraph] [ textdistance=0pt, commandafter={.}, alternative=text, style=sc, ] \startparagraph[title=Knuth quote] \input knuth \stopparagraph
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