summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/strc-itm.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/strc-itm.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/strc-itm.mkiv347
1 files changed, 256 insertions, 91 deletions
diff --git a/Master/texmf-dist/tex/context/base/strc-itm.mkiv b/Master/texmf-dist/tex/context/base/strc-itm.mkiv
index 6799a02a67d..7207494ed49 100644
--- a/Master/texmf-dist/tex/context/base/strc-itm.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-itm.mkiv
@@ -17,24 +17,26 @@
\unprotect
-\newconditional\sublistitem \setfalse\sublistitem
-\newconditional\symbollistitem \setfalse\symbollistitem
-\newconditional\headlistitem \setfalse\headlistitem
-\newconditional\introlistitem \setfalse\introlistitem
-\newconditional\randomizeitems \setfalse\randomizeitems
-\newconditional\autointrolistitem \setfalse\autointrolistitem
-\newconditional\optimizelistitem \settrue \optimizelistitem
-\newconditional\packlistitem \setfalse\packlistitem
-\newconditional\paragraphlistitem \setfalse\paragraphlistitem
-\newconditional\textlistitem \setfalse\textlistitem
-\newconditional\firstlistitem \setfalse\firstlistitem
-\newconditional\beforelistitem \setfalse\beforelistitem
-\newconditional\afterlistitem \setfalse\afterlistitem
-\newconditional\nowhitelistitem \setfalse\nowhitelistitem
-\newconditional\joinedlistitem \setfalse\joinedwhitelistitem
-\newconditional\reverselistitem \setfalse\reverselistitem
-\newconditional\continuelistitems \setfalse\continuelistitems
-\newconditional\fittinglistitems \setfalse\fittinglistitems
+\newconditional\sublistitem \setfalse\sublistitem
+\newconditional\symbollistitem \setfalse\symbollistitem
+\newconditional\headlistitem \setfalse\headlistitem
+\newconditional\introlistitem \setfalse\introlistitem
+\newconditional\randomizeitems \setfalse\randomizeitems
+\newconditional\autointrolistitem \setfalse\autointrolistitem
+\newconditional\optimizelistitem \settrue \optimizelistitem
+\newconditional\packlistitem \setfalse\packlistitem
+\newconditional\paragraphlistitem \setfalse\paragraphlistitem
+\newconditional\textlistitem \setfalse\textlistitem
+\newconditional\firstlistitem \setfalse\firstlistitem
+\newconditional\beforelistitem \setfalse\beforelistitem
+\newconditional\afterlistitem \setfalse\afterlistitem
+\newconditional\nowhitelistitem \setfalse\nowhitelistitem
+\newconditional\joinedlistitem \setfalse\joinedwhitelistitem
+\newconditional\reverselistitem \setfalse\reverselistitem
+\newconditional\continuelistitems \setfalse\continuelistitems
+\newconditional\fittinglistitems \setfalse\fittinglistitems
+\newconditional\indentedfirstlistitem \setfalse\indentedfirstlistitem
+\newconditional\inlinelistitem \setfalse\inlinelistitem
\newcount\noflists
\newcount\currentnoflists
@@ -64,13 +66,15 @@
{\edef\currentnofitems {\ctxlua{structure.itemgroups.nofitems("\currentitemgroup",\number\currentnoflists)}}%
\edef\currentitemmaxwidth{\ctxlua{structure.itemgroups.maxwidth("\currentitemgroup",\number\currentnoflists)}\scaledpoint}}
+% todo: \dodosetreference -> \dostructurecountercomponent (to be checked)
+
\def\dohandleitemreference % we will make a decent number helper
{\ifx\currentitemreference \empty \else
\setnextinternalreference
\ctxlua { jobreferences.setandgetattribute("\s!full", "\referenceprefix","\currentitemreference",
{
metadata = {
- kind = "list",
+ kind = "item",% ?
catcodes = \the\catcodetable,
xmlroot = \ifx\currentreferencecoding\s!xml "\xmldocument" \else nil \fi, % only useful when text
},
@@ -78,6 +82,16 @@
internal = \nextinternalreference,
section = structure.sections.currentid(),
},
+ prefixdata = structure.helpers.simplify {
+ prefix = "\structurecounterparameter\currentitemgroupcounter\c!prefix",
+ separatorset = "\structurecounterparameter\currentitemgroupcounter\c!prefixseparatorset",
+ conversion = \!!bs\structurecounterparameter\currentitemgroupcounter\c!prefixconversion\!!es,
+ conversionset = "\structurecounterparameter\currentitemgroupcounter\c!prefixconversionset",
+ set = "\structurecounterparameter\currentitemgroupcounter\c!prefixset",
+ segments = "\structurecounterparameter\currentitemgroupcounter\c!prefixsegments",
+ % segments = "\askedprefixsegments",
+ connector = \!!bs\structurecounterparameter\currentitemgroupcounter\c!prefixconnector\!!es,
+ },
numberdata = structure.helpers.simplify {
numbers = structure.counters.compact("\currentitemgroupcounter",nil,true),
separatorset = "\structurecounterparameter\currentitemgroupcounter\c!numberseparatorset",
@@ -90,9 +104,10 @@
})
}%
\xdef\currentitemattribute{\number\lastdestinationattribute}%
- \begingroup\dosetattribute{destination}\currentitemattribute\kern\zeropoint\endgroup % todo
+ \begingroup\attribute\destinationattribute\currentitemattribute\kern\zeropoint\endgroup % todo
\fi}
+
% \startitemize[n,packed]
% \item test \item test \item test
% \stopitemize
@@ -141,26 +156,55 @@
\def\@@itemcounter{\s!itemcount\currentitemgroup}
-\def\doitembreak#1{\ifconditional\optimizelistitem\ifconditional\textlistitem\else\dosomebreak#1\fi\fi}
+% \def\doitembreak#1{\ifconditional\optimizelistitem\ifconditional\textlistitem\else\dosomebreak#1\fi\fi}
+%
+% \def\allowitembreak {\doitembreak\allowbreak}
+% \def\noitembreak {\doitembreak\nobreak}
+% \def\itembreakspecial {\doitembreak\itembreak}
+% \def\noitembreakspecial{\doitembreak\itemnobreak}
+%
+% \def\itembreak {\flushnotes\penalty-5\relax} % -10
+% \def\itemnobreak{\flushnotes\penalty+5\ifinsidecolumns\else00\fi\relax} % +5
+
+\definevspacing[\v!item @0] [penalty:0] % allow
+\definevspacing[\v!item @10000] [penalty:10000] % no
+\definevspacing[\v!item @-5] [penalty:-5]
+\definevspacing[\v!item @5] [penalty:5]
+\definevspacing[\v!item @500] [penalty:500]
+
+\def\doitembreak#1{\ifconditional\optimizelistitem\ifconditional\textlistitem\else#1\fi\fi}
-\def\allowitembreak {\doitembreak\allowbreak}
-\def\noitembreak {\doitembreak\nobreak}
+\def\allowitembreak {\doitembreak\itembreakallow}
+\def\noitembreak {\doitembreak\itembreakno}
\def\itembreakspecial {\doitembreak\itembreak}
\def\noitembreakspecial{\doitembreak\itemnobreak}
-\def\itembreak {\flushnotes\penalty-5\relax} % -10
-\def\itemnobreak{\flushnotes\penalty+5\ifinsidecolumns\else00\fi\relax} % +5
+\def\itembreakallow{\vspacing[\v!item @0]}
+\def\itembreakno {\vspacing[\v!item @10000]}
+\def\itembreak {\flushnotes\vspacing[\v!item @-5]}
+\def\itemnobreak {\flushnotes\ifinsidecolumns\vspacing[\v!item @5]\else\vspacing[\v!item @500]\fi}
+
+% cool but wrong:
+%
+% \def\initializeitemgrouplevel#1%
+% {\ifcsname\??op\currentitemgroup#1\s!parent\endcsname
+% % ok
+% \else\ifnum#1>\plusone
+% \setevalue{\??op\currentitemgroup#1\s!parent}{\??op\currentitemgroup\the\numexpr#1-1\relax}%
+% \else
+% \setevalue{\??op\currentitemgroup#1\s!parent}{\??op\currentitemgroup}%
+% \fi\fi}
+%
+% so we have:
\def\initializeitemgrouplevel#1%
{\ifcsname\??op\currentitemgroup#1\s!parent\endcsname
% ok
- \else\ifnum#1>\plusone
- \setevalue{\??op\currentitemgroup#1\s!parent}{\??op\currentitemgroup\the\numexpr#1-1\relax}%
\else
\setevalue{\??op\currentitemgroup#1\s!parent}{\??op\currentitemgroup}%
- \fi\fi}
+ \fi}
-\def\defineitemgroup
+\unexpanded\def\defineitemgroup
{\dotripleempty\dodefineitemgroup}
\def\dodefineitemgroup[#1][#2][#3]% todo: clone
@@ -181,7 +225,7 @@
\newtoks\everysetupitemgroup
-\def\setupitemgroups % [#1]
+\unexpanded\def\setupitemgroups % [#1]
{\dodoubleargument\getparameters[\??oo]} % [#1]
\def\packitems
@@ -199,17 +243,19 @@
\def\dodosetupitemgroupconstant#1%
{\edef\itemgroupconstantvalue{#1}%
\ifx\itemgroupconstantvalue\empty\else
- \splitstring\itemgroupconstantvalue\at*\to\itemgroupfirst\and\itemgroupsecond
- \ifcsname\??op:::\itemgroupfirst\endcsname\csname\??op:::\itemgroupfirst\endcsname\fi
+ \splitstring\itemgroupconstantvalue\at*\to\itemgroupfirst\and\itemgroupsecond
+ \ifx\itemgroupsecond\empty
+ \let\itemgroupsecond\itemgroupfirst
+ \let\itemgroupfirst\!!plusone
+ \fi
+ \ifcsname\??op:::\itemgroupsecond\endcsname\csname\??op:::\itemgroupsecond\endcsname\fi
\fi}
-\newconditional\inlinelistitem \setfalse\inlinelistitem
-
\setvalue{\??op:::\v!packed }{\packitems}
\setvalue{\??op:::\v!intro }{\settrue\introlistitem} % here? not set to false
\setvalue{\??op:::\v!autointro}{\settrue\autointrolistitem}
-\setvalue{\??op:::\v!broad }{\ifx\itemgroupsecond\empty\def\itemgroupsecond{1}\fi
- \letitemparameter\currentitemlevel\c!factor\itemgroupsecond}
+\setvalue{\??op:::\v!broad }{\ifx\itemgroupfirst\empty\def\itemgroupfirst{1}\fi
+ \letitemparameter\currentitemlevel\c!factor\itemgroupfirst}
\setvalue{\??op:::\v!text }{\settrue\textlistitem
\settrue\inlinelistitem
\settrue\joinedlistitem
@@ -225,12 +271,12 @@
\setvalue{\??op:::\v!loose }{\setfalse\optimizelistitem}
\setvalue{\??op:::\v!fit }{\settrue\fittinglistitems}
\setvalue{\??op:::\v!nofit }{\setfalse\fittinglistitems}
-\setvalue{\??op:v:\v!paragraph}{\settrue\paragraphlistitem
+\setvalue{\??op:::\v!paragraph}{\settrue\paragraphlistitem
\packitems}
\setvalue{\??op:::\v!joinedup }{\settrue\joinedlistitem
\packitems}
-\setvalue{\??op:::\v!serried }{\edef\itemgroupsecond{-\ifx\itemgroupsecond\empty1\else\itemgroupsecond\fi}%
- \letitemparameter\currentitemlevel\c!factor\itemgroupsecond}
+\setvalue{\??op:::\v!serried }{\edef\itemgroupfirst{-\ifx\itemgroupfirst\empty1\else\itemgroupfirst\fi}%
+ \letitemparameter\currentitemlevel\c!factor\itemgroupfirst}
\setvalue{\??op:::\v!stopper }{\letitemparameter\currentitemlevel\c!placestopper\v!yes} % keep {}
\setvalue{\??op:::\v!unpacked }{\setfalse\packlistitem}
\setvalue{\??op:::\v!repeat }{\settrue\repeatlistitem}
@@ -240,7 +286,7 @@
\def\dosetupstandarditemgroup#1%
{\getparameters
[\??op\currentitemgroup#1]
- [\c!width=1.5em,\c!factor=0,\c!distance=.5em,\c!inner=,
+ [\c!width=1.5em,\c!factor=0,\c!distance=.5em,\c!inner=,\c!factor=0,
\c!beforehead=,\c!afterhead=\blank,\c!before=\blank,\c!inbetween=\blank,\c!after=\blank]}
% \def\packeditemspacing{\empty}
@@ -356,7 +402,7 @@
{\def\docommand##1{\dodosetupitemgroup[##1][#2][#3][#4]}%
\processcommalist[#1]\docommand}
-\def\setupitemgroup
+\unexpanded\def\setupitemgroup
{\doquadrupleempty\dosetupitemgroup}
\def\doadvanceitem
@@ -385,7 +431,15 @@
{\begingroup
\setupstructurecounter
[\currentitemgroupcounter]
- [\c!prefix=\v!no,
+ [%\c!prefix=\v!no,
+ \c!prefix=\getitemparameter\currentitemlevel\c!prefix,
+ \c!prefixstopper=\getitemparameter\currentitemlevel\c!prefixstopper,
+ \c!prefixseparatorset=\getitemparameter\currentitemlevel\c!prefixseparatorset,
+ \c!prefixconversion=\getitemparameter\currentitemlevel\c!prefixconversion,
+ \c!prefixconversionset=\getitemparameter\currentitemlevel\c!prefixseparatorset,
+ \c!prefixset=\getitemparameter\currentitemlevel\c!prefixset,
+ \c!prefixsegments=\getitemparameter\currentitemlevel\c!prefixsegments,
+ \c!prefixconnector=\getitemparameter\currentitemlevel\c!prefixconnector,
\c!criterium=\getitemparameter\currentitemlevel\c!criterium,
\c!numberorder=\ifconditional\reverselistitem\v!reverse\else\v!normal\fi,
\c!numberstopper=\expdoif{\getitemparameter\currentitemlevel\c!placestopper}\v!yes{\getitemparameter\currentitemlevel\c!stopper},
@@ -429,13 +483,26 @@
\let\@@opsymbol\empty}%
{}}}
-\def\calculatelistwidth#1% distance deals with 'broad'
- {\itemgrouplistwidth\getitemparameter#1\c!distance\relax
- \ifnum\getitemparameter#1\c!factor>\zerocount
+% \def\calculatelistwidth#1% distance deals with 'broad'
+% {\itemgrouplistwidth\getitemparameter#1\c!distance\relax
+% \ifnum\getitemparameter#1\c!factor>\zerocount
+% \ifdim\itemgrouplistwidth=\zeropoint \itemgrouplistwidth=.5em\fi
+% \fi
+% \multiply\itemgrouplistwidth \getitemparameter#1\c!factor
+% \advance \itemgrouplistwidth \getitemparameter#1\c!width\relax}
+
+\def\calculatelistwidth#1%
+ {\ifdim\currentitemmaxwidth>\zeropoint
+ \itemgrouplistwidth\currentitemmaxwidth
+ \else\ifnum\getitemparameter#1\c!factor>\zerocount
+ \itemgrouplistwidth\getitemparameter#1\c!step\relax
\ifdim\itemgrouplistwidth=\zeropoint \itemgrouplistwidth=.5em\fi
- \fi
- \multiply\itemgrouplistwidth \getitemparameter#1\c!factor
- \advance \itemgrouplistwidth \getitemparameter#1\c!width\relax}
+ \multiply\itemgrouplistwidth \getitemparameter#1\c!factor
+ \advance\itemgrouplistwidth\getitemparameter#1\c!width\relax
+ \else
+ \itemgrouplistwidth\getitemparameter#1\c!width\relax
+ \fi\fi
+ \advance\itemgrouplistwidth\getitemparameter#1\c!distance\relax}
% The next conditionals deal with \item \startitemgroup. It
% looks like a hack to skip back, but that way we preserve
@@ -446,7 +513,7 @@
\newconditional\autoconcatnextitem \settrue \autoconcatnextitem
\newsignal \itemsignal
-\def\startitemgroup
+\unexpanded\def\startitemgroup
{\dotripleempty\dostartitemgroup}
\def\dostartitemgroup[#1][#2][#3]%
@@ -524,7 +591,7 @@
\expandafter\flushcollecteditems
\fi}
-\def\stopcollectitems
+\unexpanded\def\stopcollectitems
{\ifconditional\randomizeitems
\newcounter\itemcollectcounterdone
\ifnum\itemcollectcounter>\zerocount
@@ -532,7 +599,7 @@
\fi
\fi}
-\def\startcollectitems
+\unexpanded\def\startcollectitems
{\ifconditional\randomizeitems
\newcounter\itemcollectcounter
\letvalue{\e!start\v!item}\collectitemgroupitem
@@ -540,7 +607,7 @@
%D End of plugin.
-\ifx\startcolumns\undefined \def\startcolumns[#1]{} \fi
+\ifx\startcolumns\undefined \unexpanded\def\startcolumns[#1]{} \fi
\ifx\stopcolumns \undefined \let\stopcolumns\relax \fi
\def\dosetsymalign#1% hm, we should use one of the core-spa macros or make a helper
@@ -553,6 +620,8 @@
\v!middle=>\let\symalignleft\hfil,
\v!center=>\let\symalignleft\hfil]}
+\let\currentitemindenting\empty
+
\def\redostartitemgroup[#1][#2]%
{\setfalse\inlinelistitem % new, no indent (leftskip)
\setfalse\concatnextitem % new, concat
@@ -622,8 +691,11 @@
\fi
\dosetraggedcommand{\getitemparameter\currentitemlevel\c!align}\raggedcommand
\dosetsymalign{\getitemparameter\currentitemlevel\c!symalign}%
- \doifsomething{\getitemparameter\currentitemlevel\c!indenting}
- {\normalexpanded{\noexpand\setupindenting[\getitemparameter\currentitemlevel\c!indenting]}}%
+ %\doifsomething{\getitemparameter\currentitemlevel\c!indenting}
+ % {\normalexpanded{\noexpand\setupindenting[\v!reset,\v!yes,\getitemparameter\currentitemlevel\c!indenting]}}%
+ % {\normalexpanded{\noexpand\setupindenting[\getitemparameter\currentitemlevel\c!indenting]}}%
+ %
+ \edef\currentitemindenting{\getitemparameter\currentitemlevel\c!indenting}%
%
\setitemlevel{#1}% moved to here
\ifx\listitem\empty
@@ -689,7 +761,7 @@
% \item \input ward \item \input ward \item \input ward
% \stopitemize \blank
-\def\stopitemgroup
+\unexpanded\def\stopitemgroup
{\stopcollectitems
\ifconditional\textlistitem
\removeunwantedspaces\space\ignorespaces
@@ -734,40 +806,50 @@
\dorechecknextindentation}
\newtoks\itemgroupcommands
+\newtoks\itemgroupfinalizer
\def\itemgroupitem
- {\doitemgroupitem}
+ {\the\itemgroupfinalizer
+ \doitemgroupitem}
\def\itemgroupnoitem
- {\doitemgroupnoitem}
+ {\the\itemgroupfinalizer
+ \doitemgroupnoitem}
\def\itemgroupbutton[#1]%
- {\gdef\doitemdestination{#1}%
+ {\the\itemgroupfinalizer
+ \gdef\doitemdestination{#1}%
\itemgroupitem}
\def\itemgroupdummy
- {\itemgroupsymbol{\strut}\strut}
+ {\the\itemgroupfinalizer
+ \itemgroupsymbol{\strut}\strut}
\def\itemgroupsubitem
- {\settrue\sublistitem
+ {\the\itemgroupfinalizer
+ \settrue\sublistitem
\itemgroupitem}
\def\itemgroupsymbol#1%
- {\def\symsymbol{#1}%
+ {\the\itemgroupfinalizer
+ \def\symsymbol{#1}%
\settrue\symbollistitem
\itemgroupitem}
\def\itemgroupedge#1%
- {\itemgroupsymbol
+ {\the\itemgroupfinalizer
+ \itemgroupsymbol
{\calculatelistwidth\currentitemlevel
\hbox to \itemgrouplistwidth
{#1\hskip\getitemparameter\currentitemlevel\c!distance}}}
\def\itemgrouphead
- {\settrue\headlistitem\doitemgrouphead}
+ {\the\itemgroupfinalizer
+ \settrue\headlistitem\doitemgrouphead}
\def\itemgroupitems
- {\dosingleempty\doitemgroupitems}
+ {\the\itemgroupfinalizer
+ \dosingleempty\doitemgroupitems}
\def\doitemgroupitems[#1]%
{\itemgroupedge
@@ -775,7 +857,8 @@
\unskip}}
\def\itemgroupmargin#1%
- {\def\marsymbol
+ {\the\itemgroupfinalizer
+ \def\marsymbol
{\llap
{\dosetitemattributes\currentitemlevel\c!marstyle\c!marcolor{#1}%
\hskip\leftskip\hskip\leftmargindistance}}%
@@ -795,6 +878,16 @@
\appendtoks \letvalue\v!mar \itemgroupmargin \to \itemgroupcommands
% todo : \startitem .. \stopitem
+%
+% beware, we don't group (yet) as we want to keep the left/right skip
+%
+% \startitemize
+% \startitem \stopitem
+% some intermediate text that will properly indent
+% \startitem \stopitem
+% \stopitem
+%
+% so we need to keep that property
\appendtoks
\letvalue{\e!start\v!item}\itemgroupitem
@@ -869,7 +962,7 @@
\else
\scratchdimen\zeropoint
\fi
- \llap{\hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+}\fi\box\itemgroupitembox\hss}}% was: \hfill
+ \llap{\hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+\enspace}\fi\box\itemgroupitembox\hss}}% was: \hfill
\hskip\scratchdimen}
\def\optimizelistitemsbreak
@@ -897,6 +990,18 @@
\fi
\fi\fi}
+\def\dodosubitem
+ {\ifconditional\sublistitem\llap{+\enspace}\fi}
+
+\def\dodolapitem
+ {\llap
+ {\hbox to \itemgrouplistwidth
+ {\dodosubitem
+ \symalignleft
+ \box\itemgroupitembox % can already have a forced widt, only factor handled here
+ \hfil
+ \hskip\getitemparameter\currentitemlevel\c!distance}}}
+
\def\dolistitem % evt aantal items opslaan per niveau, scheelt zoeken
{\ifconditional\textlistitem
% begin of item
@@ -905,7 +1010,16 @@
\fi
\advance\noflistelements\plusone
\optimizelistitemsbreak
- \noindent
+ \setfalse\indentedfirstlistitem
+ \ifx\currentitemindenting\empty \else
+ \normalexpanded{\noexpand\setupindenting[\v!reset,\v!yes,\currentitemindenting]}%
+ \doifnot{\getitemparameter\currentitemlevel\c!alignsymbol}\v!yes
+ {\ifindentfirstparagraph\settrue\indentedfirstlistitem\fi}%
+ \fi
+ \dontleavehmode
+ \ifconditional\indentedfirstlistitem
+ \hskip-\parindent
+ \fi
\setbox\itemgroupitembox\hbox
{\ifconditional\headlistitem
\ifconditional\symbollistitem
@@ -920,25 +1034,34 @@
\dosetitemattributes\currentitemlevel\c!style\c!color{\listitem}%
\fi
\fi}%
- \ifconditional\fittinglistitems
- \ifdim\wd\itemgroupitembox>\getitemparameter\currentitemlevel\c!maxwidth sp\relax
- \xsetitemparameter\currentitemlevel\c!maxwidth{\number\wd\itemgroupitembox}%
- \fi
- \ifdim\currentitemmaxwidth>\zeropoint
- \setbox\itemgroupitembox\simplealignedbox{\getitemparameter\currentitemlevel\c!itemalign}{\currentitemmaxwidth}{\box\itemgroupitembox}%
- \fi
- \fi
\doifsomething\doitemdestination
{\setbox\itemgroupitembox\hbox{\directgotobox{\box\itemgroupitembox}[\doitemdestination]}}%
- \globallet\doitemdestination\empty
\itemgroupaskedwidth\getitemparameter\currentitemlevel\c!width\relax
+ \ifconditional\fittinglistitems
+ \ifdim\wd\itemgroupitembox>\getitemparameter\currentitemlevel\c!maxwidth sp\relax
+ \xsetitemparameter\currentitemlevel\c!maxwidth{\number\wd\itemgroupitembox}%
+ \fi
+ \ifdim\currentitemmaxwidth>\zeropoint
+ \setbox\itemgroupitembox\simplealignedbox
+ {\getitemparameter\currentitemlevel\c!itemalign}
+ {\dimexpr\currentitemmaxwidth+\getitemparameter\currentitemlevel\c!distance\relax}
+ {\box\itemgroupitembox\hskip\getitemparameter\currentitemlevel\c!distance}%
+ \fi
+ \else\ifdim\itemgroupaskedwidth>\zeropoint
+ \doifsomething{\getitemparameter\currentitemlevel\c!itemalign}
+ {\setbox\itemgroupitembox\simplealignedbox
+ {\getitemparameter\currentitemlevel\c!itemalign}
+ {\dimexpr\itemgroupaskedwidth+\getitemparameter\currentitemlevel\c!distance\relax}
+ {\box\itemgroupitembox\hskip\getitemparameter\currentitemlevel\c!distance}}%
+ \fi\fi
+ \globallet\doitemdestination\empty
% new, prevents loops when symbol is (not yet found) graphic
\ht\itemgroupitembox\strutheight
\dp\itemgroupitembox\strutdepth
% so that content differs per run (esp mp graphics afterwards)
\checkforrepeatedlistitem
\ifdim\itemgroupaskedwidth<\zeropoint\relax
- \llap{\ifconditional\sublistitem\llap{+}\fi\box\itemgroupitembox\hskip\leftmargindistance}%
+ \llap{\ifconditional\sublistitem\llap{+\enspace}\fi\box\itemgroupitembox\hskip\leftmargindistance}%
\else
\ifdim\itemgroupaskedwidth=\zeropoint\relax
\calculatelistwidth1%
@@ -946,29 +1069,25 @@
\calculatelistwidth\currentitemlevel
\fi
\ifconditional\textlistitem
- \hbox{\ifconditional\sublistitem+\fi\box\itemgroupitembox\hskip\interwordspace}\nobreak
+ \hbox{\ifconditional\sublistitem+\enspace\fi\box\itemgroupitembox\hskip\interwordspace}\nobreak
\else\ifconditional\inlinelistitem
- \hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+}\fi\box\itemgroupitembox\hss}% was: \hfill
+ \hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+\enspace}\fi\box\itemgroupitembox\hss}% was: \hfill
\else\ifconditional\txtlistitem
\dodotxtitem
\else
- % todo: align+marge binnen de hbox
- \llap{\hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+}\fi
- \symalignleft
- \box\itemgroupitembox\hfil
- \hskip\getitemparameter\currentitemlevel\c!distance% T h
- }}%
+ \dodolapitem
\fi\fi\fi
\fi
- \forceunexpanded % needed for m conversion (\os) / i need to look into this
\setevalue{\@@currentitemsymbol\currentitemlevel}%
{\getvalue{\@@localitemsymbol\currentitemlevel}}% still problems with \uchar ?
%{\noexpand\getvalue{\@@localitemsymbol\currentitemlevel}}% no, spoils subrefs
- \resetunexpanded
\setfalse\headlistitem
\setfalse\sublistitem
\setfalse\symbollistitem
\EveryPar{\ignorespaces}% needed ?
+ \ifconditional\indentedfirstlistitem
+ \hskip\parindent
+ \fi
\ignorespaces}
% For Wolfgang Schuster
@@ -995,7 +1114,7 @@
\def\checkforrepeatedlistitem
{\ifconditional\repeatlistitem
\ifx\currentrepeatstart\empty
- \edef\currentrepeatstart{\the\numexpr\currentitemlevel-1}%
+ \let\currentrepeatstart\currentitemlevel
\fi
\setbox\itemgroupitembox\hbox to \wd\itemgroupitembox{\hskip-\itemgroupaskedwidth\box\itemgroupitembox}% what a hack !
\fi}
@@ -1058,7 +1177,11 @@
\fi
\else
\ifconditional\textlistitem % was bugged: \inlinelistitem
- \removeunwantedspaces\hskip\emwidth\!!plus\interwordstretch\!!minus\interwordshrink\relax % new per 2006/10/20
+ \ifhmode
+ % WS: make the distance between items customizable, think about better default values -> see itemize-1.tex
+ \normalexpanded{\doassigntextitemdistance{\getitemparameter\currentitemlevel\c!textdistance}}% HH: moved out and made configurable (sort of)
+ \removeunwantedspaces\hskip\textitemdistance\relax
+ \fi
\else
\iteminbetweencommand
\fi
@@ -1076,12 +1199,33 @@
\marsymbol
\let\marsymbol\relax
\strut % added 11-08-99
-% \dohandleitemreference
\setfalse\concatnextitem % new, concat
\nobreak % else problems with intext items
\hskip\itemsignal % new, concat
\getitemparameter\currentitemlevel\c!command} % \defaultitemcommand
+% \startitemize[text][space=medium]
+% \item one \item two \item three
+% \stopitemize
+
+\setvalue{\??op:\??op:\c!textdistance:\v!none}%
+ {\def\textitemdistance{\zeropoint}}
+
+\def\doassigngiventextitemdistance#1%
+ {\assignvalue
+ {#1}%
+ \textitemdistance
+ {.5\interwordspace\!!plus.5\emwidth}%
+ {\interwordspace \!!plus \emwidth}%
+ {\emwidth \!!plus \interwordstretch\!!minus\interwordshrink}}
+
+\unexpanded\def\doassigntextitemdistance#1%
+ {\ifcsname\??op:\??op:\c!textdistance:#1\endcsname
+ \csname\??op:\??op:\c!textdistance:#1\endcsname
+ \else
+ \doassigngiventextitemdistance{#1}%
+ \fi}
+
\def\defaultitemcommand
{\EveryPar{\ignorespaces}% needed ?
\ignorespaces}
@@ -1113,6 +1257,8 @@
% the next solution accepts \head test \type{x{x}x} test ...
+\let\doenditemhead\relax
+
\def\complexdoitemgrouphead[#1]% beter in \complexdosom hangen met een if
{\ifconditional\firstlistitem\else\allowitembreak\fi
\ifconditional\packlistitem\else\itembeforeheadcommand\fi
@@ -1123,6 +1269,7 @@
\bgroup
\dosetitemattributes\currentitemlevel\c!headstyle\c!headcolor\empty
\ignorespaces
+ \itemgroupfinalizer{\enditemhead}%
\let\par\enditemhead} % brrrr but simple anyway
\def\enditemhead
@@ -1186,11 +1333,29 @@
\c!start=1,
\c!criterium=\v!all, % permits 0 and negative numbers
%\c!option=,
+ \c!textdistance=\v!big,
\c!command=\defaultitemcommand,
+ \c!indenting=\v!next,
+ %\c!alignsymbol=v!no,
\c!symbol=\currentitemlevel]
+% new:
+
+\setupitemgroups
+ [\c!step=.5em, % deals with broad
+ \c!distance=\zeropoint]
+
\setupitemgroups
- [\c!numberseparatorset=,
+ [\c!prefix=\v!no,
+% \c!prefixstopper=.,
+% \c!prefixseparatorset=,
+% \c!prefixconversion=,
+% \c!prefixconversionset=,
+% \c!prefixset=,
+% \c!prefixsegments=1:100,
+ \c!prefixconnector=.,
+ %
+ \c!numberseparatorset=,
\c!numberconversionset=,
\c!numberstopper=.,
\c!numbersegments=1]