Files
pandoc/test/command/lists-inside-definition.md
T
John MacFarlane b4df43b01f LaTeX writer: better fix for lists in definition lists.
In commit a26ec96d89 we added an
empty `\item[]` to the beginning of a list that occurs first
in a definition list, to avoid having one item on the line with
the label.

This gave bad results in some cases (#10241) and there is a more
idiomatic solution anyway: using `\hfill`.

Closes #10241.
2024-09-30 14:38:36 -07:00

70 lines
967 B
Markdown

This inserts an empty `\item[]` when a list occurs at the
beginning of a definition list definition; otherwise the list
may start on the line with the label, which looks terrible.
See https://tex.stackexchange.com/questions/192480/force-itemize-inside-description-onto-a-new-line
```
% pandoc -t latex
Definition
: 1. list
2. list
^D
\begin{description}
\tightlist
\item[Definition]
\hfill
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
list
\item
list
\end{enumerate}
\end{description}
```
```
% pandoc -t latex
Definition
: Foo
1. list
2. list
^D
\begin{description}
\item[Definition]
Foo
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
list
\item
list
\end{enumerate}
\end{description}
```
```
% pandoc -t latex
Definition
: - list
- list
^D
\begin{description}
\tightlist
\item[Definition]
\hfill
\begin{itemize}
\tightlist
\item
list
\item
list
\end{itemize}
\end{description}
```