1

I would like to reduce the spacing after the Acronyms title to match spacing of a regular section, but don't know how.

enter image description here

I tried to reduce it manually using \renewcommand{\glossarypreamble}{\vspace*{-\baselineskip}}, which works, but is a really bad way of doing it.

MWE:

\documentclass[a4paper, 12pt]{article}

\usepackage[acronym]{glossaries}

\setglossarystyle{alttree}

\makeglossaries
\newacronym{frc}{FRC}{First Robotics Competition}
\newacronym{ftc}{FTC}{First Technical Challenge}
\newacronym{fll}{FLL}{First Lego League}
\glsaddall
\glsfindwidesttoplevelname

\begin{document}
  \section{Sample Text}
  \gls{frc}, \gls{ftc}, \gls{fll}

  \printglossary[type=\acronymtype]
\end{document}
  • Can you explain why you think that \renewcommand{\glossarypreamble}{\vspace*{-\baselineskip}} is a bad way to reduce vertical space? – Hafid Boukhoulda Feb 23 at 12:11
  • Because the resulting spacing isn't exactly equal to the spacing of a regular section. – Tomáš Sláma Feb 23 at 12:16
1

For some reason, glossaries does \mbox{}\par at the start of a glossary, so adding an empty line.

\documentclass[a4paper, 12pt]{article}

\usepackage[acronym]{glossaries}

\setglossarystyle{alttree}
\setglossarypreamble[acronym]{\vspace*{-\baselineskip}}

\makeglossaries

\newacronym{frc}{FRC}{First Robotics Competition}
\newacronym{ftc}{FTC}{First Technical Challenge}
\newacronym{fll}{FLL}{First Lego League}

\glsaddall
\glsfindwidesttoplevelname

\begin{document}

\section{Sample Text}

\gls{frc}, \gls{ftc}, \gls{fll}

\printglossary[type=\acronymtype]

\section*{Acronyms}

\textbf{FLL} First Lego League. 1

\end{document}

enter image description here

  • This does fix the MWE, but it seems that when you add spacing between each of the acronyms, it is also added to the top and that's why it isn't working in my full document. – Tomáš Sláma Feb 23 at 12:54
  • @TomášSláma I don't know how you add spacing between acronyms. – egreg Feb 23 at 13:51
  • The spacing was likely due to me changing parskip length. I managed to fix the issue by doing \renewcommand{\glossarypreamble}{\vspace*{-\baselineskip}\vspace*{-\parskip}}. – Tomáš Sláma Feb 23 at 14:08
0

The additional space is caused by \setglossarystyle{alttree}. Use \setglossarystyle{tree}.

\documentclass[a4paper, 12pt]{article}

\usepackage[acronym]{glossaries}

\setglossarystyle{tree}

\makeglossaries
\newacronym{frc}{FRC}{First Robotics Competition}
\newacronym{ftc}{FTC}{First Technical Challenge}
\newacronym{fll}{FLL}{First Lego League}
\glsaddall
\glsfindwidesttoplevelname

\begin{document}
  \section{Sample Text}
  \gls{frc}, \gls{ftc}, \gls{fll}

  \printglossary[type=\acronymtype]
\end{document}

enter image description here

  • Using the tree glossary style would make the long acronym names misaligned, which is something I don't want. – Tomáš Sláma Feb 23 at 12:59
  • @TomášSláma I see! – Hafid Boukhoulda Feb 23 at 13:14

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.