List of Abbreviations - Latex

5 comments
This is a short post about generating a list of abbreviations for your document with Latex. While there are many packages available for this, I'm going to use glossaries package. You can find the user mannual of glossaries package from here.

Here is the basic example.

\documentclass[a4paper,12pt]{report} %We are creating a report

\usepackage[automake]{glossaries} %Load glossaries package
\makeglossaries

%Here we define a set of example acronyms
\newglossaryentry{Aaa}{name={AAA},description={First abbreviation}}
\newglossaryentry{Bbb}{name={BBB},description={Second abbreviation}}
\newglossaryentry{Ccc}{name={CCC},description={Third abbreviation}}

\begin{document}

\printglossary[title={List of Abbreviations}] %Generate List of Abbreviations

\chapter{Sample Chapter}

Here we are using the first abbreviation \gls{Aaa}. This is our second abbreviation \gls{Bbb}. The last one is \gls{Ccc}

\end{document}

The above code snippt provides following output.

List of Abbreviations

Sample Chapter

Note that "automake" parameter is not necessary to generate List of Abbreviations if you are using MikTex to compile Latex.

You can pass different parameters to glossaries package load command to achieve various customizations.  A list of few as follows. You can find more details from the user manual.

  1. Remove the dot at the end of each abbreviation - nopostdot
  2. Remove page number at the end of each abbreviation - nonumberlist
  3. Prevent abbreviation grouping - nogroupskip
  4. Add "List of Abbreviations" to Table of Content - toc
Further, if you want to change line spacing between elements in the abbreviation list you can use \singlespacing, \onehalfspacing or \doublespacing according to your requirement.

Here is the complete example.



\documentclass[a4paper,12pt]{report} %We are creating a report

\usepackage[nopostdot,nogroupskip,style=super,nonumberlist,toc,automake,toc]{glossaries} %Load glossaries package

\makeglossaries

%Here we define a set of example acronyms
\newglossaryentry{Aaa}{name={AAA},description={First abbreviation}}
\newglossaryentry{Bbb}{name={BBB},description={Second abbreviation}}
\newglossaryentry{Ccc}{name={CCC},description={Third abbreviation}}

\begin{document}

\tableofcontents

\onehalfspacing
\printglossary[title={List of Abbreviations}] %Generate List of Abbreviations


\chapter{Sample Chapter}

Here we are using the first abbreviation \gls{Aaa}. This is our second abbreviation \gls{Bbb}. The last one is \gls{Ccc}

\end{document}

Here is the final output.

Table of Contents
List of Abbreviations

Sample Chapter
Hope this quick guide will help you.

Happy writing!

5 comments :

  1. This was clear and helpful.
    Thank you very much

    ReplyDelete
  2. This space command (eg, \doublespacing) doesn't work in my tex document?
    I have put it exactly at the place shown above (i.e. upside of \printglossary command) but I got the error saying 'undefined control sequence'. What should I do, now?
    Any help would be appreciated...

    ReplyDelete
    Replies
    1. What is the document class you are using? Is it 'minimal'?
      Check if this discussion helps you.
      https://tex.stackexchange.com/questions/15442/why-does-doublespacing-using-setspace-have-errors-when-used-in-a-minimal-documen/25351

      Delete
    2. Also try including 'setspace' package.

      Delete
  3. Bardzo ciekawy artykuł. Pozdrawiam serdecznie !

    ReplyDelete