导出到 LaTeX 时用字符串作为前缀结果

Prefix results with string when exporting to LaTeX

我有一个源代码块,我想将其代码和结果导出到 LaTeX:

    #+begin_src clojure :exports both
    (+ 1 2 3)
    #+end_src

我做了 M-x org-latex-export-to-pdf 并得到了 。 我希望结果以 => 为前缀。我怎样才能做到这一点?

您可以通过将代码的导出与结果的导出分开来做到这一点:

#+name: example
#+begin_src octave :exports code
1 + 2 + 3
#+end_src
\Rightarrow call_example[:exports results]().

这使用内联调用功能来调用命名的 src 块。抱歉使用八度;我没有安装 clojure。