I used the provided answers on TEX.se a lot while writing my Bachelor Thesis but couldn´t find an answer on the following question:
How do I use the LaTeXTools build-system with the glossaries package to have a list of acronyms somewhere in my document?
My MWE:
\documentclass{article}
\usepackage[acronym,nomain,toc,shortcuts,xindy]{glossaries}
\makeglossaries
\newacronym{Mr}{M$_r$}{Remanence}
\newacronym{Hc}{H$_c$}{Coercivity}
\setacronymstyle{long-short}
\begin{document}
\tableofcontents
\newpage
Here's a \ac{Mr} glossary entry.
\printglossaries
\end{document}
With my MWE on Sublime Text 3 and the latest version of LaTeXTools the following output was produced:
Using the Terminal (OS X and TeXLive 2016) with the following commands (thesis.tex is my file)
xelatex thesis
makeglossaries thesis
xelatex thesis
xelatex thesis
the correct output was produced:
Okay now why don´t I just use the Terminal: I have way more packages that require extra commands etc. – That might be obvious
Why don´t I use a TEX-specific editor: Until now the LaTeXTools Plugin does a great job and sublime text is just one of the most convenient text-editors i´ve seen so far so I would like to keep on going with it.
I already found a question related to this which is not quite answered (I just can´t link to it because i already used the 2 links I have with my little reputation…)
Thanks in Advance for any help!
Best Answer
There are a few different ways this could be approached.
The
traditional
builder that LaTeXTools uses launcheslatexmk
, so you can solve the issue the same way you would forlatexmk
, i.e., add a.latexmkrc
file to the directory containing your main tex document with the following contents:I've based this on both the
latexmk
example file and this answer to a similar question.Alternatively, as suggested in this question (I assume this is the one you were referring to), is to use the
script
builder. To do this, in yourLaTeXTools.sublime-settings
file (or, better, in thesettings
section of your Sublime project file, you need to change thebuilder
setting toscript
and then change thebuilder_settings
block to something like this:Personally, I'd choose the former of these, as the second option will run the whole script every time you build, which could take an unnecessary amount of time if you're working on a really long document.