Difference between revisions of "Command/setuplist"
< Command
Jump to navigation
Jump to search
BruceH2020 (talk | contribs) |
(more options explained) |
||
Line 29: | Line 29: | ||
<cd:parameter name="criterium"> | <cd:parameter name="criterium"> | ||
<cd:paramdoc>Default criterium is <cd:iref name="criterium" type="local"/> for a newly defined list. That can cause an empty {{cmd|placelist}}. Criterium <cd:iref name="criterium" type="component"/> is used to establish [http://wiki.contextgarden.net/Table_of_Contents#ToC_.28and_other_lists.29_via_project_structures ToC (and other lists) via project structures].</cd:paramdoc> | <cd:paramdoc>Default criterium is <cd:iref name="criterium" type="local"/> for a newly defined list. That can cause an empty {{cmd|placelist}}. Criterium <cd:iref name="criterium" type="component"/> is used to establish [http://wiki.contextgarden.net/Table_of_Contents#ToC_.28and_other_lists.29_via_project_structures ToC (and other lists) via project structures].</cd:paramdoc> | ||
− | <cd:constant default="yes" type="local"></cd:constant> | + | <cd:constant default="yes" type="local">list of the current section/chapter</cd:constant> |
<cd:constant type="intro"></cd:constant> | <cd:constant type="intro"></cd:constant> | ||
<cd:constant type="reference"></cd:constant> | <cd:constant type="reference"></cd:constant> | ||
<cd:constant method="range" prefix="cd:sectionblock" type="reference"></cd:constant> | <cd:constant method="range" prefix="cd:sectionblock" type="reference"></cd:constant> | ||
− | <cd:constant type="all"></cd:constant> | + | <cd:constant type="all">complete list (e.g. ToC of a whole book)</cd:constant> |
<cd:constant method="range" prefix="cd:sectionblock" type="all"></cd:constant> | <cd:constant method="range" prefix="cd:sectionblock" type="all"></cd:constant> | ||
<cd:constant type="text"></cd:constant> | <cd:constant type="text"></cd:constant> | ||
Line 47: | Line 47: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="list"> | <cd:parameter name="list"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Inherit settings from this named list</cd:paramdoc> |
<cd:constant type="cd:name"></cd:constant> | <cd:constant type="cd:name"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
Line 84: | Line 84: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="starter"> | <cd:parameter name="starter"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Gets inserted before the (section) number</cd:paramdoc> |
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="stopper"> | <cd:parameter name="stopper"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Gets inserted after the (section) number</cd:paramdoc> |
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="command"> | <cd:parameter name="command"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Replace the rendering of the whole list entry with your own macro (number, text, page no.).</cd:paramdoc> |
<cd:constant type="cd:threearguments"></cd:constant> | <cd:constant type="cd:threearguments"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="numbercommand"> | <cd:parameter name="numbercommand"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Replace the rendering of the number with your own macro.</cd:paramdoc> |
<cd:constant type="cd:oneargument"></cd:constant> | <cd:constant type="cd:oneargument"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="textcommand"> | <cd:parameter name="textcommand"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Replace the rendering of the list entry text with your own macro.</cd:paramdoc> |
<cd:constant type="cd:oneargument"></cd:constant> | <cd:constant type="cd:oneargument"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="pagecommand"> | <cd:parameter name="pagecommand"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Replace the rendering of the page number with your own macro.</cd:paramdoc> |
<cd:constant type="cd:oneargument"></cd:constant> | <cd:constant type="cd:oneargument"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter list="yes" name="pagenumber"> | <cd:parameter list="yes" name="pagenumber"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Show page number?</cd:paramdoc> |
<cd:constant default="yes" type="yes"></cd:constant> | <cd:constant default="yes" type="yes"></cd:constant> | ||
<cd:constant type="no"></cd:constant> | <cd:constant type="no"></cd:constant> | ||
Line 115: | Line 115: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="headnumber"> | <cd:parameter name="headnumber"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Show head number?</cd:paramdoc> |
<cd:constant default="yes" type="yes"></cd:constant> | <cd:constant default="yes" type="yes"></cd:constant> | ||
<cd:constant type="no"></cd:constant> | <cd:constant type="no"></cd:constant> | ||
Line 121: | Line 121: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="before"> | <cd:parameter name="before"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Insert before list.</cd:paramdoc> |
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="after"> | <cd:parameter name="after"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Insert after list.</cd:paramdoc> |
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="inbetween"> | <cd:parameter name="inbetween"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Insert between list entries.</cd:paramdoc> |
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
Line 148: | Line 148: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="numberalign"> | <cd:parameter name="numberalign"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Alignment of the number</cd:paramdoc> |
<cd:constant type="left"></cd:constant> | <cd:constant type="left"></cd:constant> | ||
<cd:constant type="right"></cd:constant> | <cd:constant type="right"></cd:constant> | ||
Line 158: | Line 158: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="align"> | <cd:parameter name="align"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Alignment of the text</cd:paramdoc> |
<cd:inherit name="setupalign"></cd:inherit> | <cd:inherit name="setupalign"></cd:inherit> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="hang"> | <cd:parameter name="hang"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>indented text after number?</cd:paramdoc> |
<cd:constant default="yes" type="yes"></cd:constant> | <cd:constant default="yes" type="yes"></cd:constant> | ||
<cd:constant type="no"></cd:constant> | <cd:constant type="no"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="left"> | <cd:parameter name="left"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Insert before entry text</cd:paramdoc> |
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="right"> | <cd:parameter name="right"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Insert after entry text</cd:paramdoc> |
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
Line 193: | Line 193: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="style"> | <cd:parameter name="style"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>style of the whole entry</cd:paramdoc> |
<cd:constant type="cd:style"></cd:constant> | <cd:constant type="cd:style"></cd:constant> | ||
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="color"> | <cd:parameter name="color"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>color of the whole entry</cd:paramdoc> |
<cd:constant type="cd:color"></cd:constant> | <cd:constant type="cd:color"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="numberstyle"> | <cd:parameter name="numberstyle"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>style of the number</cd:paramdoc> |
<cd:constant type="cd:style"></cd:constant> | <cd:constant type="cd:style"></cd:constant> | ||
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="numbercolor"> | <cd:parameter name="numbercolor"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>color of the number</cd:paramdoc> |
<cd:constant type="cd:color"></cd:constant> | <cd:constant type="cd:color"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="textstyle"> | <cd:parameter name="textstyle"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>style of the entry text</cd:paramdoc> |
<cd:constant type="cd:style"></cd:constant> | <cd:constant type="cd:style"></cd:constant> | ||
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="textcolor"> | <cd:parameter name="textcolor"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>color of the entry text</cd:paramdoc> |
<cd:constant type="cd:color"></cd:constant> | <cd:constant type="cd:color"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="pagestyle"> | <cd:parameter name="pagestyle"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>style of the page number</cd:paramdoc> |
<cd:constant type="cd:style"></cd:constant> | <cd:constant type="cd:style"></cd:constant> | ||
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="pagecolor"> | <cd:parameter name="pagecolor"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>color of the page number</cd:paramdoc> |
<cd:constant type="cd:color"></cd:constant> | <cd:constant type="cd:color"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
Line 233: | Line 233: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="extras"> | <cd:parameter name="extras"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Trick to insert stuff into a list, e.g. page breaks</cd:paramdoc> |
<cd:constant type="cd:name"></cd:constant> | <cd:constant type="cd:name"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="order"> | <cd:parameter name="order"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Sort entries?</cd:paramdoc> |
<cd:constant type="command"></cd:constant> | <cd:constant type="command"></cd:constant> | ||
<cd:constant type="all"></cd:constant> | <cd:constant type="all"></cd:constant> | ||
Line 264: | Line 264: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="maxwidth"> | <cd:parameter name="maxwidth"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Max. width of the entry text</cd:paramdoc> |
<cd:constant type="cd:dimension"></cd:constant> | <cd:constant type="cd:dimension"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="pageprefix"> | <cd:parameter name="pageprefix"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>prefix of the page number; see <tt>prefix</tt> in {{cmd|setupcounter}}</cd:paramdoc> |
<cd:constant type="yes"></cd:constant> | <cd:constant type="yes"></cd:constant> | ||
<cd:constant type="no"></cd:constant> | <cd:constant type="no"></cd:constant> | ||
Line 306: | Line 306: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="pagestarter"> | <cd:parameter name="pagestarter"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Insert before the page number</cd:paramdoc> |
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
<cd:constant method="apply" prefix="cd:processor" type="cd:command"></cd:constant> | <cd:constant method="apply" prefix="cd:processor" type="cd:command"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="pagestopper"> | <cd:parameter name="pagestopper"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>Insert after the page number</cd:paramdoc> |
<cd:constant type="cd:command"></cd:constant> | <cd:constant type="cd:command"></cd:constant> | ||
<cd:constant method="apply" prefix="cd:processor" type="cd:command"></cd:constant> | <cd:constant method="apply" prefix="cd:processor" type="cd:command"></cd:constant> |
Revision as of 14:06, 22 April 2024
Contents
\setuplist
Summary
The command \setuplist configures collected lists like for the TOC
Settings
\setuplist[...,...][...=...,...] | |
[...,...] | list |
state | start stop |
location | none here |
type | simple command userdata |
criterium | local intro reference sectionblock:reference all sectionblock:all text sectionblock:text current sectionblock:current here previous sectionblock:previous component section sectionblock:section |
list | name |
width | fit broad dimension |
height | fit broad dimension |
depth | fit broad dimension |
symbol | one two three none default |
label | yes no none name |
starter | command |
stopper | command |
command | threearguments |
numbercommand | oneargument |
textcommand | oneargument |
pagecommand | oneargument |
pagenumber | yes no always realpage |
headnumber | yes no always |
before | command |
after | command |
inbetween | command |
margin | none dimension |
distance | none dimension |
aligntitle | yes no |
numberalign | left right middle flushleft flushright inner outer |
align | see \setupalign |
hang | yes no |
left | command |
right | command |
interaction | yes no all number text title page sectionnumber pagenumber |
limittext | yes no text |
style | style command |
color | color |
numberstyle | style command |
numbercolor | color |
textstyle | style command |
textcolor | color |
pagestyle | style command |
pagecolor | color |
reference | number |
extras | name |
order | command all title |
alternative | a b c d e f g left right top bottom command none interactive paragraph horizontal vertical name |
maxwidth | dimension |
pageprefix | yes no |
pageprefixseparatorset | name |
pageprefixconversionset | name |
pageprefixset | name |
pageprefixsegments | number number:number number:* number:all section section:section section:* section:all current |
pageprefixconnector | command processor->command |
pageconversionset | name |
pagestarter | command processor->command |
pagestopper | command processor->command |
...=...,... | inherits from \setupcounter |
...=...,... | inherits from \setupframed |
Option | Explanation | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
criterium |
| ||||||||||||||||||||
list |
| ||||||||||||||||||||
width |
| ||||||||||||||||||||
starter |
| ||||||||||||||||||||
stopper |
| ||||||||||||||||||||
command |
| ||||||||||||||||||||
numbercommand |
| ||||||||||||||||||||
textcommand |
| ||||||||||||||||||||
pagecommand |
| ||||||||||||||||||||
pagenumber |
| ||||||||||||||||||||
headnumber |
| ||||||||||||||||||||
before |
| ||||||||||||||||||||
after |
| ||||||||||||||||||||
inbetween |
| ||||||||||||||||||||
margin |
| ||||||||||||||||||||
distance |
| ||||||||||||||||||||
numberalign |
| ||||||||||||||||||||
align |
| ||||||||||||||||||||
hang |
| ||||||||||||||||||||
left |
| ||||||||||||||||||||
right |
| ||||||||||||||||||||
interaction |
| ||||||||||||||||||||
style |
| ||||||||||||||||||||
color |
| ||||||||||||||||||||
numberstyle |
| ||||||||||||||||||||
numbercolor |
| ||||||||||||||||||||
textstyle |
| ||||||||||||||||||||
textcolor |
| ||||||||||||||||||||
pagestyle |
| ||||||||||||||||||||
pagecolor |
| ||||||||||||||||||||
extras |
| ||||||||||||||||||||
order |
| ||||||||||||||||||||
alternative |
| ||||||||||||||||||||
maxwidth |
| ||||||||||||||||||||
pageprefix |
| ||||||||||||||||||||
pagestarter |
| ||||||||||||||||||||
pagestopper |
|
Description
Examples
Unnumbered ToC items, with some shift
Sometimes we need to insert unnumbered items into the ToC, and to specify them horizontal shift to "keep the look" of the other (numbered) items. Here "margin" option comes into play:
\setuppapersize[A7,landscape] \setuplist[alternative=c] \setuphead[subsubsection][number=no] \setuplist[subsubsection][margin=20mm] \starttext \placecontent \hairline \section{Section} \subsection{Subsection} \subsubsection{Subsubsection} \stoptext
Use different alternatives for different levels in the same ToC
You can use different alternatives for different levels.
\setuppapersize[A7,landscape] \setuplist[alternative=c] \setuplist[subsection][alternative=d] \starttext \placecontent \hairline \section{Section} \subsection{Subsection} \subsubsection{Subsubsection} \stoptext
Left-hand page numbers
The following example positions the page number to the left of the list entry title:
\define[3]\SectionToCEntry{ \leftaligned\bgroup \hbox to 2em{#3}% \hskip 1em \vtop{\hsize\dimexpr\textwidth-3em\relax#2}% \egroup } \setuplist [section] [alternative=interactive, command=\SectionToCEntry, after=\endgraf]
The alternative=interactive
is required to maintain hyperlinked page numbers when links are enabled in the document. Without the after=\endgraf
items would be displayed on one line.
Using tabular numbers
In a long TOC it looks awkward if proportional numbers are used. It is better to enable the font feature tabularnumbers:
\setuplist [chapter] [pagestyle={\feature[+][tabularnumbers]}]