ox-latex: Change default compiler to latexmk

* lisp/ox-latex.el (org-latex-pdf-process): Check for the presence of
latexmk when setting the default, and use it when available.  Fall back
to the current default.  This is important for the incoming citation
support, as PDF generation will now need to involve bibliography
generation.  By using latexmk this is taken care of for us.  The -%latex
part of the command is slightly hacky, but allows latexmk to behave more
intelligently for non-pdflatex options.  Note that latexmk also seems to
care about the order of the arguments.
This commit is contained in:
TEC 2021-07-10 00:31:40 +08:00
parent 971c1359a5
commit 32739e35e3
Signed by: tec
GPG key ID: 779591AFDB81F06C

View file

@ -1180,9 +1180,11 @@ A better approach is to use a compiler suit such as `latexmk'."
:package-version '(Org . "9.0"))
(defcustom org-latex-pdf-process
'("%latex -interaction nonstopmode -output-directory %o %f"
"%latex -interaction nonstopmode -output-directory %o %f"
"%latex -interaction nonstopmode -output-directory %o %f")
(if (executable-find "latexmk")
'("latexmk -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f")
'("%latex -interaction nonstopmode -output-directory %o %f"
"%latex -interaction nonstopmode -output-directory %o %f"
"%latex -interaction nonstopmode -output-directory %o %f"))
"Commands to process a LaTeX file to a PDF file.
This is a list of strings, each of them will be given to the
@ -1226,7 +1228,7 @@ file name as its single argument."
(const :tag "texi2dvi"
("cd %o; LATEX=\"%latex\" texi2dvi -p -b -V %b.tex"))
(const :tag "latexmk"
("latexmk -g -pdf -pdflatex=\"%latex\" -outdir=%o %f"))
("latexmk -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f"))
(function)))
(defcustom org-latex-logfiles-extensions