Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I use emacs+AUCTeX to write my *-tex. Using the PDF mode, I can run pdflatex automatically with the C-c C-c command. However, I don't see a way to run xelatex automatically, or even set up a command option in the drop down window. My LISP skills are very rusty, and I was wondering if someone had a tex.el patch to enable xelatex support ?

share|improve this question

3 Answers

If you have AUCTeX version 11.86, you can set the local variable TeX-engine to xetex. This is what I use:

%%% Local Variables: 
%%% coding: utf-8
%%% mode: latex
%%% TeX-engine: xetex
%%% End: 

You can check the version you have with

C-h v AUCTeX-version <RET>
share|improve this answer
is there a relatively easy way to check the version of auctex I have ? – Suresh Jun 20 '11 at 20:46
Where do we have to put those directives? inside tex files or... – Harish Kumar May 13 at 17:48
@HarishKumar At the very end of the TeX file. – egreg May 13 at 17:49

You can add this to your emacs.el:

(setq TeX-engine 'xetex)

And add this if you want a PDF output by default:

(setq TeX-PDF-mode t)
share|improve this answer
1  
Personally, I'd enable PDF output globally (with your syntax) but I'd set the TeX engine locally. – Blaisorblade Mar 16 at 18:22

You could customize the Tex Command List:

   M-x customize-variable TeX-command-list

There you can add a new commands to AUCTeX. Alternatively, you can directly modify your emacs init file:

;;set XeTeX mode in TeX/LaTeX
(add-hook 'LaTeX-mode-hook (lambda()
(add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil t))
(setq TeX-command-default "XeLaTeX")
(setq TeX-save-query nil)
(setq TeX-show-compilation t)))
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.