Difference between revisions of "Command/setupitemgroup"

From Wiki
Jump to navigation Jump to search
m
(Packcriterium description)
 
Line 4: Line 4:
 
</cd:shortdesc>
 
</cd:shortdesc>
 
<cd:variants>
 
<cd:variants>
<cd:command category="structure" file="strc-itm.mkvi" interfacedate="2020-07-14T09:24" interfacefile="i-itemgroup.xml" keywords="counter" level="style" name="setupitemgroup" variantnumber="1">
+
<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>name of the itemgroup to change.</cd:keywordsdoc>
+
     <cd:keywordsdoc></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>The nesting level to configure.</cd:keywordsdoc>
+
     <cd:keywordsdoc></cd:keywordsdoc>
     <cd:constant type="each">this setup will apply to all nesting levels</cd:constant>
+
     <cd:constant type="each"></cd:constant>
     <cd:constant type="cd:number">this setup will only influence a particular nesting level</cd:constant>
+
     <cd:constant type="cd:number"></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">always prevent a page break before the item list</cd:constant>
+
     <cd:constant type="intro"></cd:constant>
 
     <cd:constant type="random"></cd:constant>
 
     <cd:constant type="random"></cd:constant>
 
     <cd:constant type="continue"></cd:constant>
 
     <cd:constant type="continue"></cd:constant>
     <cd:constant type="packed">no whitespace between items</cd:constant>
+
     <cd:constant type="packed"></cd:constant>
     <cd:constant type="autointro">prevent a page break before the item list only when the last paragraph has only one or two lines</cd:constant>
+
     <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"></cd:constant>
Line 28: Line 28:
 
     <cd:constant type="nowhite"></cd:constant>
 
     <cd:constant type="nowhite"></cd:constant>
 
     <cd:constant type="margin"></cd:constant>
 
     <cd:constant type="margin"></cd:constant>
     <cd:constant type="inmargin">item separator in the margin</cd:constant>
+
     <cd:constant type="inmargin"></cd:constant>
     <cd:constant type="atmargin">item separator at the margin</cd:constant>
+
     <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 white space before and after itemization</cd:constant>
+
     <cd:constant type="joinedup"></cd:constant>
 
     <cd:constant type="serried"></cd:constant>
 
     <cd:constant type="serried"></cd:constant>
     <cd:constant type="stopper">punctuation after item separator</cd:constant>
+
     <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"></cd:constant>
     <cd:constant type="repeat">repeat higher-level number at lower levels, to produce e.g. 1.a.4.</cd:constant>
+
     <cd:constant type="repeat"></cd:constant>
 
     <cd:constant type="norepeat"></cd:constant>
 
     <cd:constant type="norepeat"></cd:constant>
 
     <cd:constant type="reverse"></cd:constant>
 
     <cd:constant type="reverse"></cd:constant>
     <cd:constant type="columns">typeset items in two columns</cd:constant>
+
     <cd:constant type="columns"></cd:constant>
 
     <cd:constant type="one"></cd:constant>
 
     <cd:constant type="one"></cd:constant>
 
     <cd:constant type="two"></cd:constant>
 
     <cd:constant type="two"></cd:constant>
Line 54: Line 54:
 
     <cd:constant type="eight"></cd:constant>
 
     <cd:constant type="eight"></cd:constant>
 
     <cd:constant type="nine"></cd:constant>
 
     <cd:constant type="nine"></cd:constant>
     <cd:constant type="standard">use the default setup</cd:constant>
+
     <cd:constant type="standard"></cd:constant>
     <cd:constant method="factor" prefix="cd:number" type="broad">extra horizontal white space after symbol</cd:constant>
+
     <cd:constant method="factor" prefix="cd:number" type="broad"></cd:constant>
     <cd:constant method="factor" prefix="cd:number" type="serried">little horizontal white space after symbol </cd:constant>
+
     <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 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">
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="2020-07-14T09:24" interfacefile="i-itemgroup.xml" keywords="counter" level="style" name="setupitemgroup" variant="assignment" variantnumber="2">
+
<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">See <cd:iref ordinal="1" variant=""/>, with an implied <code>each</code> for the second argument</cd:constant>
+
     <cd:constant type="cd:name"></cd:constant>
     <cd:constant method="range" prefix="cd:name" type="cd:number">See <cd:iref ordinal="1" variant=""/>, with the number part replacing <cd:iref ordinal="2" variant=""/></cd:constant>
+
     <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">

Latest revision as of 22:35, 7 February 2022


\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
beforecommand
aftercommand
inbetweencommand
beforeheadcommand
afterheadcommand
lefttextcommand
righttextcommand
leftcommand
rightcommand
factornumber
stepdimension
widthdimension
distancedimension
marginyes no standard dimension
leftmarginyes no standard dimension
rightmarginyes no standard dimension
leftmargindistanceyes no standard dimension
rightmargindistanceyes no standard dimension
alignsee \setupalign
indentingsee \setupindenting
startnumber
symalignleft middle right flushleft center flushright
symbolname
nnumber
indentnextyes no auto
innercommand
commandcsname
itemsnumber
maxwidthdimension
itemalignleft right middle flushleft flushright inner outer
alignsymbolyes no
textdistancesmall medium big none space dimension
placestopperyes no display inline
stylestyle command
colorcolor
headstylestyle command
headcolorcolor
marstylestyle command
marcolorcolor
symstylestyle command
symcolorcolor
gridsee \definegridsnapping
packcriteriumnumber
...=...,...inherits from \setupcounter

OptionExplanation
inbetween
command between items (e.g. spacing)
n
enter a number e.g. n=5
items
number of items when using \its
itemalign
Alignment of the number (if n is used)
headstyle
It works only if one uses \head instead of \item; the \head must stay as a paragraph, i.e. followed by an empty line or by the command \par.
packcriterium
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.
see \setupcounter To configure the counter used for this item group

Settings assignment

\setupitemgroup[...,...][...=...,...]
[...,...]name name:number
beforecommand
aftercommand
inbetweencommand
beforeheadcommand
afterheadcommand
lefttextcommand
righttextcommand
leftcommand
rightcommand
factornumber
stepdimension
widthdimension
distancedimension
optionintro 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
marginyes no standard dimension
leftmarginyes no standard dimension
rightmarginyes no standard dimension
leftmargindistanceyes no standard dimension
rightmargindistanceyes no standard dimension
alignsee \setupalign
indentingsee \setupindenting
startnumber
symalignleft middle right flushleft center flushright
symbolname
nnumber
indentnextyes no auto
innercommand
commandcsname
itemsnumber
maxwidthdimension
itemalignleft right middle flushleft flushright inner outer
alignsymbolyes no
textdistancesmall medium big none space dimension
placestopperyes no display inline
stylestyle command
colorcolor
headstylestyle command
headcolorcolor
marstylestyle command
marcolorcolor
symstylestyle command
symcolorcolor
gridsee \definegridsnapping
packcriteriumnumber
...=...,...inherits from \setupcounter

OptionExplanation
See [...=...,...] in variant default
option
See [...,...] in variant default

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

Gives:

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

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: