Received: by nummer-3.proteosys id <01C19443.45EE11AC@nummer-3.proteosys>; Thu, 3 Jan 2002 11:42:00 +0100 MIME-Version: 1.0 x-vm-v5-data: ([nil nil nil nil nil nil nil t nil][nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C19443.45EE11AC" X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message Subject: list indent et cetera Date: Mon, 2 Sep 1991 01:00:00 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: Sender: "LaTeX-L Mailing list" To: "Rainer M. Schoepf" Reply-To: "LaTeX-L Mailing list" Status: R X-Status: X-Keywords: X-UID: 375 This is a multi-part message in MIME format. ------_=_NextPart_001_01C19443.45EE11AC Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Yo! In a list environment the following three items are level dependent: - indentation distance - representation of item sign - representation of item number. In Lollipop there are now defaults for all of these, but during processing of a piece of the list macros test if control sequences \indentleveli/ii/iii/... \itemsigni/ii/... \itemcounterrepresentationi/ii/iii... are defined, and if so, those values are taken instead of the default. All of this is a tribute to the power of the TeX expansion mechanism. % allocate a counter that is increased for every \itemize list \new@@counter{itemlevel} % initially the itemize level is zero \add@style@stop@command{\set@counter{itemlevel}\z@} % a glimpse in the inards of Lollipop: a list is an % itemize list if it uses the 'itemsign'. % thus a list can be an 'itemize', 'enumerate' and 'description' % list at the same time. The appearance of keywords 'itemsign' % 'itemcounter', 'description' simply triggers the inclusions of % the relevant pieces of code. \newif\ifitem@list \add@List@default{\item@listno} \@ListOption{itemsign}{ \global\item@listyes \edef\cs@e{\nxp\@aan{\nxp\item@sign\counter@@name{itemlevel}}} \cs@e} % here we go: this is just for abbreviation \def\@item@sign#1{itemsign\romannumeral#1} % this macro test if for this particular level an itemsign % has been defined, if not it takes the deafult \def\item@sign#1{\ifnotdefined{\@item@sign{#1}}\@@item@sign{#1}% \else \csname \@item@sign{#1}\endcsname \fi} % and here are the defaults. \def\@@item@sign#1{\ifcase#1\relax\or $\bullet$\or $\circ$ \or --\else $\cdot$\fi} % this is the cute macro: % you call \SetItemSign:5=3Db % to get a bullet at level 5. \def\SetItemSign:#1=3D#2{\csarg\edef{\@item@sign{#1}}% {\cswitch \ifx#2 in: b $\bullet$; c $\circ$; d $\diamond$; m ---; n --; . $\cdot$; default $\cdot$; \endswitch}} Macros for counter representation and indentation are pretty analogous. Victor Eijkhout Center for Supercomputing Research and Development University of Illinois at Urbana-Champaign 305 Talbot Laboratory phone: +1 217 244-0047 (office) 104 South Wright Street +1 217 356-0876 (home) Urbana, Illinois 61801-2932, USA fax: +1 217 244-1351 home: 2503 W. Springfield Av, Apt. K-4, Champaign 61821, USA ------_=_NextPart_001_01C19443.45EE11AC Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable list indent et cetera

Yo!

In a list environment the following three items = are
level dependent:
- indentation distance
- representation of item sign
- representation of item number.

In Lollipop there are now defaults for all of = these,
but during processing of a piece of the list macros = test
if control sequences \indentleveli/ii/iii/...
\itemsigni/ii/... = \itemcounterrepresentationi/ii/iii...
are defined, and if so, those values are taken
instead of the default.

All of this is a tribute to the power of the
TeX expansion mechanism.

% allocate a counter that is increased for every = \itemize list
\new@@counter{itemlevel}

% initially the itemize level is zero
\add@style@stop@command{\set@counter{itemlevel}\z@}

% a glimpse in the inards of Lollipop: a list is = an
% itemize list if it uses the 'itemsign'.
% thus a list can be an 'itemize', 'enumerate' and = 'description'
% list at the same time. The appearance of keywords = 'itemsign'
% 'itemcounter', 'description' simply triggers the = inclusions of
% the relevant pieces of code.
\newif\ifitem@list
\add@List@default{\item@listno}
\@ListOption{itemsign}{
    \global\item@listyes
    = \edef\cs@e{\nxp\@aan{\nxp\item@sign\counter@@name{itemlevel}}}
    \cs@e}

% here we go: this is just for abbreviation
\def\@item@sign#1{itemsign\romannumeral#1}
% this macro test if for this particular level an = itemsign
% has been defined, if not it takes the = deafult
\def\item@sign#1{\ifnotdefined{\@item@sign{#1}}\@@item@sign{#1}%=
    \else \csname = \@item@sign{#1}\endcsname \fi}
% and here are the defaults.
\def\@@item@sign#1{\ifcase#1\relax\or
    $\bullet$\or $\circ$ \or --\else = $\cdot$\fi}
% this is the cute macro:
% you call \SetItemSign:5=3Db
% to get a bullet at level 5.
\def\SetItemSign:#1=3D#2{\csarg\edef{\@item@sign{#1}}%
   {\cswitch \ifx#2 in:
    b $\bullet$;
    c $\circ$;
    d $\diamond$;
    m ---;
    n --;
    . $\cdot$;
    default $\cdot$;
    \endswitch}}

Macros for counter representation and indentation = are
pretty analogous.

Victor Eijkhout
 Center for Supercomputing Research and = Development
 University of Illinois at = Urbana-Champaign
 305 Talbot = Laboratory          &nb= sp;      phone: +1 217 244-0047 (office)
 104 South Wright = Street           &= nbsp;          +1 217 = 356-0876 (home)
 Urbana, Illinois 61801-2932, = USA        fax: +1 217 = 244-1351

home: 2503 W. Springfield Av, Apt. K-4, Champaign = 61821, USA


------_=_NextPart_001_01C19443.45EE11AC--