Giuseppe Bilotta wrote:

Thursday, November 24, 2005 Taco Hoekwater wrote:

Giuseppe Bilotta wrote:
However, I find it really 'funny' that there are n different
methods to create items in an enumeration ... should these
be rather enumeration options, so that you can use the same
source code and just chang the stuff in \setup/\staritemize
to achieve the different effects?

This is why I was thinking of using \head, still, for
example.
this is a variant of taco's posted solution:

\unprotect

\def\complexdoitemgroupitem[#1]% too many historical \ignorespaces
 {\ifconditional\textlistitem
    % begin of item
  \else
    \par
  \fi
  \ignorespaces
  \ifconditional\concatnextitem % new, concat
    \doitembreak\nobreak        % new, concat
  \fi                           % new, concat
  \doadvanceitem
  \ifnum\itemcolumndepth=0\relax\ifnum\noflistelements>0\relax
    \doitembreak\nobreak
  \fi\fi
  \ifconditional\firstlistitem
    \setfalse\firstlistitem
    \begingroup
    \ifcase\itemlevel
    \or % 1
      \ifnum\itemcolumndepth=0\relax
        \ifconditional\introlistitem\doitembreak\nobreak\fi
        \getitemparameter1\c!before
        \ifconditional\introlistitem\doitembreak\nobreak\fi
      \fi
    \else % 2 en hoger
      \ifconditional\paragraphlistitem \else
        \let\previtemlevel\itemlevel
        \decrement\previtemlevel
        \ifcase\autoitemgroupspacing\relax % nieuw
          \getitemparameter\itemlevel\c!before
        \or
           \doifelsenothing{\getitemparameter\itemlevel\c!before}
             {\getitemparameter\itemlevel\c!before}
             {\getitemparameter\previtemlevel\c!inbetween}%
        \else
          \getitemparameter\previtemlevel\c!inbetween % == itemlevel-1
        \fi
      \fi
    \fi
  \else
    \getitemparameter\itemlevel\c!inbetween
  \fi
  \ifconditional\concatnextitem % new, concat
    \vskip-\lastskip            % new, concat
    \vskip-\lineheight          % new, concat
    \nobreak                    % new, concat
  \fi                           % new, concat
  \ignorespaces
  \dolistitem
  \ifconditional\packlistitem
    \setupwhitespace[\v!none]%
  \fi
  \getitemparameter\itemlevel\c!inner
  \marsymbol
  \let\marsymbol\relax
  \doifsomething{#1}
    {\doifnot\itemreference\unknownitemreference
       {\bgroup
        \protectconversion
        \rawreference\s!lst{#1}\itemreference
        \egroup}}%
  \strut % added 11-08-99
  \setfalse\concatnextitem % new, concat
  \hskip\itemsignal        % new, concat
  \getitemparameter\itemlevel\c!command}

\def\defaultitemcommand
 {\EveryPar{\ignorespaces}%
  \ignorespaces}

\def\doinitializeitemgrouplevel#1%
 {\copyparameters
    [\??op\currentitemgroup#1][\??oo]
    [\c!width,\c!factor,\c!distance,\c!align,\c!option,
     \c!style,\c!marstyle,\c!symstyle,\c!headstyle,
     \c!color,\c!marcolor,\c!symcolor,\c!headcolor,
     \c!beforehead,\c!afterhead,\c!before,\c!inbetween,\c!after,
     \c!stopper,\c!placestopper,\c!indenting,
     \c!n,\c!inner,\c!symbol,\c!margin,\c!items,
     \c!leftmargin,\c!rightmargin,\c!indentnext,
     \c!command,
     \c!start,\c!lefttext,\c!righttext]}

% test this: saves hash entries and is also faster
%
% \let\doinitializeitemgrouplevel\gobbleoneargument

\def\getitemparameter#1#2%
 {\executeifdefined{\??op\currentitemgroup#1#2}%
 {\executeifdefined{\??op\currentitemgroup  #2}%
 {\executeifdefined{\??oo                   #2}}}}

\setupitemgroups[\c!command=\defaultitemcommand]

\starttext

\def\MyItemCommand#1{{\bf#1}\quad}

\setupitemgroup[itemize][command=\MyItemCommand]

\startitemize
\item {test} is this okay?
\item {test} is this okay?
\item {test} is this okay?
\stopitemize

\stoptext

so, this way you can hook in a command that is executed after the symbol placement

Hans
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to