1

I use glossaries-extra to typeset the list of symbols in a book I edit. Since the book is large, the list of page numbers for each entry is long, making the whole glossary occupy too much space. I wish to reduce this space by typesetting the page numbers using \smaller or \textsmaller and reducing unnecessary vertical gaps.

To reproduce what I tried, create a file called, say, q.tex, containing

\documentclass[deutsch,graybox,envcountchap]{svmono}%%% Version 5.6 from https://www.springer.com/gp/authors-editors/book-authors-editors/resources-guidelines/rights-permissions-licensing/manuscript-preparation/5636 or https://resource-cms.springernature.com/springer-cms/rest/v1/content/20566/data/v9
\usepackage[paperwidth=168mm,paperheight=240mm,height=210mm,width=144mm,includeall=true]{geometry}
\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[latin,ngerman]{babel}
\usepackage{newtxtext}
\usepackage[slantedGreek]{newtxmath}
\usepackage[babel=true,final=true,verbose=errors,protrusion=true,expansion=true]{microtype}
\usepackage{csquotes}
\usepackage[hidelinks]{hyperref}
%%% The next hack improves how hyperref jives with svindd.ist, see https://tex.stackexchange.com/a/429446
\makeatletter
\def\@commahyperpage#1{\@@commahyperpage#1,\,,\\}
\def\@@commahyperpage#1,\,#2,#3\\{%
  \ifx\\#2\\%
    \HyInd@pagelink{#1}%
  \else
    \HyInd@pagelink{#1},\,\HyInd@pagelink{#2}%
  \fi
}
\makeatother
\usepackage[makeindex,toc,nogroupskip,nomain]{glossaries-extra}
\setglossarystyle{long3col}\renewcommand{\glspagelistwidth}{8.62em}
\renewcommand*{\glsnumberformat}[1]{\textsmaller[6]{#1}}
\GlsSetQuote{+} %%% Hack to work with makeindex
\usepackage{relsize}
\usepackage[ngerman,capitalize]{cleveref}
\newglossary[nlg]{notation}{not}{ntn}{Symbolverzeichnis}
\makeglossaries
%%% See https://tex.stackexchange.com/questions/399338/hyperref-glossaries-latex-bad-spacing-around-math-relations
\glssetcategoryattribute{mathrelation}{hyperoutside}{false}
\glssetcategoryattribute{mathrelation}{textformat}{mathrel}
\glssetcategoryattribute{mathoperator}{hyperoutside}{false}
\glssetcategoryattribute{mathoperator}{textformat}{mathop}
\newglossaryentry{not:booleanValues}{type=notation, name={\(\mathbb{B}\)}, text={\mathbb{B}}, sort={B}, description={Die Menge boolescher Werte.}}
\newglossaryentry{not:logicalTruthValue}{type=notation, name=\(\mathrm{L}\), text={\mathrm{L}}, sort={BL}, description={Boolescher Wert \glqq Wahr\grqq.}}%%% German shorthands "` and "' from babel don't work that easily with glossaries
\newglossaryentry{not:logicalFalsehoodValue}{type=notation, name=\(\mathrm{O}\), text={\mathrm{O}}, sort={BO}, description={Boolescher Wert \glqq Falsch\grqq.}}%%% German shorthands "` and "' from babel don't work that easily with glossaries
\newglossaryentry{not:partialMap}{type=notation, name={\(\dashrightarrow\)}, category=mathrelation, text={\dashrightarrow}, sort=partialMap, description={Unter \(X{\dashrightarrow}Y\) verstehen wir die Menge partieller Funktionen von \(X\) nach \(Y\).}}
\let\supop\sup \let\sup\relax
\DeclareMathOperator*{\sup}{\gls{not:supremum}}
\newglossaryentry{not:supremum}{type=notation, name={\(\mathrm{sup}\)}, category=mathoperator, text=\!\supop, sort={supremum}, description={Das Supremum, die kleinste obere Schranke einer Menge in einer Halbordnung.}}
\let\infop\inf \let\inf\relax
\DeclareMathOperator*{\inf}{\gls{not:infimum}}
\newglossaryentry{not:infimum}{type=notation, name={\(\mathrm{inf}\)}, category=mathoperator, text=\!\infop, sort={infimum}, description={Das Infimum, die größte untere Schranke einer Menge in einer Halbordnung.}}
\newglossaryentry{not:leastFixedPoint}{type=notation, name={\(\muup\)}, category=mathoperator, text=\muup, sort={mu}, description={Mit \(\muup\,f\) wird der kleinste Fixpunkt (im Falle der Existenz) der Funktion \(f\) bezeichnet.}}
\newglossaryentry{not:endOfProof}{type=notation, name={QED}, text=QED, sort={QED0}, description={\foreignlanguage{latin}{Quod erat demonstrandum}. Bezeichnet das Ende eines Beweises.}}
\makeindex
\begin{document}
\pagenumbering{Roman}%%% change from "Roman" to "gobble" later
\maketitle
\frontmatter
\tableofcontents
\mainmatter
\newcommand{\testall}{\(\gls{not:booleanValues}\) \(\gls{not:logicalTruthValue}\) \(\gls{not:logicalFalsehoodValue}\) \(\gls{not:partialMap}\) \(\sup\) \(\inf\) \(\gls{not:leastFixedPoint}\) \gls{not:endOfProof}}
\newcommand{\testalld}{\testall\cleardoublepage\testall\cleardoublepage}
\newcommand{\testalldd}{\testalld\cleardoublepage\testalld\cleardoublepage}
\newcommand{\testallddd}{\testalldd\cleardoublepage\testalldd\cleardoublepage}
\newcommand{\testalldddd}{\testallddd\cleardoublepage\testallddd\cleardoublepage}
\testalldddd
\backmatter
\glsaddallunused%
\newlength{\oldtabcolsep}%
\setlength{\oldtabcolsep}{\tabcolsep}%
\makeatletter\setlength{\tabcolsep}{3\p@}\makeatother%
\let\oldarraystretch\arraystretch%
\renewcommand{\arraystretch}{2}%
\printglossaries%
\let\arraystretch\oldarraystretch%
\makeatletter
\setlength{\tabcolsep}{\oldtabcolsep}%
\makeatother%
\end{document}

Then run pdflatex q && makeindex -g -s q.ist -t q.nlg -o q.not q.ntn in a loop until the output stabilizes. The result is:

The result of running pdflatex and makeindex

As you see, only the size of the digits is reduced.

  1. How to reduce the font size for each page-number list as a whole (including the commans and the spaces)?

  2. How to remove the vertical gap between the glossary title (here: "Symbolverzeichnis") and the first item of the glossary (here: "𝔹 Die Menge boolescher Werte ... ").

1
+50

You can redefine the glossary environment to inject your smaller command (not that I like this, it is so small that you could simply write a number of dots, it would give the same output for my eyes.)

The glossary is a longtable which inserts a space before. This space \LTpre can be changed.

\usepackage{array}
\renewenvironment{theglossary}%
    {\begin{longtable}{lp{\glsdescwidth}>{\smaller[6]}p{\glspagelistwidth}}}%
    {\end{longtable}}%
\LTpre=-20pt  % or 0pt or somethings else
  • Ah, that's a relief ;-) – Ulrike Fischer Mar 30 at 14:25
  • By default longtable inserts \bigskipamout, you can set this to 0, but if you want to save space negative space works too. – Ulrike Fischer Mar 30 at 14:34

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.