diff options
Diffstat (limited to 'tex/context/base/strc-itm.mkvi')
-rw-r--r-- | tex/context/base/strc-itm.mkvi | 168 |
1 files changed, 95 insertions, 73 deletions
diff --git a/tex/context/base/strc-itm.mkvi b/tex/context/base/strc-itm.mkvi index 2ef345e4b..6d04f27ed 100644 --- a/tex/context/base/strc-itm.mkvi +++ b/tex/context/base/strc-itm.mkvi @@ -697,70 +697,25 @@ \else \edef\itemgroupoptions{\itemgroupoptions,\itemgroupextraoptions}% \fi\fi - \redostartitemgroup{#settings}} - -\let\startcollectitems\relax -\let\stopcollectitems \relax - -\ifdefined\startcolumns \else \unexpanded\def\startcolumns[#settings]{} \fi -\ifdefined\stopcolumns \else \unexpanded\def\stopcolumns {} \fi - -\letvalue{\??itemgroupalign\v!flushleft }\relax -\letvalue{\??itemgroupalign\v!right }\relax -\letvalue{\??itemgroupalign\v!flushright}\hfill -\letvalue{\??itemgroupalign\v!left }\hfill -\letvalue{\??itemgroupalign\v!middle }\hfil -\letvalue{\??itemgroupalign\v!center }\hfil - -\def\strc_itemgroups_left_sym_filler - {\csname\??itemgroupalign\itemgroupparameter\c!symalign\endcsname} - -% symbols + states - -\def\strc_itemgroups_store_global_symbol#symbol% - {\letgvalue{\??itemgroupglobal\currentitemlevel}#symbol} - -\def\strc_itemgroups_store_local_symbol#symbol% - {\letgvalue{\??itemgrouplocal\currentitemlevel}#symbol} - -\def\strc_itemgroups_fetch_global_symbol - {\getvalue{\??itemgroupglobal\currentitemlevel}} - -\def\strc_itemgroups_fetch_local_symbol - {\getvalue{\??itemgrouplocal\currentitemlevel}} - -\def\strc_itemgroups_setup_symbol_default - {\edef\strc_itemgroups_asked_symbol{\itemgroupparameter\c!symbol}% - \strc_itemgroups_store_global_symbol\empty} - -\def\strc_itemgroups_setup_symbol_continue - {\ifcsname\??itemgroupglobal\currentitemlevel\endcsname - \let\strc_itemgroups_asked_symbol\strc_itemgroups_fetch_global_symbol - \else - \let\strc_itemgroups_asked_symbol\currentitemlevel - \fi} - -\def\strc_itemgroups_setup_symbol_asked - {\edef\strc_itemgroups_asked_symbol{\itemgroupparameter\c!symbol}} - -\unexpanded\def\redostartitemgroup#settings% k/v - {\begingroup % (2) + \begingroup % (2) \the\itemgroupcommands \let\c_strc_itemgroups_text_saved\c_strc_itemgroups_text \strc_itemgroups_initialize_local \strc_itemgroups_preset_stage_one\itemgroupoptions - \ifhmode - \ifconditional\c_strc_itemgroups_auto_concat - \ifdim\lastskip=\d_strc_itemgroups_signal - \settrue\c_strc_itemgroups_concat - \fi - \fi - \ifconditional\c_strc_itemgroups_text_saved \else - \ifconditional\c_strc_itemgroups_text \else - \par - \fi - \fi - \fi +% +% \ifhmode +% \ifconditional\c_strc_itemgroups_auto_concat +% \ifdim\lastskip=\d_strc_itemgroups_signal +% \settrue\c_strc_itemgroups_concat +% \fi +% \fi +% \ifconditional\c_strc_itemgroups_text_saved \else +% \ifconditional\c_strc_itemgroups_text \else +% \par +% \fi +% \fi +% \fi +% \iftrialtypesetting \savestructurecounter[\v_strc_itemgroups_counter]% \fi @@ -782,6 +737,20 @@ \strc_itemgroups_store_continue_state\itemgroupoptions{#settings}% \fi \fi + % + \ifhmode + \ifconditional\c_strc_itemgroups_auto_concat + \ifdim\lastskip=\d_strc_itemgroups_signal + \settrue\c_strc_itemgroups_concat + \fi + \fi + \ifconditional\c_strc_itemgroups_text_saved \else + \ifconditional\c_strc_itemgroups_text \else + \par + \fi + \fi + \fi + % \ifnum\c_strc_itemgroups_nesting=\plusone % NIEUW \doadaptleftskip {\itemgroupparameter\c!margin}% \doadaptleftskip {\itemgroupparameter\c!leftmargin}% @@ -842,6 +811,50 @@ \d_strc_itemgroups_asked_width\itemgroupparameter\c!width\relax \startcollectitems} +\let\startcollectitems\relax +\let\stopcollectitems \relax + +\ifdefined\startcolumns \else \unexpanded\def\startcolumns[#settings]{} \fi +\ifdefined\stopcolumns \else \unexpanded\def\stopcolumns {} \fi + +\letvalue{\??itemgroupalign\v!flushleft }\relax +\letvalue{\??itemgroupalign\v!right }\relax +\letvalue{\??itemgroupalign\v!flushright}\hfill +\letvalue{\??itemgroupalign\v!left }\hfill +\letvalue{\??itemgroupalign\v!middle }\hfil +\letvalue{\??itemgroupalign\v!center }\hfil + +\def\strc_itemgroups_left_sym_filler + {\csname\??itemgroupalign\itemgroupparameter\c!symalign\endcsname} + +% symbols + states + +\def\strc_itemgroups_store_global_symbol#symbol% + {\letgvalue{\??itemgroupglobal\currentitemlevel}#symbol} + +\def\strc_itemgroups_store_local_symbol#symbol% + {\letgvalue{\??itemgrouplocal\currentitemlevel}#symbol} + +\def\strc_itemgroups_fetch_global_symbol + {\getvalue{\??itemgroupglobal\currentitemlevel}} + +\def\strc_itemgroups_fetch_local_symbol + {\getvalue{\??itemgrouplocal\currentitemlevel}} + +\def\strc_itemgroups_setup_symbol_default + {\edef\strc_itemgroups_asked_symbol{\itemgroupparameter\c!symbol}% + \strc_itemgroups_store_global_symbol\empty} + +\def\strc_itemgroups_setup_symbol_continue + {\ifcsname\??itemgroupglobal\currentitemlevel\endcsname + \let\strc_itemgroups_asked_symbol\strc_itemgroups_fetch_global_symbol + \else + \let\strc_itemgroups_asked_symbol\currentitemlevel + \fi} + +\def\strc_itemgroups_setup_symbol_asked + {\edef\strc_itemgroups_asked_symbol{\itemgroupparameter\c!symbol}} + \def\strc_itemgroups_start_columns {\startcolumns [\c!n=\itemgroupparameter\c!n, @@ -896,11 +909,14 @@ \fi \global\advance\c_strc_itemgroups_nesting\minusone \xdef\currentitemlevel{\number\c_strc_itemgroups_nesting}% - \endgroup % (2) - \endgroup % (1) - \ifconditional\c_strc_itemgroups_text \else - \par % hm, already done - \fi + %\ifconditional\c_strc_itemgroups_text + \endgroup % (2) + \endgroup % (1) + %\else + % \endgroup % (2) + % \endgroup % (1) + % \par % hm, already done, and dangerous as \c_strc_itemgroups_text is already forgotten + %\fi \dorechecknextindentation} % The items. @@ -989,7 +1005,7 @@ \let\strc_itemgroups_margin_symbol\relax \dostarttagged\t!itemcontent\empty \strut - \nobreak % else problems with intext items + \nobreak % else problems with intext items \hskip\d_strc_itemgroups_signal % concat \itemgroupparameter\c!command} @@ -1235,7 +1251,7 @@ {\setfalse\c_strc_itemgroups_indented_first \ifx\m_strc_itemgroups_indenting\empty \else \normalexpanded{\setupindenting[\v!reset,\v!yes,\m_strc_itemgroups_indenting]}% - \ifindentfirstparagraph + \ifconditional\c_spac_indentation_indent_first % better is to have a mode \doifnot{\itemgroupparameter\c!alignsymbol}\v!yes {\settrue\c_strc_itemgroups_indented_first}% \fi @@ -1252,10 +1268,10 @@ \fi} \def\strc_itemgroups_insert_item - {\ifconditional\c_strc_itemgroups_text + {\ifconditional\c_strc_itemgroups_text % again? % begin of item \else - \par + \par % done twice? \fi \advance\c_strc_itemgroups_n_of_items\plusone \optimizelistitemsbreak @@ -1310,15 +1326,21 @@ \strc_itemgroups_check_for_repeated \ignorespaces} -\setvalue{\??itemgroupdistance\c!textdistance:\v!none}% +\setvalue{\??itemgroupdistance\v!none}% + {\let\m_strc_itemgroups_text_distance\zeropoint} + +\setvalue{\??itemgroupdistance\v!space}% + {\def\m_strc_itemgroups_text_distance{\interwordspace\!!plus\interwordstretch\!!minus\interwordshrink}} + +\setvalue\??itemgroupdistance % catches empty value {\let\m_strc_itemgroups_text_distance\zeropoint} \unexpanded\def\strc_itemgroups_set_text_item_distance {\edef\m_strc_itemgroups_text_distance{\itemgroupparameter\c!textdistance}% \ifx\m_strc_itemgroups_text_distance\empty % - \else\ifcsname\??itemgroupdistance\c!textdistance:\m_strc_itemgroups_text_distance\endcsname - \csname\??itemgroupdistance\c!textdistance:\m_strc_itemgroups_text_distance\endcsname + \else\ifcsname\??itemgroupdistance\m_strc_itemgroups_text_distance\endcsname + \csname\??itemgroupdistance\m_strc_itemgroups_text_distance\endcsname \else \strc_itemgroups_set_text_item_distance_indeed \fi\fi} @@ -1509,7 +1531,7 @@ \c!start=1, \c!criterium=\v!all, % permits 0 and negative numbers %\c!option=, - \c!textdistance=\v!big, + \c!textdistance=\v!space, % none big medium small <dimension> \c!command=\strc_itemgroups_default_command, \c!indenting=\v!next, %\c!alignsymbol=v!no, |