Tuesday, February 9, 2010

XeLaTeX and Aquamacs Emacs

I have finally begun writing my thesis... or sort of anyway - I have definitely started playing around with a LaTeX skeleton for it :-P

My friend Clemens gave me the LaTeX template that he used for his thesis, and it creates really pretty documents so I definitely wanted to use it for my thesis as well. But, this template makes use of XeLaTeX, a LaTeX variant that supports use of Unicode and "modern font technologies". I found that I already had xelatex installed on my system; apparently it comes with the MacPorts LaTeX installation, but it did not work immediately in Aquamacs. There _was_ a XeLaTeX command in Aquamacs, but in the background it was calling pdflatex, which in turn went into some never ending loop using a full CPU core...

In order to fix that you need to do change the way the xelatex command is called in Aquamacs, as described here.
  1. Open Aquamacs in LaTeX mode (by opening a .tex file).
  2. Go the the LaTeX menu, choose "Customize AUCTeX", choose "TeX Command", choose "TeX Command List".
  3. Navigate to the XeLaTeX command (just search for xelatex).
  4. Alter the "Command" part of that section to "%`xelatex --synctex=1%(mode)%' %t"
  5. Set the "How" part to "TeX-run-command".
  6. Make sure that LaTeX, ConTeXt, and AmSTeX have been checked off in the bottom part of the section.
  7. Save the settings (Ctrl+x, Ctrl+s as usual).
And now it works!

1 comment: