Sebastian
Sebastian

Reputation: 396

Emacs org-mode latex - simply switch between pdflatex, xelatex and lualatex

Using latexmk I've tested the following setup

(setq org-latex-pdf-process '("latexmk %f -output-directory=%o -%latex"))

using the example below

#+TITLE: My Paper
#+AUTHOR: Jane Doe
#+DATE:
#+OPTIONS: toc:nil num:nil
#+LATEX_COMPILER: xelatex
#+LATEX_HEADER: \usepackage{fontspec}
#+LATEX_HEADER: \setsansfont{Acme}

* Title
- Text

and it works for xelatex und lualatex, but not for pdflatex because latexmk fails with the option -pdflatex, which would require a string.

Is there any easy way to fix this issue? E.g. set org-latex-pdf-process based on a the selection of the LATEX_COMPILER using a hook?

Upvotes: 1

Views: 2183

Answers (1)

Sebastian
Sebastian

Reputation: 396

I found the following solution, which works for me

(setq org-latex-pdf-process (list "latexmk -pdflatex='%latex -shell-escape -interaction nonstopmode' -pdf -output-directory=%o %f"))

Upvotes: 1

Related Questions