Marco Benini

AucTeX and XeLaTeX

When working with XeLaTex (the xelatex command) you need to compile the LaTeX source from a terminal (Unix/Linux/MacOS) or from the command prompt (Windows).

As I frequently use XeLaTeX and I edit LaTeX source with Emacs and AucTeX, I added a small customisation line in the .emacs file so that I can run the command inside Emacs, invoking Ctrl-C Ctrl-C and selecting XeLaTeX as the compiler. Here is the small command line to add to your .emacs file

(eval-after-load "tex"
  '(add-to-list 'TeX-command-list
     		'("XeLaTeX" "xelatex -interaction=nonstopmode %s"
		  TeX-run-command t t :help "Run xelatex") t))

Why do you want to use xelatex instead of latex or pdflatex?

Well, first because xelatex produces .pdf files as pdflatex but it allows for more registers: the stuff you don’t want to see, but which occasionally disturb you, especially when compiling complex documents like slides with Beamer plus a lot of fancy mathematical packages, e.g., XY-pic.

Second, xelatex together with fontspec allows to access and to use the native fonts of your system: in short, when publishers ask you to use the horrible Times New Roman instead of the “real” Times, well, you can just do it with a couple of declarations in the preamble!

Essentially, all TrueType fonts are supported, so you don’t have to perform strange TeX magic to use them in your documents (BTW, I’ve always had problems in doing those magic, at least on Windows machines).


One comment on “AucTeX and XeLaTeX

  1. Rafael
    November 1, 2011

    An option is to use local variables in Emacs, as in:

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


This entry was posted on October 21, 2011 by in Emacs, LaTeX & TeX, Papers.
%d bloggers like this: