如何使用Pandoc在段落中插入块引用?

时间:2013-09-10 12:59:23

标签: latex markdown pandoc

我正在使用pandoc将markdown转换为LaTeX。我的问题是,Pandoc似乎将块引用后的段落文本解释为新段落的开头。虽然这通常是我想要的,但有很多次我想继续引用之前的段落。这在LaTeX中很容易实现 - 我只是将引用环境插入到段落中,而不会在引号和周围行之间留下任何空白行,如下所示:

This is the first sentence of paragraph ONE.
\begin{quote}
This is a block quote.
\end{quote}
This is the second sentence of paragraph ONE.

This is the first sentence of paragraph TWO.

但是,由于Pandoc要求块引号后面跟一个空行,我可以管理的唯一输出如下:

This is the first sentence of paragraph ONE.

\begin{quote}
This is a block quote.
\end{quote}

This is the first sentence of paragraph TWO.

This is the first sentence of paragraph THREE.

如何像第一个例子那样输出pandoc来输出LaTeX?

1 个答案:

答案 0 :(得分:8)

经过一番搜索,我发现了这个讨论:https://groups.google.com/forum/#!topic/multimarkdown/iIaBLYI92K0

Pandoc的降价似乎不太可能区分块引号后的续段和新段落。最好的解决方案似乎使用\ noindent,如此:

This is the first sentence of paragraph ONE.

> This is a block quote.

\noindent This is the second sentence of paragraph ONE.

This is the first sentence of paragraph TWO.

不幸的是,这个解决方案没有将非缩进的'paragraph'标记为语义上与第一个相关联,所以我想LaTeX中的任何段落计数器仍然会在这里看到三个段落,而不是两个。