3.7 Lists

  3.7.1 LaTeX
  3.7.2 Prosper
  3.7.3 Jeep
  3.7.4 Description
  3.7.5 List Utilities
  3.7.6 mdwlist
  3.7.7 nomencl

3.7.1 LaTeX

<..configure html4 latex..>+
 \Css{li p.indent { text-indent: 0em }}
 \Css{li p:first-child{ margin-top:0em; }}
 \Css{li p:last-child, li div:last-child { margin-bottom:0.5em; }}
 \Css{li p\string ~ul:last-child,
      li p\string ~ol:last-child{ margin-bottom:0.5em; }}
-_-_-

<..configure html4 latex..>+
 \ConfigureEnv{trivlist}
    {}{<.try env inline par.>}{}{}
 \ConfigureList{trivlist}%
    {\EndP\HCode{<dl \a:LRdir class="trivlist">}%
        <.save end:itm.>\global\let\end:itm=\empty}
    {<.recall end:itm.>\EndP\HCode{</dd></dl>}\ShowPar}
    {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
         class="trivlist">}\bgroup \bf}
    {\egroup\HCode{</dt><dd\Hnewline class="trivlist">}}
 \ConfigureEnv{list}
    {}{<.try env inline par.>}{}{}
 \ConfigureList{list}%
    {\EndP\HCode{<dl \a:LRdir class="list\expandafter\the
          \csname @listdepth\endcsname">}%
     <.save end:itm.>\global\let\end:itm=\empty}
    {<.recall end:itm.>\EndP\HCode{</dd></dl>}\ShowPar}
    {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
         class="list">}\bgroup \bf}
    {\egroup\HCode{</dt><dd\Hnewline class="list">}\par\ShowPar}
 \ConfigureEnv{itemize}
    {\ifvmode \IgnorePar\fi \EndP}{<.try env inline par.>}
    {}{}
 \ConfigureList{itemize}%
    {\EndP\HCode{<ul \a:LRdir
           class="\getClass{itemize}itemize\expandafter\the
           \csname @itemdepth\endcsname">}%
        \afterGetClass{itemize}%
        <.save end:itm.>\global\let\end:itm=\empty}
    {<.recall end:itm.>\ifvmode \IgnorePar\fi
     \EndP\HCode{</li></ul>}\ShowPar}
    {\end:itm \global\def\end:itm{\EndP\Tg</li>}\DeleteMark}
    {\HCode{<li class="\getClass{li}itemize">}\afterGetClass{li}}
 \NewConfigure{itemizeClass}{2}
 \Configure{itemizeClass}{}{}
 \NewConfigure{liClass}{2}
 \Configure{liClass}{}{}
-_-_-

<..configure html4 latex..>+
 \ConfigureEnv{enumerate}
    {}{<.try env inline par.>}{}{}
 \:CheckOption{enumerate-} \if:Option
    \ConfigureList{enumerate}%
       {<.enumerate I.>}
       {<.enumerate II.>}
       {<.enumerate III.>}
       {<.enumerate IV.>}
 \else
    \:CheckOption{enumerate+} \if:Option
       <.description-based enumerate list.>
    \else
       \ConfigureList{enumerate}%
          {<.enumerate I.>}
          {<.enumerate II.>}
          {<.enumerate III.>}
          {<.enumerate IV-.>}
       <.description-based enumerate list note.>
    \fi
    \Log:Note{for enumerated list elements li’s with value attributes,
                       use the command line option ‘enumerate-’}
 \fi
 \:CheckOption{css2} \if:Option
    <.css2 itemize.>
 \else
    \Log:Note{for CSS2 code, use the command line option ‘css2’}
 \fi
-_-_-

<..configure html4 enumerate..>
 <.description-based enumerate list.>
-_-_-

<..description-based enumerate list..>
 \ConfigureList{enumerate}%
    {\EndP\HCode{<dl \a:LRdir class="enumerate">}%
       \PushMacro\end:itm
       \global\let\end:itm=\empty}
    {\PopMacro\end:itm \global\let\end:itm \end:itm
       \EndP\HCode{</dd></dl>}\ShowPar}
    {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
         class="enumerate">}\bgroup \bf}
    {\egroup\EndP\HCode{</dt><dd\Hnewline class="enumerate">}}
 \Css{dd.enumerate {margin-left: 2em;}}
 \Css{dt.enumerate {float:left;
               clear:left;
               margin-right:0.5em;
               margin-left:0.5em;
               text-align:right; }}
-_-_-

<..description-based enumerate list note..>
 \Log:Note{for enumerated list elements with valued data,
                       use the command line option ‘enumerate+’}
-_-_-

<..css2 itemize..>
 \bgroup
    \def\textbullet{&\#x2219;}
    \def\textasteriskcentered{&\#x2217;}
    \Css{ul.itemize1 {list-style-type: none;}}
    \Css{ul.itemize1 li.itemize:before { display: marker;
                                   marker-offset: 0.5em;
                                         content: "\labelitemi\space" }}
    \Css{ul.itemize2 {list-style-type: none;}}
    \Css{ul.itemize2 li.itemize:before { display: marker;
                                   marker-offset: 0.5em;
                                         content: "\labelitemii\space" }}
    \Css{ul.itemize3 {list-style-type: none;}}
    \Css{ul.itemize3 li.itemize:before { display: marker;
                                   marker-offset: 0.5em;
                                         content: "\labelitemiii\space" }}
 \egroup
-_-_-

<..enumerate I..>
 \EndP\HCode{<ol \a:enumerate:\space
       class="enumerate\expandafter\the\csname @enumdepth\endcsname"
       \a:LRdir
      >}<.save end:itm.>\global\let\end:itm=\empty
-_-_-

<..enumerate II..>
 <.recall end:itm.>%
 \EndP\HCode{</li></ol>}\ShowPar
-_-_-

<..enumerate III..>
 \end:itm \gdef\end:itm{\EndP\Tg</li>}\DeleteMark
-_-_-

<..enumerate IV..>
 \HCode{<li class="enumerate" value="\expandafter\the\csname
    c@enum\romannumeral\the\@enumdepth\endcsname"\Hnewline>}\AnchorLabel
-_-_-

<..enumerate IV-..>
 {\Configure{Link}{li}{}{ class="enumerate" id=}{}%
  \let\EndLink=\empty \AnchorLabel }%
-_-_-

It is better to put the LI in the third field to avoid extra space to the following text.

<..configure html4 latex..>+
 \def\c:enumerate:#1{\c:enu #1<.par del.>}
 \def\c:enu#1#2#3#4#5<.par del.>{%
 \def\a:enumerate:{\ifcase \@enumdepth \or
          #1\or #2\or #3\or #4\else\fi #5}}
-_-_-

<..configure html4 latex..>+
 \Configure{enumerate}{{}{}{}{}}
 \Css{.enumerate1    {list-style-type:decimal;}}
 \Css{.enumerate2    {list-style-type:lower-alpha;}}
 \Css{.enumerate3    {list-style-type:lower-roman;}}
 \Css{.enumerate4    {list-style-type:upper-alpha;}}
-_-_-

 
 \:CheckOption{html+} \if:Option
   \Configure{enumerate}
    {%
     {style="list-style-type:decimal"}%
     {style="list-style-type:lower-alpha"}%
     {style="list-style-type:lower-roman"}%
     {style="list-style-type:upper-alpha"}%
    }
 \else
   \Log:Note{for stricter html code,
                       use the command line option ‘html+’}
   \Configure{enumerate}{%
     {type="\theenumi"}%
     {type="\theenumii"}%
     {type="\theenumiii"}%
     {type="\theenumiv"}}
 \fi

<..roman enumeiii..>
 \Configure{enumiii}
     {\HCode{<span class="roman-numeral">}}
     {\HCode{</span>}}
-_-_-

3.7.2 Prosper

<..prosper lists..>
 \ConfigureEnv{Itemize}
    {\ifvmode \IgnorePar\fi \EndP}{<.try env inline par.>}
    {}{}
 \ConfigureList{Itemize}%
    {\EndP\HCode{<ul \a:LRdir class="itemize\expandafter\the
           \csname @itemdepth\endcsname">}%
        <.save end:itm.>\global\let\end:itm=\empty}
    {<.recall end:itm.>\EndP\HCode{</li></ul>}\ShowPar}
    {\end:itm \global\def\end:itm{\EndP\Tg</li>}\DeleteMark}
    {\HCode{<li class="itemize">}}
-_-_-

<..prosper lists..>+
 \ConfigureEnv{itemstep}
    {\ifvmode \IgnorePar\fi
     \EndP\HCode{<ul \a:LRdir class="itemstep\expandafter\the
           \csname @itemdepth\endcsname">}%
        <.save end:itm.>\global\let\end:itm=\empty}
    {<.recall end:itm.>\ifvmode \IgnorePar\fi\EndP
     \HCode{</li></ul>}\ShowPar}
    {}
    {}
 \ConfigureList{itemstep}
    {}
    {}
    {\end:itm \global\def\end:itm{\EndP\Tg</li>}\DeleteMark}
    {\HCode{<li class="itemize\ifnum
                  \c@item@step>\c@overlaysCount -hide\fi">}}
 \Css{li.itemize-hide {visibility:hidden;}}
-_-_-

3.7.3 Jeep

<..configure html4 jeep..>
 \ConfigureEnv{outline}
    {}{<.try env inline par.>}{}{}
 \ConfigureList{outline}%
    {<.enumerate I jeep.>}
    {<.enumerate II.>}
    {<.enumerate III.>}
    {<.enumerate IV.>}
-_-_-

<..enumerate I jeep..>
 \EndP\HCode{<ol type="1"
       class="enumerate\expandafter\the\csname @enumdepth\endcsname"
       \a:LRdir
      >}<.save end:itm.>\global\let\end:itm=\empty
-_-_-

3.7.4 Description

<..description 4..>
 \ConfigureList{description}%
    {\EndP\HCode{<dl \a:LRdir class="description">}%
       <.save end:itm.>\global\let\end:itm=\empty}
    {<.recall end:itm.>\EndP\HCode{</dd></dl>}\ShowPar}
    {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
         class="description">}\bgroup \bf}
    {\egroup\EndP\HCode{</dt><dd\Hnewline class="description">}}
-_-_-

<..32,4 report,book..>
 \ConfigureEnv{description}{\IgnorePar}{}{}{}
-_-_-

<..configure html4 scrbook..>
 \ConfigureEnv{description}{\IgnorePar}{}{}{}
-_-_-

<..configure html4 scrreprt..>
 \ConfigureEnv{description}{\IgnorePar}{}{}{}
-_-_-

<..ams art,proc,book..>
 <.description 4.>
 \ConfigureEnv{description}{\IgnorePar}{}{}{}
-_-_-

3.7.5 List Utilities

Latex allows groups like the following, so we need global \end:itm

\begin{enumerate}  
{\item Line 1}  
{\item Line 2}  
\end{enumerate}

<..save end:itm..>
 \PushMacro\end:itm
-_-_-

<..recall end:itm..>
 \PopMacro\end:itm \global\let\end:itm \end:itm
-_-_-

3.7.6 mdwlist

<..configure html4 mdwlist..>
 \ConfigureEnv{itemize*}
    {\ifvmode \IgnorePar\fi \EndP}{<.try env inline par.>}
    {}{}
 \ConfigureList{itemize*}%
    {\EndP\HCode{<ul \a:LRdir class="itemize\expandafter\the
           \csname @itemdepth\endcsname">}%
        <.save end:itm.>\global\let\end:itm=\empty}
    {<.recall end:itm.>\EndP\HCode{</li></ul>}\ShowPar}
    {\end:itm \global\def\end:itm{\EndP\Tg</li>}\DeleteMark}
    {\HCode{<li class="itemize">}}
 \ConfigureEnv{enumerate*}
    {}{<.try env inline par.>}{}{}
 \ConfigureList{enumerate*}%
    {<.enumerate I.>}
    {<.enumerate II.>}
    {<.enumerate III.>}
    {<.enumerate IV.>}
 \ConfigureList{description*}%
    {\EndP\HCode{<dl \a:LRdir class="description">}%
       <.save end:itm.>\global\let\end:itm=\empty}
    {<.recall end:itm.>\EndP\HCode{</dd></dl>}\ShowPar}
    {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
         class="description">}\bgroup \bf}
    {\egroup\EndP\HCode{</dt><dd\Hnewline class="description">}}
 \ConfigureList{basedescript}
    {\EndP\HCode{<dl \a:LRdir class="basedescript">}%
       \PushMacro\end:itm \global\let\end:itm=\empty}
    {\PopMacro\end:itm \global\let\end:itm \end:itm
       \EndP\HCode{</dd></dl>}\ShowPar}
    {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
       class="basedescript">}\bgroup \bf}
    {\egroup\EndP\HCode{</dt><dd\Hnewline class="basedescript">}}
-_-_-

3.7.7 nomencl

<..configure html4 nomencl..>
 \ConfigureList{thenomenclature}%
    {\EndP\HCode{<dl \a:LRdir class="thenomenclature">}%
       \PushMacro\end:itm
       \global\let\end:itm=\empty}
    {\PopMacro\end:itm \global\let\end:itm \end:itm
       \EndP\HCode{</dd></dl>}\ShowPar}
    {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
         class="thenomenclature">}\bgroup \bf}
    {\egroup\EndP\HCode{</dt><dd\Hnewline class="thenomenclature">}}
 \Css{dt.thenomenclature{float:left; clear:left;}}
-_-_-

<..configure html4 nomencl..>+
 \:CheckOption{2} \if:Option \else
    \:CheckOption{3} \if:Option \else
       \:CheckOption{4} \if:Option \else
          \:CheckOption{5} \if:Option \else
             \:CheckOption{6} \if:Option \else
                \:CheckOption{7}
             \fi
          \fi
       \fi
    \fi
 \fi
 \if:Option
    \pend:def\thenomenclature{%
       \if@intoc
          <.ignore addcontentsline in thenomenclature.>%
       \fi
       <.sectioning statement within begin-end env.>%
    }
 \fi
-_-_-

<..ignore addcontentsline in thenomenclature..>
 \expandafter\let\csname if:intoc\expandafter\endcsname\csname if@intoc\endcsname
 \expandafter\edef\csname if@intoc\endcsname{%
         \expandafter\noexpand\csname iftrue\endcsname
            \let\expandafter\noexpand \csname if@intoc\endcsname
                \expandafter\noexpand \csname if:intoc\endcsname
         \expandafter\noexpand\csname else\endcsname}%
-_-_-

<..sectioning statement within begin-end env..>
 \def\:temp{thenomenclature}\ifx\:temp\@currenvir
   \RecallEverypar
 \fi
-_-_-