如何在Org-mode中避免代码块后出现新段落?

6

当 Org-mode 导出到 LaTeX 时,在代码块后会产生一个新段落。我该如何避免这种情况?

请考虑以下示例:

#+TITLE: Example

#+BEGIN_SRC emacs-lisp
(setq foo "bar")
#+END_SRC
A paragraph contains some text and this text only serves as example text.
#+BEGIN_SRC emacs-lisp
(setq bar "foo")
#+END_SRC

它可以导出以下LaTeX代码

\begin{verbatim}
(setq foo "bar")
\end{verbatim}



A paragraph contains some text and this text only serves as example text.

\begin{verbatim}
(setq bar "foo")
\end{verbatim}

输出结果为:

我得到的输出

请注意,第一个代码块后面的文本被设置为新段落。我不希望它被设置为新段落。我希望它被设置为:

我想要的输出

这是以下代码的输出结果:

\begin{verbatim}
(setq foo "bar")
\end{verbatim}
A paragraph contains some text and this text only serves as example text.
\begin{verbatim}
(setq bar "foo")
\end{verbatim}

我正在运行 Emacs 23.3.1 中的 Org-mode 7.6。
2个回答

2

Org 7.8.03中似乎并不是问题。测试您的确切代码块将提供以下输出

#+TITLE: Example

#+BEGIN_SRC emacs-lisp
(setq foo "bar")
#+END_SRC
A paragraph contains some text and this text only serves as example text.
#+BEGIN_SRC emacs-lisp
(setq bar "foo")
#+END_SRC

\begin{verbatim}
(setq foo "bar")
\end{verbatim}
A paragraph contains some text and this text only serves as example text.

\begin{verbatim}
(setq bar "foo")
\end{verbatim}

Output result


2

很抱歉,这并不是你想要的解决方案,但无论如何,你可以通过手动设置缩进来实现。

#+BEGIN_SRC emacs-lisp
(setq foo "bar")
#+END_SRC
#+LATEX:\noindent
A paragraph contains some text and this text only serves as example text.
#+BEGIN_SRC emacs-lisp
(setq bar "foo")
#+END_SRC

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接