Add XeLaTeX to the command list

Say

M-x customize-group

and

tex-command

Then find the "Tex Command List" option. From there you can introduce new AUCTeX commands.

However, AUCTeX is meant to be used a little differently. Instead of creating a separate XeLaTeX command, you can do

  • M-x TeX-engine-set followed by xetex or
  • (TeX-engine-set 'xetex) in lisp code or
  • Command | TeXing Options | Use XeTeX engine in the menu bar

(the three methods are equivalent).

After that the LaTeX command will run xelatex instead of latex.


A more local way to specify the TeX-engine is to append the following text to the very end of your .tex file. This will set TeX-engine to xetex for the current file only.

%%% Local Variables:
%%% TeX-engine: xetex
%%% End:

Edit in reply to comment

The same answer was given here: https://tex.stackexchange.com/a/450955/90321, but that answer also shows how to call Tex-engine with command line arguments, by adding another line to the local variables:

%%% TeX-command-extra-options: "-shell-escape"