LaTeX

Glossaries, Acronyms and TexShop

The package “Glossaries” (the package is found here) is a nice one. You can easily make multiple glossaries and you can also use it to manage your acronyms and abbreviations. Some really nice features, like that the acronym is written on the first appearing out and given in brackets the abbreviation and subsequently appears only abbreviated, have convinced me to use this package. It is also already installed by default in the “MacTex-Distribution”:http://tug.org/mactex/

Well the only problem ist, that you need some patience to try out the different configurations when you use it the first time. So I have looked around and found some help on the blog of MedienPeter. By the way: If you are looking for templates or tutorials for a thesis or something like this, I recently stumbled upon an entry on the blog of Philippe Niquille.

But now back to the configuration options and the packages you need to use “Glossaries” in your LaTeX-Document.

In your preamble you need the following lines:

%Settings for the design of Acronyms and Glossaries
\usepackage[acronym, nonumberlist]{glossaries}

%Load Glossarys and Acronyms
%\loadglsentries[main]{glossary}
%\loadglsentries[myacronyms]{acronym} 
\makeglossaries

%Glossary-File
\include{glossary}
%Acronyms
\include{acronym}

\begin{document}

As you can see are there some commented lines after “Load Glossaries and Acronyms”. You can as well use this option if you want. But I have decided to include a simple TeX-File (after “Glossary-File”). This is much easier to handle. The only important thing is, that you include your Glossary and Acronym definitions in the preamble and not within the document!

Next step is the tutorial of MedienPeter. Well this is for TeXShop only, because this is my only IDE for TeX. The point is, that you need some non default values for the MakeIndex Script. And you can do this with your own little script. Type the following in a text editor:

#!/bin/sh

bfname=$(dirname "$1")/"`basename "$1" .tex`"

makeindex -s "$bfname".ist -t "$bfname".alg -o "$bfname".acr "$bfname".acn

makeindex -s "$bfname".ist -t "$bfname".glg -o "$bfname".gls "$bfname".glo

As you may have seen is my script different from that presented by MedienPeter. Because he did not take care of the Acronyms with his script, respectively it did not work for me. This one produces in one run Acronyms and Glossaries.

You need to save the textfile above with the ending “.engine” under /Users//Library/TexShop/Engines and make it executable in Terminal with the following line (after you have navigated in Terminal to the Engines-Folder):

chmod a+x <Filename>.engine

Now you can select it as a Typeset-Engine when you make your runs in LaTeX. So make your runs, and once the “Glossary-Run”, afterwards again one run to update the PDF. That’s all.

The clue with the engine is, that you can even take more runs into your personalised engine. So if you are maybe using MakeIndex anyway and you need a run for MakeIndex, you can include it in your own engine and you save yourself a few clicks.