You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code for "LaTeX writer: fix spacing issue with list in definition list." (a26ec96) gets confused / does the wrong thing if the first item in the BulletList is a Div. There might be other cases where it has a similar issue.
Here's a test case (test.md):
**Here is a dictionary item**
: <div>
Here is some text.
Here is a bullet list:
- Item 1.
- Item 2.
Here is another bullet list:
- Item 3.
- Item 4.
</div>
When rendering the bullet lists inside the Div inserts an extra \item[] at the start of the bullet list, causing extra blank lines to be output.
Tested as:
pandoc -o test.tex test.md
Output (text.tex):
\begin{description}
\item[\textbf{Here is a dictionary item}]
Here is some text.
Here is a bullet list:
\begin{itemize}
\tightlist
\item[]
\item
Item 1.
\item
Item 2.
\end{itemize}
Here is another bullet list:
\begin{itemize}
\tightlist
\item[]
\item
Item 3.
\item
Item 4.
\end{itemize}
\end{description}
I believe this is caused by the code treating the whole Div as isFirstInDefinition meaning every bullet list inside the Div gets treated in that way. Possibly isFirstInDefinition should be cleared as soon as anything is output inside the definition, although perhaps other nested items (particularly another definition inside the definition?) could cause that approach to fail?
Expected output (output if the Div is removed):
\begin{description}
\item[\textbf{Here is a dictionary item}]
Here is some text.
Here is a bullet list:
\begin{itemize}
\tightlist
\item
Item 1.
\item
Item 2.
\end{itemize}
Here is another bullet list:
\begin{itemize}
\tightlist
\item
Item 3.
\item
Item 4.
\end{itemize}
\end{description}
Wrapping the content in the Div is a peculiar behavior of our content generator. I can probably work around this by inserting some dummy item before the Div.
The text was updated successfully, but these errors were encountered:
I don't know LaTeX well enough to suggest an alternative, sorry. I've not actually run into the original problem, only the fix.
Locally, I have set the following for description lists, which forces a break after each description anyway,
\setlist[description]{style=nextline}
However, I can't see making that a default would be acceptable (it would break a lot of documents here that don't use that setting, and create it in other ways, like inserting \hfill manually).
I've used \hfill instead. But I think we may want to rethink this a bit.
Perhaps we should always use \hfill except when the body of the definition list is of the shape [Para _] or [Plain x].
The code for "LaTeX writer: fix spacing issue with list in definition list." (a26ec96) gets confused / does the wrong thing if the first item in the BulletList is a Div. There might be other cases where it has a similar issue.
Here's a test case (
test.md
):When rendering the bullet lists inside the Div inserts an extra
\item[]
at the start of the bullet list, causing extra blank lines to be output.Tested as:
Output (
text.tex
):I believe this is caused by the code treating the whole Div as
isFirstInDefinition
meaning every bullet list inside the Div gets treated in that way. PossiblyisFirstInDefinition
should be cleared as soon as anything is output inside the definition, although perhaps other nested items (particularly another definition inside the definition?) could cause that approach to fail?Expected output (output if the Div is removed):
Wrapping the content in the Div is a peculiar behavior of our content generator. I can probably work around this by inserting some dummy item before the Div.
The text was updated successfully, but these errors were encountered: