【问题标题】:How do I insert a block quote within a paragraph using Pandoc? [closed]如何使用 Pandoc 在段落中插入块引用? [关闭]
【发布时间】:2013-09-10 12:59:22
【问题描述】:

我正在使用 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?

【问题讨论】:

  • 这里主要关注的是第二段的缩进吗?
  • 是的,如果您指的是第二个示例。在 pdf 输出中,我的目标是不缩进紧跟在块引用之后的行。 (缩进线表示一个新段落,这不是我想要的。)
  • 这个问题似乎是题外话,因为它是关于 LaTeX 的。

标签: latex markdown pandoc


【解决方案1】:

经过一番搜索,我发现了这个讨论: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.

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-17
    • 2015-02-04
    • 2016-05-15
    相关资源
    最近更新 更多