List of Abbreviations - Latex
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 |
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.
- Remove the dot at the end of each abbreviation - nopostdot
- Remove page number at the end of each abbreviation - nonumberlist
- Prevent abbreviation grouping - nogroupskip
- Add "List of Abbreviations" to Table of Content - toc
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 |
Happy writing!
Subscribe to:
Post Comments
(
Atom
)
This was clear and helpful.
ReplyDeleteThank you very much
This space command (eg, \doublespacing) doesn't work in my tex document?
ReplyDeleteI 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...
What is the document class you are using? Is it 'minimal'?
DeleteCheck 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
Also try including 'setspace' package.
DeleteBardzo ciekawy artykuł. Pozdrawiam serdecznie !
ReplyDelete