如何使组织模式使用 bibulous.py 而不是 biber?

How to make org-mode use bibulous.py instead of biber?

我想将我的 Org 文档导出为 PDF 并设置 bibulous.py 格式的参考书目。为此,我使用命令 C-c C-e l p 又名 org-latex-pdf-process。以下是我根据需要调整命令的方式

    (setq org-latex-pdf-process
          (list "lualatex -shell-escape -interaction nonstopmode %f"
            (concat "python C:/pythonpath/bibulous.py " "my_document_name" ".aux")
            "lualatex -shell-escape -interaction nonstopmode %f"
            "lualatex -shell-escape -interaction nonstopmode %f"))

到目前为止这有效,但仅适用于名称为 my_document_name 的测试文档。为了保持一般性,这里应该有一个使用当前缓冲区名称的函数。我试过了

    python C:/pythonpath/bibulous.py %f.aux

但它不起作用。我怀疑变量 %f 包含扩展名 .tex(有没有办法查看到底调用了什么?*Messages* 缓冲区没有显示这个)。

我也试过以下

    (concat "python C:/pythonpath/bibulous.py " (file-name-sans-extension buffer-file-name) ".aux")

然而,这个变量似乎是在启动 Emacs 时设置的,并且在运行时不会访问实际的缓冲区名称。

您应该通过 C-h v org-latex-pdf-process

查看 org-latex-pdf-process 的文档
Commands to process a LaTeX file to a PDF file.

This is a list of strings, each of them will be given to the
shell as a command.  %f in the command will be replaced by the
relative file name, %F by the absolute file name, %b by the file
base name (i.e. without directory and extension parts), %o by the
base directory of the file, %O by the absolute file name of the
output file, %latex is the LaTeX compiler (see
org-latex-compiler), and %bib is the BibTeX-like compiler (see
org-latex-bib-compiler).

...

所以你只需要

(setq org-latex-pdf-process
      '("lualatex -shell-escape -interaction nonstopmode %f"
        "python C:/pythonpath/bibulous.py %b.aux"
        "lualatex -shell-escape -interaction nonstopmode %f"
        "lualatex -shell-escape -interaction nonstopmode %f"))