Difference between revisions of "Command/setupitemgroup"
< Command
(7 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
</cd:shortdesc> | </cd:shortdesc> | ||
<cd:variants> | <cd:variants> | ||
− | <cd:command category="structure" file="strc-itm.mkvi" interfacedate=" | + | <cd:command category="structure" file="strc-itm.mkvi" interfacedate="2021-03-02T11:08" interfacefile="i-itemgroup.xml" keywords="counter" level="style" name="setupitemgroup" variantnumber="1"> |
<cd:arguments> | <cd:arguments> | ||
<cd:keywords ordinal="1"> | <cd:keywords ordinal="1"> | ||
− | <cd:keywordsdoc> | + | <cd:keywordsdoc>e.g. "itemize"</cd:keywordsdoc> |
<cd:constant type="cd:name"></cd:constant> | <cd:constant type="cd:name"></cd:constant> | ||
</cd:keywords> | </cd:keywords> | ||
<cd:keywords list="yes" optional="yes" ordinal="2"> | <cd:keywords list="yes" optional="yes" ordinal="2"> | ||
− | <cd:keywordsdoc> | + | <cd:keywordsdoc>item level</cd:keywordsdoc> |
− | <cd:constant type="each"> | + | <cd:constant type="each">all levels</cd:constant> |
− | <cd:constant type="cd:number"> | + | <cd:constant type="cd:number">only one level</cd:constant> |
</cd:keywords> | </cd:keywords> | ||
<cd:keywords list="yes" optional="yes" ordinal="3"> | <cd:keywords list="yes" optional="yes" ordinal="3"> | ||
<cd:keywordsdoc></cd:keywordsdoc> | <cd:keywordsdoc></cd:keywordsdoc> | ||
− | <cd:constant type="intro"> | + | <cd:constant type="intro">no page break in front of the itemgroup</cd:constant> |
− | <cd:constant type="random"></cd:constant> | + | <cd:constant type="random">randomize the order of items</cd:constant> |
− | <cd:constant type="continue"></cd:constant> | + | <cd:constant type="continue">continue numbering of previous itemgroup</cd:constant> |
− | <cd:constant type="packed">no | + | <cd:constant type="packed">no space between items</cd:constant> |
− | <cd:constant type="autointro"> | + | <cd:constant type="autointro"></cd:constant> |
<cd:constant type="broad"></cd:constant> | <cd:constant type="broad"></cd:constant> | ||
− | <cd:constant type="text"></cd:constant> | + | <cd:constant type="text">typeset items as running text</cd:constant> |
− | <cd:constant type="before"></cd:constant> | + | <cd:constant type="before">if `nowhite`, insert whitespace before the itemgroup</cd:constant> |
− | <cd:constant type="after"></cd:constant> | + | <cd:constant type="after">if `nowhite`, insert whitespace after the itemgroup</cd:constant> |
− | <cd:constant type="nowhite"></cd:constant> | + | <cd:constant type="nowhite">like `packed,joinedup`, but also works if {{cmd|setupwhitespace}} is set to something</cd:constant> |
<cd:constant type="margin"></cd:constant> | <cd:constant type="margin"></cd:constant> | ||
− | <cd:constant type="inmargin"> | + | <cd:constant type="inmargin">place bullets or numbers in the margin</cd:constant> |
− | <cd:constant type="atmargin"> | + | <cd:constant type="atmargin"></cd:constant> |
<cd:constant type="intext"></cd:constant> | <cd:constant type="intext"></cd:constant> | ||
<cd:constant type="headintext"></cd:constant> | <cd:constant type="headintext"></cd:constant> | ||
Line 36: | Line 36: | ||
<cd:constant type="nofit"></cd:constant> | <cd:constant type="nofit"></cd:constant> | ||
<cd:constant type="paragraph"></cd:constant> | <cd:constant type="paragraph"></cd:constant> | ||
− | <cd:constant type="joinedup">no | + | <cd:constant type="joinedup">no whitespace before or after itemgroup, except if {{cmd|setupwhitespace}} is set to something</cd:constant> |
<cd:constant type="serried"></cd:constant> | <cd:constant type="serried"></cd:constant> | ||
− | <cd:constant type="stopper"> | + | <cd:constant type="stopper"></cd:constant> |
<cd:constant type="nostopper"></cd:constant> | <cd:constant type="nostopper"></cd:constant> | ||
− | <cd:constant type="unpacked"></cd:constant> | + | <cd:constant type="unpacked">adds whitespace between items if `packed` is default</cd:constant> |
− | <cd:constant type="repeat">repeat | + | <cd:constant type="repeat">in nested itemgroups, repeat the number(s) of the parent item</cd:constant> |
− | <cd:constant type="norepeat"></cd:constant> | + | <cd:constant type="norepeat">opposite of `repeat`</cd:constant> |
<cd:constant type="reverse"></cd:constant> | <cd:constant type="reverse"></cd:constant> | ||
− | <cd:constant type="columns">typeset items in | + | <cd:constant type="columns">typeset items in 2 columns (only with `\startitem … \stopitem`)</cd:constant> |
− | <cd:constant type="one"></cd:constant> | + | <cd:constant type="one">typeset items in 1 column (if some other setting is default)</cd:constant> |
− | <cd:constant type="two"></cd:constant> | + | <cd:constant type="two">typeset items in 2 columns (only with `\startitem … \stopitem`)</cd:constant> |
− | <cd:constant type="three"></cd:constant> | + | <cd:constant type="three">typeset items in 3 columns (only with `\startitem … \stopitem`)</cd:constant> |
− | <cd:constant type="four"></cd:constant> | + | <cd:constant type="four">typeset items in 4 columns (only with `\startitem … \stopitem`)</cd:constant> |
− | <cd:constant type="five"></cd:constant> | + | <cd:constant type="five">typeset items in 5 columns (only with `\startitem … \stopitem`)</cd:constant> |
− | <cd:constant type="six"></cd:constant> | + | <cd:constant type="six">typeset items in 6 columns (only with `\startitem … \stopitem`)</cd:constant> |
− | <cd:constant type="seven"></cd:constant> | + | <cd:constant type="seven">typeset items in 4 columns (only with `\startitem … \stopitem`)</cd:constant> |
− | <cd:constant type="eight"></cd:constant> | + | <cd:constant type="eight">typeset items in 8 columns (only with `\startitem … \stopitem`)</cd:constant> |
− | <cd:constant type="nine"></cd:constant> | + | <cd:constant type="nine">typeset items in 9 columns (only with `\startitem … \stopitem`)</cd:constant> |
− | <cd:constant type="standard"> | + | <cd:constant type="standard"></cd:constant> |
− | <cd:constant method="factor" prefix="cd:number" type="broad"> | + | <cd:constant method="factor" prefix="cd:number" type="broad"></cd:constant> |
− | <cd:constant method="factor" prefix="cd:number" type="serried"> | + | <cd:constant method="factor" prefix="cd:number" type="serried"></cd:constant> |
<cd:constant type="horizontal"></cd:constant> | <cd:constant type="horizontal"></cd:constant> | ||
<cd:constant type="cd:name"></cd:constant> | <cd:constant type="cd:name"></cd:constant> | ||
Line 103: | Line 103: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="step"> | <cd:parameter name="step"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>step size of numbering (e.g. 2 = use every second number)</cd:paramdoc> |
<cd:constant type="cd:dimension"></cd:constant> | <cd:constant type="cd:dimension"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
Line 158: | Line 158: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="start"> | <cd:parameter name="start"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>start of numbering</cd:paramdoc> |
<cd:constant type="cd:number"></cd:constant> | <cd:constant type="cd:number"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="symalign"> | <cd:parameter name="symalign"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>alignment of the bullet/number</cd:paramdoc> |
<cd:constant type="left"></cd:constant> | <cd:constant type="left"></cd:constant> | ||
<cd:constant type="middle"></cd:constant> | <cd:constant type="middle"></cd:constant> | ||
Line 171: | Line 171: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="symbol"> | <cd:parameter name="symbol"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>name of a symbol as bullet</cd:paramdoc> |
<cd:constant type="cd:name"></cd:constant> | <cd:constant type="cd:name"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
Line 228: | Line 228: | ||
<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:constant type="display"></cd:constant> | ||
+ | <cd:constant type="inline"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="style"> | <cd:parameter name="style"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>style of the bullet/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="color"> | <cd:parameter name="color"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>color of the bullet/number</cd:paramdoc> |
<cd:constant type="cd:color"></cd:constant> | <cd:constant type="cd:color"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
Line 257: | Line 259: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="symstyle"> | <cd:parameter name="symstyle"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>same as style</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="symcolor"> | <cd:parameter name="symcolor"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>same as color</cd:paramdoc> |
<cd:constant type="cd:color"></cd:constant> | <cd:constant type="cd:color"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
Line 270: | Line 272: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="packcriterium"> | <cd:parameter name="packcriterium"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>A number. Automatically change from normal spacing to packed spacing when the list contains this many items or more. Note: you need to specify the 'packed' option in argument 3.</cd:paramdoc> |
<cd:constant type="cd:number"></cd:constant> | <cd:constant type="cd:number"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
Line 277: | Line 279: | ||
</cd:arguments> | </cd:arguments> | ||
</cd:command> | </cd:command> | ||
− | <cd:command category="structure" file="strc-itm.mkvi" interfacedate=" | + | <cd:command category="structure" file="strc-itm.mkvi" interfacedate="2021-03-02T11:08" interfacefile="i-itemgroup.xml" keywords="counter" level="style" name="setupitemgroup" variant="assignment" variantnumber="2"> |
<cd:arguments> | <cd:arguments> | ||
<cd:keywords list="yes" optional="yes" ordinal="1"> | <cd:keywords list="yes" optional="yes" ordinal="1"> | ||
<cd:keywordsdoc></cd:keywordsdoc> | <cd:keywordsdoc></cd:keywordsdoc> | ||
− | <cd:constant type="cd:name"> | + | <cd:constant type="cd:name"></cd:constant> |
− | <cd:constant method="range" prefix="cd:name" type="cd:number" | + | <cd:constant method="range" prefix="cd:name" type="cd:number"></cd:constant> |
</cd:keywords> | </cd:keywords> | ||
<cd:assignments list="yes" ordinal="2"> | <cd:assignments list="yes" ordinal="2"> | ||
Line 496: | Line 498: | ||
<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:constant type="display"></cd:constant> | ||
+ | <cd:constant type="inline"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="style"> | <cd:parameter name="style"> | ||
Line 569: | Line 573: | ||
\stopitemize | \stopitemize | ||
\stoptext | \stoptext | ||
− | </context></cd:example><cd:example title="Head style example"><context source="yes" text=" | + | </context></cd:example><cd:example title="Head style example"><context source="yes" text="Produces:" > |
+ | |||
\starttext | \starttext | ||
\startitemize[][headstyle=bold] | \startitemize[][headstyle=bold] | ||
Line 587: | Line 592: | ||
\stoptext | \stoptext | ||
</context> | </context> | ||
− | </cd:example></cd:examples> | + | |
+ | </cd:example><cd:example title="Change icon set default"><context source="yes"> | ||
+ | \setupitemgroup[itemize:1][symbol=3] % option=3 also works, n=3 is not what you want | ||
+ | |||
+ | \startitemize | ||
+ | \item Text Text Text Text Text Text Text Text Text Text Text Text | ||
+ | \item Text Text Text Text Text Text Text Text Text Text Text Text | ||
+ | \stopitemize | ||
+ | </context></cd:example><cd:example title="Bullets">Here are some bullets: | ||
+ | <context source="yes"> | ||
+ | \starttabulate[|T|ch{\symbol}|T|ch{\symbol}|] | ||
+ | \HL | ||
+ | \NC 1 \HC {1} \VL bullet \HC {bullet} \NC\NR | ||
+ | \NC 2 \HC {2} \VL dash \HC {dash} \NC\NR | ||
+ | \NC 3 \HC {3} \VL star \HC {star} \NC\NR | ||
+ | \NC \NC \VL asterisk \HC {asterisk} \NC\NR | ||
+ | \NC 4 \HC {4} \VL triangle \HC {triangle} \NC\NR | ||
+ | \NC \NC \VL blacktriangle \HC {blacktriangle} \NC\NR | ||
+ | \NC 5 \HC {5} \VL circle \HC {circle} \NC\NR | ||
+ | \NC 6 \HC {6} \VL \NC \NC\NR | ||
+ | \NC 7 \HC {7} \VL \NC \NC\NR | ||
+ | \NC 8 \HC {8} \VL square \HC {square} \NC\NR | ||
+ | \NC \NC \VL blacksquare \HC {blacksquare} \NC\NR | ||
+ | \NC \NC \VL diamond \HC {diamond} \NC\NR | ||
+ | \NC \NC \VL blackdiamond \HC {blackdiamond} \NC\NR | ||
+ | \NC 9 \HC {9} \VL checkmark \HC {checkmark} \NC\NR | ||
+ | \HL | ||
+ | \stoptabulate | ||
+ | </context></cd:example></cd:examples> | ||
<cd:notes></cd:notes> | <cd:notes></cd:notes> | ||
<cd:seealso> | <cd:seealso> |
Latest revision as of 09:39, 16 January 2024
Contents
\setupitemgroup
Summary
The command \setupitemgroup is used for configuring item groups.
Settings
\setupitemgroup[...][...,...][...,...][...=...,...] | |
[...] | name |
[...,...] | each number |
[...,...] | intro random continue packed autointro broad text before after nowhite margin inmargin atmargin intext headintext loose fit nofit paragraph joinedup serried stopper nostopper unpacked repeat norepeat reverse columns one two three four five six seven eight nine standard number*broad number*serried horizontal name |
before | command |
after | command |
inbetween | command |
beforehead | command |
afterhead | command |
lefttext | command |
righttext | command |
left | command |
right | command |
factor | number |
step | dimension |
width | dimension |
distance | dimension |
margin | yes no standard dimension |
leftmargin | yes no standard dimension |
rightmargin | yes no standard dimension |
leftmargindistance | yes no standard dimension |
rightmargindistance | yes no standard dimension |
align | see \setupalign |
indenting | see \setupindenting |
start | number |
symalign | left middle right flushleft center flushright |
symbol | name |
n | number |
indentnext | yes no auto |
inner | command |
command | csname |
items | number |
maxwidth | dimension |
itemalign | left right middle flushleft flushright inner outer |
alignsymbol | yes no |
textdistance | small medium big none space dimension |
placestopper | yes no display inline |
style | style command |
color | color |
headstyle | style command |
headcolor | color |
marstyle | style command |
marcolor | color |
symstyle | style command |
symcolor | color |
grid | see \definegridsnapping |
packcriterium | number |
...=...,... | inherits from \setupcounter |
Option | Explanation | ||
---|---|---|---|
e.g. "itemize" | |||
item level | |||
each | all levels | ||
number | only one level | ||
intro | no page break in front of the itemgroup | ||
random | randomize the order of items | ||
continue | continue numbering of previous itemgroup | ||
packed | no space between items | ||
text | typeset items as running text | ||
before | if nowhite , insert whitespace before the itemgroup |
||
after | if nowhite , insert whitespace after the itemgroup |
||
nowhite | like packed,joinedup , but also works if \setupwhitespace is set to something |
||
inmargin | place bullets or numbers in the margin | ||
joinedup | no whitespace before or after itemgroup, except if \setupwhitespace is set to something | ||
unpacked | adds whitespace between items if packed is default |
||
repeat | in nested itemgroups, repeat the number(s) of the parent item | ||
norepeat | opposite of repeat |
||
columns | typeset items in 2 columns (only with \startitem … \stopitem ) |
||
one | typeset items in 1 column (if some other setting is default) | ||
two | typeset items in 2 columns (only with \startitem … \stopitem ) |
||
three | typeset items in 3 columns (only with \startitem … \stopitem ) |
||
four | typeset items in 4 columns (only with \startitem … \stopitem ) |
||
five | typeset items in 5 columns (only with \startitem … \stopitem ) |
||
six | typeset items in 6 columns (only with \startitem … \stopitem ) |
||
seven | typeset items in 4 columns (only with \startitem … \stopitem ) |
||
eight | typeset items in 8 columns (only with \startitem … \stopitem ) |
||
nine | typeset items in 9 columns (only with \startitem … \stopitem ) |
||
inbetween |
| ||
step |
| ||
start |
| ||
symalign |
| ||
symbol |
| ||
n |
| ||
items |
| ||
itemalign |
| ||
style |
| ||
color |
| ||
headstyle |
| ||
symstyle |
| ||
symcolor |
| ||
packcriterium |
| ||
see \setupcounter | To configure the counter used for this item group |
Settings assignment
\setupitemgroup[...,...][...=...,...] | |
[...,...] | name name:number |
before | command |
after | command |
inbetween | command |
beforehead | command |
afterhead | command |
lefttext | command |
righttext | command |
left | command |
right | command |
factor | number |
step | dimension |
width | dimension |
distance | dimension |
option | intro random continue packed autointro broad text before after nowhite margin inmargin atmargin intext headintext loose fit nofit paragraph joinedup serried stopper unpacked repeat norepeat reverse columns one two three four five six seven eight nine standard number*broad number*serried horizontal name |
margin | yes no standard dimension |
leftmargin | yes no standard dimension |
rightmargin | yes no standard dimension |
leftmargindistance | yes no standard dimension |
rightmargindistance | yes no standard dimension |
align | see \setupalign |
indenting | see \setupindenting |
start | number |
symalign | left middle right flushleft center flushright |
symbol | name |
n | number |
indentnext | yes no auto |
inner | command |
command | csname |
items | number |
maxwidth | dimension |
itemalign | left right middle flushleft flushright inner outer |
alignsymbol | yes no |
textdistance | small medium big none space dimension |
placestopper | yes no display inline |
style | style command |
color | color |
headstyle | style command |
headcolor | color |
marstyle | style command |
marcolor | color |
symstyle | style command |
symcolor | color |
grid | see \definegridsnapping |
packcriterium | number |
...=...,... | inherits from \setupcounter |
Option | Explanation | ||
---|---|---|---|
See [...=...,...] in variant default | |||
option |
|
Description
This command controls all of the formatting for the specified item group, for example the name
itemize
configures the item group that is the environment \startitemize). \setupitemgroup[itemize] and \setupitemize are equivalent.
TODO: There are a great many options here, and not nearly all of them are documented. (See: To-Do List) |
Examples
Example 1
\setuppapersize[A8] % generates itemization like "Idea a: text text .." \setupitemize [1] % level of itemization [broad] [margin=no, distance=5em, stopper=, left=Idea , right=:] \starttext \startitemize[a] \item Text Text Text Text Text Text Text Text Text Text Text Text \item Text Text Text Text Text Text Text Text Text Text Text Text \stopitemize \stoptext
Head style example
\starttext \startitemize[][headstyle=bold] \head Head 1 \dorecurse{16}{some text } \head Head 2\par \dorecurse{10}{some other text } \stopitemize \startitemize[][headstyle=\em,afterhead={\blank[small]}] \head Head 3\par \dorecurse{10}{some closer text } \head Head 4\par \stopitemize \stoptext
Produces:
Change icon set default
\setupitemgroup[itemize:1][symbol=3] % option=3 also works, n=3 is not what you want \startitemize \item Text Text Text Text Text Text Text Text Text Text Text Text \item Text Text Text Text Text Text Text Text Text Text Text Text \stopitemize
Bullets
Here are some bullets:
\starttabulate[|T|ch{\symbol}|T|ch{\symbol}|] \HL \NC 1 \HC {1} \VL bullet \HC {bullet} \NC\NR \NC 2 \HC {2} \VL dash \HC {dash} \NC\NR \NC 3 \HC {3} \VL star \HC {star} \NC\NR \NC \NC \VL asterisk \HC {asterisk} \NC\NR \NC 4 \HC {4} \VL triangle \HC {triangle} \NC\NR \NC \NC \VL blacktriangle \HC {blacktriangle} \NC\NR \NC 5 \HC {5} \VL circle \HC {circle} \NC\NR \NC 6 \HC {6} \VL \NC \NC\NR \NC 7 \HC {7} \VL \NC \NC\NR \NC 8 \HC {8} \VL square \HC {square} \NC\NR \NC \NC \VL blacksquare \HC {blacksquare} \NC\NR \NC \NC \VL diamond \HC {diamond} \NC\NR \NC \NC \VL blackdiamond \HC {blackdiamond} \NC\NR \NC 9 \HC {9} \VL checkmark \HC {checkmark} \NC\NR \HL \stoptabulate