8

I'm using the glossaries package for producing of nomenclature/symbols/acronyms lists, but I don't know how to influence the vertical gap between the glossary title and the first glossary entry. Namely, a smaller gap is needed. I've found a dirty hack how to make it smaller using \begingroup .. \endgroup and \titlespacing*, but is it possible to affect this gap with some glossaries-in-built means? Even when defining a new style, I don't know what property/command is responsible for this space.

\documentclass[11pt,onecolumn,twoside,draft,titlepage,fleqn,a4paper,openright]{book} 
\usepackage{titlesec}
%-----------------------------------------------------------------------
\usepackage{longtable}
\usepackage{makeidx}
\usepackage[nonumberlist, acronym, toc, section, shortcuts, nopostdot, nogroupskip]{glossaries}
\renewcommand*{\arraystretch}{1.3}  % sets the line indent in glossaries
\setlength{\glsdescwidth}{12.5cm}   
\setlength\LTleft{0pt}
\newglossary[slg]{symbols}{syi}{syg}{Nomenclature}
\newglossary[ilg]{indices}{iyi}{iyg}{List of indices}
\makeglossaries

\newacronym{ECD}{ECD}{equivalent circuit diagram}
\newacronym{RES}{RES}{renewable energy source}
\newglossaryentry{Rx1}
{
  name={\ensuremath{R_{x1}}},
  description={Equivalent series resistance},
  sort=Rx1, type=symbols
}
\newglossaryentry{ref}
{
  name={*},
  description={Indicates reference value},
  sort=ref, type=indices
}

\begin{document}
\begingroup
\glsaddall                                
\titlespacing*{\section} {0pt}{0pt}{4pt} % dirty hack
\printglossary[type=\acronymtype, style=long, title=List of Abbreviations and Acronyms]
\vspace{40pt} % Another dirty hack
\printglossary[type=symbols, style=long, title=Nomenclature]
\vspace{40pt} % Another dirty hack
\printglossary[type=indices, style=long, title=List of indices]
\endgroup
\end{document}
1
5

The command responsible for that space is the sectioning command used at the start of the glossary (\section* in your example). This makes it consistent with the structure throughout the rest of the document. By way of illustration:

\documentclass[11pt,onecolumn,twoside,draft,titlepage,fleqn,a4paper,openright]{book} 
\usepackage{titlesec}
%-----------------------------------------------------------------------
\usepackage{longtable}
\usepackage{makeidx}
\usepackage[nonumberlist, acronym, toc, section, shortcuts, nopostdot, nogroupskip]{glossaries}
\renewcommand*{\arraystretch}{1.3}  % sets the line indent in glossaries
\setlength{\glsdescwidth}{12.5cm}   
\setlength\LTleft{0pt}
\newglossary[slg]{symbols}{syi}{syg}{Nomenclature}
\newglossary[ilg]{indices}{iyi}{iyg}{List of indices}
\makeglossaries

\newacronym{ECD}{ECD}{equivalent circuit diagram}
\newacronym{RES}{RES}{renewable energy source}
\newglossaryentry{Rx1}
{
  name={\ensuremath{R_{x1}}},
  description={Equivalent series resistance},
  sort=Rx1, type=symbols
}
\newglossaryentry{ref}
{
  name={*},
  description={Indicates reference value},
  sort=ref, type=indices
}

\begin{document}
\glsaddall                                
\printglossary[type=\acronymtype, style=long, title=List of Abbreviations and Acronyms]
\printglossary[type=symbols, style=long, title=Nomenclature]
\printglossary[type=indices, style=long, title=List of indices]

\section*{Sample}

\begin{longtable}{ll}
Some & Text
\end{longtable}
\end{document}

This produces:

Image of resulting document

The gap between \section*{Sample} and the longtable is the same as the equivalent gap in the glossaries. If you really wanted to reduce this gap in the glossaries (although I don't recommend this) without changing the overall sectioning style you could redefine \glossarypreamble to add some negative space, for example:

\renewcommand*{\glossarypreamble}{\vspace{-\baselineskip}}

Incorporating this into the above example:

\documentclass[11pt,onecolumn,twoside,draft,titlepage,fleqn,a4paper,openright]{book} 
\usepackage{titlesec}
%-----------------------------------------------------------------------
\usepackage{longtable}
\usepackage{makeidx}
\usepackage[nonumberlist, acronym, toc, section, shortcuts, nopostdot, nogroupskip]{glossaries}
\renewcommand*{\arraystretch}{1.3}  % sets the line indent in glossaries
\setlength{\glsdescwidth}{12.5cm}   
\setlength\LTleft{0pt}
\newglossary[slg]{symbols}{syi}{syg}{Nomenclature}
\newglossary[ilg]{indices}{iyi}{iyg}{List of indices}
\makeglossaries

\newacronym{ECD}{ECD}{equivalent circuit diagram}
\newacronym{RES}{RES}{renewable energy source}
\newglossaryentry{Rx1}
{
  name={\ensuremath{R_{x1}}},
  description={Equivalent series resistance},
  sort=Rx1, type=symbols
}
\newglossaryentry{ref}
{
  name={*},
  description={Indicates reference value},
  sort=ref, type=indices
}

\begin{document}
\glsaddall

\renewcommand*{\glossarypreamble}{\vspace{-\baselineskip}}                                
\printglossary[type=\acronymtype, style=long, title=List of Abbreviations and Acronyms]
\printglossary[type=symbols, style=long, title=Nomenclature]
\printglossary[type=indices, style=long, title=List of indices]

\section*{Sample}

\begin{longtable}{ll}
Some & Text
\end{longtable}
\end{document}

This results in:

Image of resulting document

Here the gap for the glossaries is smaller but the gap for the sample section remains the same as before.

5
  • Btw in my initial "solution", the section gap also remained unchanged for the rest of the document due to \begingroup .. \endgroup. But this is simply to be clear. Otherwise see above. Dec 17 '13 at 22:38
  • @Nicola Talbot, how can I change the space between rows, for example, for superragged style? knowing that I used the option nogroupskip.
    – Diaa
    Aug 13 '16 at 18:44
  • 2
    @DiaaAbidou The superragged style uses the supertabular environment, so any of the standard tabular settings should work, for example, you could redefine \arraystretch to, say, 1.5 to increase the spacing. Aug 15 '16 at 10:14
  • @NicolaTalbot Can you please tell how to reduce the spacing between the consecutive glossary entries? I tried a lot but I am not able to find an answer
    – Rouge
    Oct 11 '18 at 14:01
  • @Rouge Make the value of \arraystretch smaller to reduce the inter-row spacing. Remember to use nogroupskip if you want to suppress the larger space between letter groups. Oct 11 '18 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.