As explained by Pandoc user's guide, "by default, pandoc produces a document fragment". However, LaTeX fragments contain non-standard commands defined only in Pandoc's LaTeX template, a LaTeX preamble used to produce standalone LaTeX documents instead of just LaTeX fragments. Such custom commands (like \tightlist
) generate errors when the fragment is inserted in any other LaTeX source (like a fragment is supposed to be).
As an example consider the following MWE mardown source:
# Section title
Markdown for lists
* One
* Two
* Three
It is converted in the following LaTeX fragment:
\hypertarget{section-title}{%
\section{Section title}\label{section-title}}
Markdown for lists
\begin{itemize}
\tightlist
\item
One
\item
Two
\item
Three
\end{itemize}
which does not compile if inserted as input in any LaTeX source not containing the definition of \tightlist
.
Is it possible to generate LaTeX fragments containing only standard LaTeX?
Or is it possible to generate LaTeX fragments containing the definitions of Pandoc custom LaTeX commands?
Thanks in advance for your help.
Why this is not a duplicate
This is not a duplicate of tightlist error using Pandoc with Markdown because I'm not looking for a solution to a specific error (I used the tightlist
example and a Markdown source just to explain the issue, which may arise with any other non standard command and any other type of source format) I'm looking for a general way (an option, a switch, an add-on) to obtain Pandoc LaTeX fragments free of undefined non-standard commands (i.e. self-contained).