动机: 我想生成下面的 latex 块的预览:
#+name: latex_figure
#+header: :file "pseudo.pdf"
#+header: :results "raw"
#+BEGIN_SRC latex
\begin{algorithm}[H]
\SetAlgoLined
\KwResult{Write here the result }
initialization\;
\While{While condition}{
instructions\;
\eIf{condition}{
instructions1\;
instructions2\;
}{
instructions3\;
}
}
\caption{How to write algorithms}
\end{algorithm}
#+END_SRC
执行 C-c C-c, 报错:
Processing LaTeX file /var/folders/hh/lnftkrwn1tv9b63ptnphj_gm0000gp/T/babel-gPyv5m/latex-9Wlavy.tex...
org-compile-file: File "/private/var/folders/hh/lnftkrwn1tv9b63ptnphj_gm0000gp/T/babel-gPyv5m/latex-9Wlavy.pdf" wasn’t produced. See "*Org PDF LaTeX Output*" for details
我发现可以这样复现这个错误:
(org-latex-compile "/var/folders/hh/lnftkrwn1tv9b63ptnphj_gm0000gp/T/babel-gPyv5m/latex-9Wlavy.tex")
但是一看 Org PDF LaTeX Output buffer, 这个 pdf 文件已经生成了.
(see the transcript file for additional information)
Output written on latex-9Wlavy.pdf (1 page).
Transcript written on latex-9Wlavy.log.
因此问题在于, 明明 pdf 都生成了, 为啥它还报错说没有生成? 不过我发现它生成是生成在当前目录而不是临时目录的, 所以我猜测这难道是 ob-latex
的 bug?