Changes

Jump to navigation Jump to search
3,509 bytes added ,  11:56, 1 January 2023
explain more options, links and examples
<cd:arguments>
<cd:keywords list="yes" optional="yes" ordinal="1">
<cd:keywordsdoc>Section level, e.g. chapter, section, subsection or number (1=part, 2=chapter). Can be a list.</cd:keywordsdoc>
<cd:constant type="cd:section"></cd:constant>
</cd:keywords>
<cd:assignmentsdoc></cd:assignmentsdoc>
<cd:parameter name="frontpartlabel">
<cd:paramdoc>Prefix of this section if it appears in frontmatter.</cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="bodypartlabel">
<cd:paramdoc>Prefix of this section if it appears in bodymatter.</cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="appendixlabel">
<cd:paramdoc>Prefix of this section if it appears in appendix.</cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="backpartlabel">
<cd:paramdoc>Prefix of this section if it appears in backmatter.</cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
</cd:parameter>
<cd:parameter name="sectionresetset">
<cd:paramdoc>Controls which section numbers get reset after a higher level section. See {{cmd|definestructureresetset}} or {{cmd|defineresetset}}.</cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="sectionseparatorset">
<cd:paramdoc>Controls the characters between section number elements.See {{cmd|definestructureseparatorset}}.</cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="sectionconversionset">
<cd:paramdoc>Controls the number conversion of section number elements. See {{cmd|definestructureconversionset}}.</cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="conversion">
<cd:paramdoc>Number conversion setting, e.g. "romannumerals", see {{cmd|defineconversion}}.</cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
</cd:parameter>
<cd:parameter name="sectionset">
<cd:paramdoc>Name of a section set (defined with {{cmd|defineprefixset}}) that sets the order of section segments (levels).</cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="sectionsegments">
<cd:paramdoc>which Which heading level(s) should be included, e. g. when head is numbered. Note, ":" specifies a range (e. g. "chapter:subsubsection")in numbering?</cd:paramdoc>
<cd:constant type="cd:number"></cd:constant>
<cd:constant method="range" prefix="cd:number" type="cd:number"></cd:constant>
<cd:constant method="range" prefix="cd:number" type="*"></cd:constant>
<cd:constant method="range" prefix="cd:number" type="all"></cd:constant>
<cd:constant type="cd:section">only this level, e.g. "chapter"</cd:constant> <cd:constant method="range" prefix="cd:section" type="cd:section">range of levels, e.g. "chapter:subsubsection"</cd:constant> <cd:constant method="range" prefix="cd:section" type="*">range of levels “this and all below”, e.g. "chapter:*"</cd:constant>
<cd:constant method="range" prefix="cd:section" type="all"></cd:constant>
<cd:constant type="current">only the current level (makes sense if you use \setuphead with several levels)</cd:constant>
</cd:parameter>
<cd:parameter name="referenceprefix">
</cd:parameter>
<cd:parameter name="style">
<cd:paramdoc>The style to use for the heading textand number. See manual [https://www.pragma-ade.com/general/manuals/ma-cb-en.pdf#page=81 Context: an excursion" section 33], Fonts and font switches, e.g. for large, bold, sans serif section headers use <code>style=\tfa\bf\ss</code>.</cd:paramdoc> <cd:constant type="cd:style">style keywords ("boldface") or commands ("\ss\bf")</cd:constant> <cd:constant type="cd:command">custom macro</cd:constant>
</cd:parameter>
<cd:parameter name="color">
<cd:paramdoc>Color to use for the heading text and number.</cd:paramdoc> <cd:constant type="cd:color">defined color name</cd:constant>
</cd:parameter>
<cd:parameter name="textstyle">
<cd:paramdoc>Style to use for the heading text.</cd:paramdoc>
<cd:constant type="cd:style"></cd:constant>
<cd:constant type="cd:command"></cd:constant>
</cd:parameter>
<cd:parameter name="textcolor">
<cd:paramdoc>Color to use for the heading text.</cd:paramdoc>
<cd:constant type="cd:color"></cd:constant>
</cd:parameter>
<cd:parameter name="numberstyle">
<cd:paramdoc>Color to use for the heading number.</cd:paramdoc>
<cd:constant type="cd:style"></cd:constant>
<cd:constant type="cd:command"></cd:constant>
</cd:parameter>
<cd:parameter name="numbercolor">
<cd:paramdoc>Color to use for the heading number.</cd:paramdoc>
<cd:constant type="cd:color"></cd:constant>
</cd:parameter>
</cd:parameter>
<cd:parameter name="ownnumber">
<cd:paramdoc>Set a custom section number; doesn’t change the numbering, e.g. the next chapter after <code>\startchapter[ownnumber=12]</code> will ''not'' get numbered 13.</cd:paramdoc>
<cd:constant type="yes"></cd:constant>
<cd:constant default="yes" type="no"></cd:constant>
</cd:parameter>
<cd:parameter name="beforesection">
<cd:paramdoc>Command to run before the section.</cd:paramdoc>
<cd:constant type="cd:command"></cd:constant>
</cd:parameter>
<cd:parameter name="number">
<cd:paramdoc></cd:paramdoc>
<cd:constant default="yes" type="yes">Include Show number before in chapter/section title</cd:constant> <cd:constant type="no">Do not include show number before in chapter/section title</cd:constant>
</cd:parameter>
<cd:parameter name="page">
</cd:parameter>
<cd:parameter name="footer">
<cd:paramdoc>Set a particular footer style, see {{cmd|setupheader}}.</cd:paramdoc>
<cd:constant type="start"></cd:constant>
<cd:constant type="stop"></cd:constant>
<cd:parameter name="continue">
<cd:paramdoc></cd:paramdoc>
<cd:constant default="yes" type="yes">If the section immediately follows a chapter higher level section it will be on the same page even though if page=yes.</cd:constant> <cd:constant type="no">If the section immediately follows a chapter higher level section it will start on a new page.</cd:constant>
</cd:parameter>
<cd:parameter name="aligntitle">
</cd:parameter>
<cd:parameter name="interlinespace">
<cd:paramdoc>Set the line height differently from the body text, see {{cmd|setupinterlinespace}}.</cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
</cd:parameter>
<cd:parameter name="grid">
<cd:paramdoc>How to vertically align this title in grid mode. Find examples in [https://www.pragma-ade.com/general/manuals/details.pdf details manual].</cd:paramdoc>
<cd:constant type="normal"></cd:constant>
<cd:constant type="standard"></cd:constant>
</cd:parameter>
<cd:parameter name="align">
<cd:paramdoc>Alignment of the title text</cd:paramdoc>
<cd:inherit name="setupalign"></cd:inherit>
</cd:parameter>
<cd:parameter name="tolerance">
<cd:paramdoc>Line breaking tolerance</cd:paramdoc>
<cd:inherit name="setuptolerance"></cd:inherit>
</cd:parameter>
<cd:parameter name="strut">
<cd:paramdoc>Use a {{cmd|strut}} to ensure the full line height?</cd:paramdoc>
<cd:constant default="yes" type="yes"></cd:constant>
<cd:constant type="no"></cd:constant>
</cd:parameter>
<cd:parameter name="hang">
<cd:paramdoc>Control protrusion (hanging)</cd:paramdoc>
<cd:constant type="line"></cd:constant>
<cd:constant type="broad"></cd:constant>
</cd:parameter>
<cd:parameter name="indentnext">
<cd:paramdoc>Indent following paragraph?</cd:paramdoc>
<cd:constant type="yes"></cd:constant>
<cd:constant type="no"></cd:constant>
</cd:parameter>
<cd:parameter name="width">
<cd:paramdoc>Width of the whole title.</cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="numberwidth">
<cd:paramdoc>Width of the section number.</cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="textwidth">
<cd:paramdoc>Width of the section title.</cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
</cd:parameter>
<cd:parameter name="command">
<cd:paramdoc>Command to use for typesetting the title; overrules all other styling. First argument is the number, second the title text.</cd:paramdoc>
<cd:constant type="cd:twoarguments"></cd:constant>
</cd:parameter>
<cd:parameter name="textcommand">
<cd:paramdoc>Command to use for typesetting the text of the title; argument is the formatted text.</cd:paramdoc>
<cd:constant type="cd:oneargument"></cd:constant>
</cd:parameter>
<cd:parameter name="deeptextcommand">
<cd:paramdoc>Like <tt>textcommand</tt>, but text is unformatted.</cd:paramdoc>
<cd:constant type="cd:oneargument"></cd:constant>
</cd:parameter>
<cd:parameter name="numbercommand">
<cd:paramdoc>Command to use for typesetting the number of the title; argument is the formatted number.</cd:paramdoc>
<cd:constant type="cd:oneargument"></cd:constant>
</cd:parameter>
<cd:parameter name="deepnumbercommand">
<cd:paramdoc>Like <tt>numbercommand</tt>, but number is unformatted.</cd:paramdoc>
<cd:constant type="cd:oneargument"></cd:constant>
</cd:parameter>
\mychapter{Animals}
\stoptext
</context></cd:example><cd:example title="Inline headings similar to LaTeX LaTeX’s &amplt;squocode&gt;s `\paragraph{}`&lt;/code&gt;">Modified from (https://tex.stackexchange.com/questions/375922/paragraph-title-in-context-similar-to-latex-paragraph).
<context mode="mkiv" source="yes" text="produces">
\input knuth
\stopparagraph
</context></cd:example><cd:example title="Setting label of a part">In MkIV, if 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">
\stoptext
</context>
 
(Thanks to Wolfgang Schuster on the mailing list for this information.)
</cd:example><cd:example title="Example of hidden sections"><context mode="mkiv" source="yes" text="produces">
\setupheadnumber[section] [8]
</context>
The command \{{cmd|pushbackground }} stores the values of the background which is modified. After the execution of \page[right] the old values of background are restored by \{{cmd|popbackground}}.
</cd:example><cd:example title="Special facing pages for chapters">On March 7, 2022, Julian asked on the mailing list about some method to place an image on the facing page of each chapter in a (double-sided) book. Chapters might also end on an even (equivalently, left) page, in which case, an empty right (odd) page should be introduced after so that the next chapter still has its image on its facing (left) page. (https://www.mail-archive.com/ntg-context@ntg.nl/msg101455.html)
\stopchapter
\stoptext
</context></cd:example><cd:example title="Different order of number elements">You need a new prefix-set to rearrange the order of the section numbers: <context source="yes" text="produces">\defineprefixset [reverse-section] [section,chapter] []\defineprefixset [reverse-subsection] [subsection,section,chapter] [] \setuphead[section][sectionset=reverse-section]\setuphead[subsection][sectionset=reverse-subsection] \starttext \startchapter [title={A}] \startsection [title={B}] \startsubsection [title={C}] \stopsubsection\startsubsection [title={D}] \stopsubsection\startsubsection [title={E}] \stopsubsection \stopsection \startsection [title={F}] \startsubsection [title={G}] \stopsubsection\startsubsection [title={H}] \stopsubsection\startsubsection [title={I}] \stopsubsection \stopsection \stopchapter \stoptext</context> (Example by Wolfgang Schuster on 2023-01-01)</cd:example><cd:example title="Leading zeros in section numbers">You can create your own conversion format: <context source="yes" text="produces">\startluacodeinterfaces.implement { name = "FourDigits", public = true, arguments = "string", actions = function(s) context("%04d",tonumber(s)) end}\stopluacode \defineconversion [FourDigits] [\FourDigits] \setuphead [chapter] [conversion=FourDigits] \starttext \startchapter [title={Chapter}] \stopchapter \stoptext</context> (Example by Wolfgang Schuster on 2023-01-01)</cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>

Navigation menu