我尝试使用 pandoc 转换 Latex 文档为 html,但出现以下错误:
unexpected
\lstinputlisting[
是否可以将 \lstinputlisting 与 Pandoc 一起使用?
我的代码main.tex如下:
\usepackage{listings}
\lstinputlisting[
float,
language=Java,
caption={My very first program in Java},
label={lst:helloworld},
]{listings/HelloWorld.java}
in \Cref{lst:helloworld}, we describe an hello world program in Java.
我解决了将
--listings
添加到 Pandoc 转换并删除参数中的新行的问题。看起来 Latex 可以解释它们,但不能解释 Pandoc。
\usepackage{listings}
\lstinputlisting[float,language=Java,caption={My very first program in Java},label={lst:helloworld},]{listings/HelloWorld.java}
in \Cref{lst:helloworld}, we describe an hello world program in Java.