I'm trying to define a run configuration for using XeLaTeX with BiBTeX from within TeXWorks, but I'm coming up empty.
I tried following this guide and adapt it to what I wanted to do, and ended up with this:
program: xelatex argument: "%1.tex" && bibtex "%1" && xelatex "%1.tex" && xelatex "%1.tex"
but when I run it by hitting Ctrl+T I get the following message:
This is XeTeX, Version 3.1415926-2.3-0.9997.5 (TeX Live 2011)
restricted \write18 enabled.
entering extended mode*
and then nothing happens.
How do I configure TeXWorks to run XeLaTeX+BiBTeX+XeLaTeX+XeLaTeX when I hit "compile"?
For extra credit, the run configuration should not run more times than necessary, i.e. not all four runs if no references have changed.
The simplest way is to create a new xelatexmk
"engine" in the "Typeset" menu; instructions are at
http://code.google.com/p/texworks/wiki/AdvancedTypesettingTools
It's sufficient to change pdflatex
with xelatex
. If you also put at the beginning of the file the "magic line"
% !TEX program = xelatexmk
this new engine will be automatically selected. The script latexmk
will run the necessary programs the right number of times to resolve cross references and build the bibliography.
In the end, the window for defining the tool should look like the following
Name: xelatexmk Program: latexmk Arguments: -pdf -e $pdflatex=q/xelatex $synctexoption %O %S/$fullname