Skip to content

Commit

Permalink
Enhance the itemize/enumerate tests (#2212)
Browse files Browse the repository at this point in the history
  • Loading branch information
brucemiller authored Sep 12, 2023
1 parent f7a9dce commit 3c24413
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 11 deletions.
Binary file modified t/structure/enum.pdf
Binary file not shown.
11 changes: 6 additions & 5 deletions t/structure/enum.tex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ \section{Enumerations}
\item Line two
\end{enumerate}

\begin{enumerate}[label=\fbox{\arabic*}]
\begin{enumerate} [label=\fbox{\arabic*}]
\item Line one
\item Line two
\end{enumerate}
Expand Down Expand Up @@ -138,7 +138,7 @@ \section{New Lists}
\newlist{ingredients}{itemize}{1}
\setlist[ingredients]{label=\textbullet}
\newlist{steps}{enumerate}{2}
\setlist[steps,1,2]{label=(\arabic*)}
\setlist[steps,1,2]{label=(\arabic*), ref=[\arabic*]}

\newlist{isteps}{enumerate*}{2}
\setlist[isteps,1,2]{label=(\arabic*)}
Expand All @@ -151,10 +151,11 @@ \section{New Lists}
\end{ingredients}

\begin{steps}
\item first
\item second
\item third
\item first\label{first}
\item second\label{second}
\item third\label{third}
\end{steps}
with steps \ref{first},\ref{second} and \ref{third}.

Inline:
\begin{isteps}
Expand Down
13 changes: 7 additions & 6 deletions t/structure/enum.xml
Original file line number Diff line number Diff line change
Expand Up @@ -640,34 +640,35 @@ And more.</p>
</para>
<para xml:id="S7.p2">
<enumerate xml:id="S7.I2">
<item xml:id="S7.I2.i1">
<item labels="LABEL:first" xml:id="S7.I2.i1">
<tags>
<tag>(1)</tag>
<tag role="refnum">(1)</tag>
<tag role="refnum">[1]</tag>
</tags>
<para xml:id="S7.I2.i1.p1">
<p>first</p>
</para>
</item>
<item xml:id="S7.I2.i2">
<item labels="LABEL:second" xml:id="S7.I2.i2">
<tags>
<tag>(2)</tag>
<tag role="refnum">(2)</tag>
<tag role="refnum">[2]</tag>
</tags>
<para xml:id="S7.I2.i2.p1">
<p>second</p>
</para>
</item>
<item xml:id="S7.I2.i3">
<item labels="LABEL:third" xml:id="S7.I2.i3">
<tags>
<tag>(3)</tag>
<tag role="refnum">(3)</tag>
<tag role="refnum">[3]</tag>
</tags>
<para xml:id="S7.I2.i3.p1">
<p>third</p>
</para>
</item>
</enumerate>
<p>with steps <ref labelref="LABEL:first"/>,<ref labelref="LABEL:second"/> and <ref labelref="LABEL:third"/>.</p>
</para>
<para xml:id="S7.p3">
<p>Inline:
Expand Down
Binary file modified t/structure/itemize.pdf
Binary file not shown.
25 changes: 25 additions & 0 deletions t/structure/itemize.tex
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,29 @@ \section{Generalized Lists}
\item And the third.
\end{list}

\newcounter{question}
\newcounter{subquestion}
\begin{list}{\textbf{\thequestion.}}{\usecounter{question}}
\item One.
\item Two.
\end{list}

\begin{list}{\textbf{\thequestion.}}{\usecounter{question}}
\item One.
\item Two.
\begin{enumerate}
\item a.
\item b.
\end{enumerate}
\end{list}

\begin{list}{\textbf{\thequestion.}}{\usecounter{question}}
\item One.
\item Two.
\begin{list}{\emph{\thesubquestion.}}{\usecounter{subquestion}}
\item a.
\item b.
\end{list}
\end{list}

\end{document}
108 changes: 108 additions & 0 deletions t/structure/itemize.xml
Original file line number Diff line number Diff line change
Expand Up @@ -556,5 +556,113 @@
</item>
</itemize>
</para>
<para xml:id="S7.p3">
<itemize>
<item xml:id="S7.I3.i1">
<tags>
<tag><text font="bold">1.</text></tag>
<tag role="refnum">1</tag>
</tags>
<para xml:id="S7.I3.i1.p1">
<p>One.</p>
</para>
</item>
<item xml:id="S7.I3.i2">
<tags>
<tag><text font="bold">2.</text></tag>
<tag role="refnum">2</tag>
</tags>
<para xml:id="S7.I3.i2.p1">
<p>Two.</p>
</para>
</item>
</itemize>
</para>
<para xml:id="S7.p4">
<itemize>
<item xml:id="S7.I4.i1">
<tags>
<tag><text font="bold">1.</text></tag>
<tag role="refnum">1</tag>
</tags>
<para xml:id="S7.I4.i1.p1">
<p>One.</p>
</para>
</item>
<item xml:id="S7.I4.i2">
<tags>
<tag><text font="bold">2.</text></tag>
<tag role="refnum">2</tag>
</tags>
<para xml:id="S7.I4.i2.p1">
<p>Two.</p>
<enumerate xml:id="S7.I4.i2.I1">
<item xml:id="S7.I4.i2.I0.i1">
<tags>
<tag>1.</tag>
<tag role="refnum">1</tag>
<tag role="typerefnum">item 1</tag>
</tags>
<para xml:id="S7.I4.i2.I0.i1.p1">
<p>a.</p>
</para>
</item>
<item xml:id="S7.I4.i2.I0.i2">
<tags>
<tag>2.</tag>
<tag role="refnum">2</tag>
<tag role="typerefnum">item 2</tag>
</tags>
<para xml:id="S7.I4.i2.I0.i2.p1">
<p>b.</p>
</para>
</item>
</enumerate>
</para>
</item>
</itemize>
</para>
<para xml:id="S7.p5">
<itemize>
<item xml:id="S7.I5.i1">
<tags>
<tag><text font="bold">1.</text></tag>
<tag role="refnum">1</tag>
</tags>
<para xml:id="S7.I5.i1.p1">
<p>One.</p>
</para>
</item>
<item xml:id="S7.I5.i2">
<tags>
<tag><text font="bold">2.</text></tag>
<tag role="refnum">2</tag>
</tags>
<para xml:id="S7.I5.i2.p1">
<p>Two.</p>
<itemize>
<item xml:id="S7.I5.i2.I1.i1">
<tags>
<tag><emph font="italic">1.</emph></tag>
<tag role="refnum">1</tag>
</tags>
<para xml:id="S7.I5.i2.I1.i1.p1">
<p>a.</p>
</para>
</item>
<item xml:id="S7.I5.i2.I1.i2">
<tags>
<tag><emph font="italic">2.</emph></tag>
<tag role="refnum">2</tag>
</tags>
<para xml:id="S7.I5.i2.I1.i2.p1">
<p>b.</p>
</para>
</item>
</itemize>
</para>
</item>
</itemize>
</para>
</section>
</document>

0 comments on commit 3c24413

Please sign in to comment.