[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX] set up latexmk as default engine + automatically add flags for
From: |
Benjamin Slade |
Subject: |
[AUCTeX] set up latexmk as default engine + automatically add flags for lualatex, xelatex |
Date: |
Mon, 22 Oct 2012 11:57:49 -0500 |
User-agent: |
mu4e 0.9.9.5-dev1; emacs 24.2.50.1 |
For orgmode, I have a setup that calls up latexmk and automatically
provides the proper flags for luatex and xetex based on detection of a
string in the buffer like "#+LATEX_CMD: lualatex".*
I'm wondering how to:
(1) Add Latexmk as a C-c C-c command for AUCTeX, and set it as default.
(2) Institute something similar which searches the buffer for something
like "LATEX_CMD: lualatex" and set the flags for running latexmk
accordingly.
Thanks!
[* - The orgmode elisp looks like this:
(defun my-auto-tex-cmd ()
"When exporting from .org with latex, automatically run latex,
pdflatex, or xelatex as appropriate, using latexmk."
(let ((texcmd)))
;; default command: oldstyle latex via dvi
(setq texcmd "latexmk -dvi -pdfps -quiet %f")
;; pdflatex -> .pdf
(if (string-match "LATEX_CMD: pdflatex" (buffer-string))
(setq texcmd "latexmk -pdf -quiet %f"))
;; xelatex -> .pdf
(if (string-match "LATEX_CMD: xelatex" (buffer-string))
(setq texcmd "latexmk -pdflatex=xelatex -pdf -quiet %f"))
;; lualatex -> .pdf
(if (string-match "LATEX_CMD: lualatex" (buffer-string))
(setq texcmd "latexmk -pdflatex=lualatex -pdf -quiet %f"))
;; LaTeX compilation command
(setq org-latex-to-pdf-process (list texcmd)))
(add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-cmd)
]
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{sent by mu4e on Emacs running under GNU/Linux}
- [AUCTeX] set up latexmk as default engine + automatically add flags for lualatex, xelatex,
Benjamin Slade <=