It’s common to compile our documents a couple of times to ensure, amongst other things, correct cross-referencing and indices. Sometimes, we also rely on a
, a powerful tool to help us on our building adventures.
Our first example
According to the
“is a wrapper for LaTeX and companion programs. Its purpose is, given a LaTeX source to process, to compile it enough times to resolve all references, possibly running satellite programs such as BibTeX, makeindex, Metapost, etc. to produce appropriate data files.”
All the major Linux distros have
in their repositories. A simple
does the job for me. Let’s see an example, with
We should now run
again. Hm let’s run it again three more times just to be sure (I know I do). Or we could go with
. Done. Of course, don’t mention Macbeth.
There we go!
as many times as need. The
to run the PDF tools instead the DVI ones. Do you think the current folder is messy, full of temporary files? Go with
and voilà, now you’ll have only the resulting PDF file and your
If you want to get rid of all generated files, except of course the sources, just add the
is smart enough to check if the files are updated:
High hopes part II
Time for more advanced stuff with
I had the opportunity of answering a nice question on TeX.sx about
. It makes use of directives, the hidden gems.
A directive is a comment in the form of
which adds information for
. It’s very simple. Let’s say I want to use a custom
style for my index. A quick look into the
manual gives me the following entry:
: specifies the index style to be used. It’s important to note that each of these directives may be used with an optional first argument of the form(foo,bar,quux)
in order to specify that the directive only applies to the indexes namedfoo
. By default, directives are applied to all indices.
Now, I just need to add a line to
Well, it didn’t work.
Why? I was wondering what happened. Then the manual tells me why:
- When using the package
, the directives must of course be prefixed bymakeidx.
, and the optional first argument is not accepted.
Since I’m using
, a quick fix
does the trick.
There are several directives for you to play with. Have fun!
Mac users, don’t worry!
Of course, there’s an app for that… I mean,
can be used with Mac too! Go to the official
repository and download the current compressed file, e.g,
. Extract it to a folder and use
Update: XeLaTeX, where are you?
offers no XeLaTeX support out of the box. But there a way to fix this.
Wouter Bolsterlee provided an elegant solution. Go here, download the attached
file and copy it to
directory. In my Fedora system, the full path is
. Now, just run
and XeLaTeX is recognized! I’m pretty sure a similar
file might be used for LuaLaTeX.
has a lot more features than the ones I described in these examples. Take a look on the manual by running
for a complete reference. This tool is certainly a great addition to our TeX utility belt.