[texhax] inline lists

Paul Isambert zappathustra at free.fr
Fri May 13 12:48:46 CEST 2011


Le 13/05/2011 12:32, Heiko Oberdiek a écrit :
> On Fri, May 13, 2011 at 09:50:01AM +0100, Philip TAYLOR (Webmaster, Ret'd) wrote:
>
>> Paul Isambert wrote:
>>> And let's make that fish a simple yet tasty meal:
>>>
>>>         \itemcount = `\a
>>>
>> I deliberately didn't do that !  It conflates semantics and presentation,
>> which is (IMHO) a Really Bad Idea\tm.
> Anyway, it's quite a small fish/meal, for people with more
> appetite and longer lists: ;-)
>
> \input alphalph.sty\relax
> \newcount \itemcount
>
> \def\list{%
>    \begingroup
>    \itemcount = 0 %
>    \def\theitemcount{%
>      (\alphalph{\the\itemcount})%
>    }%
>    \def\endlist{%
>      \endgroup
>    }%
>    \def\item{%
>      \ifhmode\penalty-1000 \fi
>      \advance\itemcount by 1 % or \global
>      \theitemcount
>      ~\ignorespaces
>    }%
> }

I'm sure there's a good reason why you redefine everything in every call 
to \list but I can't see it... (except perhaps because \item exists 
elsewhere, but the name can be changed).

Best,
Paul


More information about the texhax mailing list