[Tex/LaTex] Formatting for glossaries

formattingglossaries

I am new so please go easy :-).

I am using the \glossaries package to make my acronym page. I have defined only acronyms.

What I want is to make the description of the acronym in a separate column and left aligned.

The style=super option does this but it seems to shrink the column so it does not take up the pagewidth. Please see attached document.

The other problem is that it is being spread over two pages. i think the culprit is \baselineskip=22pt plus1pt. I was told this is to get the document double spaced, I am a novice to latex. Is there another option for this?

my MWE is below and the output attached. Thanks

documentclass[a4paper,12pt]{report} 

\usepackage[nopostdot,  style=super, nonumberlist, toc]{glossaries}

\makeglossaries 

\begin{document}
\baselineskip=22pt plus1pt

\printglossary[title={List of Abbreviations}]

\newpage

\gls{ngml}

\newacronym{ngml}{$\eta$g/mL}{nanogram per millilitre}

\end{document}

Page 1
Page 2

Best Answer

First, the spacing should be set using the setspace package rather than altering \baselineskip. You can then switch between double-spacing for the main part of the document and single-spacing for the list of acronyms using \doublespacing and \singlespacing. To illustrate this, the example below uses the lipsum package to provide some dummy text. Remember to remove the lipsum package and \lipsum command from any real document. The example also uses dummy acronyms that are provided by the glossaries package for testing purposes. These are contained in a file called example-glossaries-acronym.tex and are loaded using \loadglsentries. This just saves me typing a load of example acronyms. For your real document, either replace example-glossaries-acronym with the name of a file containing all your acronym definitions or remove the \loadglsentries line from the document and insert all your definitions in the document preamble.

\documentclass[a4paper,12pt]{report}

\usepackage{lipsum}% provides dummy text for testing

\usepackage[doublespacing]{setspace}
\usepackage[nopostdot,style=super,nonumberlist,toc]{glossaries}

\makeglossaries

% load some dummy acronyms for testing
\loadglsentries{example-glossaries-acronym.tex}

\begin{document}
\tableofcontents

\singlespacing
\printglossary[title={List of Abbreviations}]
\doublespacing

\chapter{Sample Text}

\lipsum % dummy text - remove from real document

Add all the acronyms for testing purposes \glsaddall

\end{document}

This produces (on pages 2 and 3):

Image of list of acronyms

There's a vertical gap between the letter groups. You can suppress this using the nogroupskip package option. The width of the second column is given by the length \glsdescwidth. You can change this (anywhere before \printglossary) using \setlength. For example:

\setlength{\glsdescwidth}{0.8\textwidth}

If you temporarily switch to the superborder style (instead of the super style) you'll see the available width of the second column. So replacing the line:

\usepackage[nopostdot,style=super,nonumberlist,toc]{glossaries}

with

\usepackage[nopostdot,nogroupskip,style=superborder,nonumberlist,toc]{glossaries}

produces:

Image of list of acronyms

Now you can adjust the value of \glsdescwidth until the column width is satisfactory, then just switch back to the super style.

Note: The dummy acronym file example-glossaries-acronym.tex was added to the glossaries package in v4.08. If you don't have the file installed, just add your own definitions.

Related Question