Changes

Jump to navigation Jump to search
6,120 bytes added ,  15:02, 8 September 2023
m
add source link
<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 name="expansion">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="yes">expands the xml reference to actual content for title and bookmark (<code>\xmlatt {xml:name::4}{title} </code> <code>First section)</code>, see TUC file.  To expand userdata also use <code>\normalexpanded{\startsection[title=\xmlatt{#1}{title}]} </code> instead of <code>expansion=yes</code>.  <code>\normalexpanded{} </code> and are not in conflict, so you can use both.</cd:constant>
<cd:constant default="yes" type="no">no expansion, xml reference is used</cd:constant>
<cd:constant type="xml"> ?</cd:constant>
</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 text and 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="aftersection">
<cd:paramdoc>Command to run after the section finishes e.g. at a <code>\stopchapter</code> statement.</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>
<cd:parameter name="before">
<cd:paramdoc>Command to run before the heading is written</cd:paramdoc>
<cd:constant type="cd:command"></cd:constant>
</cd:parameter>
<cd:parameter name="after">
<cd:paramdoc>Command to run after the heading is written, e.g. <code>after={\blank[3cm]}</code></cd:paramdoc>
<cd:constant type="cd:command"></cd:constant>
</cd:parameter>
<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>
</cd:command>
</cd:variants>
<cd:description><!-- To headings is associated the long description text, i.e. the content of the heading, but can also be associated numbers. These data can be processed for typesetting : * add a dot between the text and the number,* add a generic text before the "pure text"* appearance can be different for the text if we use it in the headers / footers, or in the Table of Content.* add vertical spaces before or after the text* add rules before or after the whole section under the heading* select if the command goes here -->title should appear on a right or a left page. 
</cd:description>
<cd:examples><cd:example title="First example"><context source="yes" text="produces">
\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) In the discussion that ensued, Wolfgang posted the following elegant solution using {{cmd|definepageinjection}} [slightly re-formatted from (https://www.mail-archive.com/ntg-context@ntg.nl/msg101462.html)] — <context source="yes" text="which produces">% to render examples in the wiki\definepapersize[sheet][width=24cm,height=24cm]\definepapersize[page][width=6cm,height=6cm]\setuppapersize[page][sheet]\setuppaper[nx=4, ny=4]\setuparranging [XY]\setupbodyfont[6pt] % actual example starts here\setupexternalfigures [location=default] \setuppagenumbering [alternative=doublesided] \definepageinjection [chapter:start] [empty] [page=left] \definepageinjection [chapter:insert] [previouspage] [pagestate=stop,width=\paperwidth] \setuphead [chapter] [beforesection={\pageinjection[chapter:start]}, insidesection={\pageinjection[chapter:insert][name=\structureuservariable{image}]}] \starttext \startchapter [title={Cow}] [image=cow]\dorecurse{2}{\samplefile{klein}}\stopchapter \startchapter [title={Mill}] [image=hacker]\dorecurse{4}{\samplefile{lorem}}\stopchapter \startchapter [title={Mill}] [image=mill]\dorecurse{2}{\samplefile{klein}}\stopchapter\stoptext</context> The source code is in {{src|page-inj.mklx}}.</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">\popbackgroundstartluacodeinterfaces.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>
<cd:commandref name="setuptolerance" originator="system"></cd:commandref>
<cd:source file="strc-sec.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Structure"></cd:wikipage><cd:source file="page-inj.mklx">(page injections)</cd:source></cd:seealso>
</cd:commandgroup>

Navigation menu