aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-09-15 17:47:57 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-09-15 17:59:03 -0700
commita26ec96d89ccf532f7bca7591c96ba30d8544e4a (patch)
treefd625998ed257e00c7ca6205cf07e38fe26323e1 /test
parenta2d343420f61591ab1ff82ff4e9db8e87542b6ee (diff)
downloadpandoc-a26ec96d89ccf532f7bca7591c96ba30d8544e4a.tar.gz
LaTeX writer: fix spacing issue with list in definition list.
When a list occurs at the beginning of a definition list definition, it can start on the same line as the label, which looks bad. Fix that by starting such lists with an `\item[]`.
Diffstat (limited to 'test')
-rw-r--r--test/command/lists-inside-definition.md67
1 files changed, 67 insertions, 0 deletions
diff --git a/test/command/lists-inside-definition.md b/test/command/lists-inside-definition.md
new file mode 100644
index 000000000..f0cac0d69
--- /dev/null
+++ b/test/command/lists-inside-definition.md
@@ -0,0 +1,67 @@
+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}
+\item[Definition]
+\begin{enumerate}
+\def\labelenumi{\arabic{enumi}.}
+\tightlist
+\item[]
+\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}
+\item[Definition]
+\begin{itemize}
+\tightlist
+\item[]
+\item
+ list
+\item
+ list
+\end{itemize}
+\end{description}
+```
+