I edit tex file in Emacs
, and compile it by C-c C-c
, then LaTeX
command. Another way to compile it is to use latex file.tex
in a terminal.
Now, I would like to compile a file with xelatex
, xelatex file.tex
works already in a terminal line. So I want to make C-c C-c
in Emacs
be able to launch either LaTeX
or XeLaTeX
. Ideally, XeLaTeX
should be added to the list of possible commands.
Here is the current .emacs, could anyone help?
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 orCommand | 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.
Thanks for your answer, that works... But how could I set
Use XeTeX engine
as default? I guess I still need to modify.emacs
.The default can be changed by
M-x customize-variable
and thenTeX-engine
. You can also call(setq TeX-engine 'xetex)
in some hook, but be aware that theTeX-engine
variable automatically becomes buffer-local in that case.Many thanks for your answer - saved me a whole bunch of trouble... - for me I could just go to <<Command>> then <<Texing Options>>
Is there a way to do the menu bar Command > TeXing Options > Use XeTeX engine without the menu bar, which I have hidden by default? Thanks!
M-x TeX-engine-set
followed byxetex
(or(TeX-engine-set 'xetex)
in lisp code). You can also open the menuF10
(the default binding formenu-bar-open
) and go from there.