title: Compile XeLaTeX tex file with latexmk
body: <p>How can one compile a <code>XeLaTeX</code> tex document using <code>latexmk</code> on Mac OS X?</p>
  
  <p>At present I am running <code>latexmk job.tex</code> and getting an error:</p>
  
  <pre><code>! 
   ********************************************
   * XeTeX is required to compile this document.
   * Sorry!
   ********************************************.
  \RequireXeTeX ...********************************}
                                                    \endgroup \fi 
  l.18 \RequireXeTeX
  
  ? ^D
  ! Emergency stop.
  \RequireXeTeX ...********************************}
                                                    \endgroup \fi 
  l.18 \RequireXeTeX
  </code></pre>
  
  <p>The first line of my tex file is (as suggested by <a href="http://email.esm.psu.edu/pipermail/macosx-tex/2007-February/028848.html" rel="noreferrer">this post</a>):</p>
  
  <pre><code>% !TEX TS-program = xelatexmk
  </code></pre>
  
  <p>and I've tried others (e.g. program=xelatex), but to no avail.</p>
  
  <p><code>latexmk</code> describes its commands as follows:</p>
  
  <pre><code>$ latexmk -commands xelatex job
  Commands used by latexmk:
     To run latex, I use "latex %O %S"
     To run pdflatex, I use "pdflatex %O %S"
     ...
  </code></pre>
  
  <p>There doesn't appear bo be any logical mechanism for selecting a tex program from the command line, and it's not clear from the source how one would do this, either.</p>
  
  <p>I've also looked at<a href="http://iml.univ-mrs.fr/~beffara/soft/rubber/" rel="noreferrer"><code>rubber</code></a>, but it doesn't seem to work either.</p>
  
  <p>I appreciate any insight you may be able to provide.</p>
  
  <p>Brian</p>