TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using TeX Live 2012 in a Windows environment.

I used to compile with xelatexmk, which isn't included in TeX Live's "Processing tools". When I wanted to switch from LaTeX to XeLaTeX, I read somewhere that I had to compile with xelatexmk, and it gave instructions for its configuration.

My xelatexmk configuration looks like this:

enter image description here

Then I recently switched to TeX Live's built-in XeLaTeX compiler, because I noticed it was faster and always gave the same result. That configuration looks like this:

enter image description here

But I've noticed a difference when I draw arrows with TikZ. Below is a MWE:

        \tikz[baseline, remember picture] \node[inner sep = 0pt, anchor = base] (finisharrow) {a}; & \tikz[baseline, remember picture] \node[inner sep = 0pt, anchor = base] (startarrow) {c};
    \begin{tikzpicture}[remember picture, overlay, shorten <=.1ex, shorten >=.1ex]
        \draw [semithick, ->] (startarrow) -- (finisharrow);

When I compile with xelatexmk, it gives me this:

enter image description here

When I compile with XeLaTeX, on the other hand, it gives me this:

enter image description here

I need to compile with XeLaTeX a second time to get the proper outcome:

enter image description here

I'm sure there's a perfectly good reason why XeLaTeX behaves this way, but for novice users like me, it resulted in a lot of frustration, since I couldn't figure out why my arrows didn't turn out the way they used to before (when I used xelatexmk).

Could this perhaps be a reason why XeLaTeX in the future versions of TeX Live should do two compiling iterations, or why xelatexmk should be included? Again, I need to stress that this is from the perspective of a novice user, who generally expects (or hopes) that their .tex document compiles easily by using some default built-in compiler.

share|improve this question
When you use remember picture, there's need of a second run of LaTeX (whichever variant), because during the first a note is kept for the location of the picture; it's similar to the \label-\ref system. A new run in necessary whenever the picture is modified or its position in the page changes. – egreg Apr 14 '13 at 13:58
I've understood now, that this is precisely why latexmk was made (to perform as many runs as necessary). Maybe I should close my question as being too localized. – Sverre Apr 14 '13 at 14:06
@Sverre I disagree, why should this be too localized? Just because you understand now doesn’t mean it’s an illegitimate question that somebody might have as well. Voting to reopen. (After taking the liberty to generalize the question slightly.) – doncherry Apr 14 '13 at 16:16
I see what you mean after having reworded the question. I guess my thought was that it now boils down to whether or not TeX Live should include latexmk among its included compiling tools (which I think it should). And my initial question here was, in a way, too localized to address that properly. – Sverre Apr 14 '13 at 17:20
up vote 6 down vote accepted

The xelatex command runs XeLaTeX exactly once: it does one typesetting run and produces a PDF. In contrast, xelatexmk runs XeLaTeX and other tools one or more times, using a script to (try to) determine what runs are required. Once you go beyond a 'trivial' document, introducing cross-references or similar then at least two XeLaTeX runs are required to 'completely' compile a document (here we have a 'label' of sorts in terms of position in the output). On the other hand, scripts don't always get things right, and resolving all links, etc. is normally only essential for the final 'production' PDF. As such, many people are happy not to use a script and to do the necessarily additional runs by hand, which means that intermediate runs are faster. Others are happier with a script doing this 'back end' stuff for them.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.