[texhax] inline lists

Heiko Oberdiek heiko.oberdiek at googlemail.com
Fri May 13 14:44:48 CEST 2011


On Fri, May 13, 2011 at 12:48:46PM +0200, Paul Isambert wrote:

> 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).

It's the LaTeX way, that \item is more considered markup.
If someone wants to define \listB, ... he would
have to use \itemB, ...

Yours sincerely
  Heiko Oberdiek


More information about the texhax mailing list