词汇表:如何在 \textsmaller 中排版页码列表并减少垂直间隙

词汇表:如何在 \textsmaller 中排版页码列表并减少垂直间隙

我用glossaries-extra它来排版书中的符号列表。由于这本书很大,每个条目的页码列表很长,导致整个词汇表占用太多空间。我希望通过使用\smaller或排版页码\textsmaller并减少不必要的垂直间隙来减少这个空间。

为了重现我尝试过的操作,请创建一个名为的文件q.tex,其中包含

\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}

然后pdflatex q && makeindex -g -s q.ist -t q.nlg -o q.not q.ntn循环运行,直到输出稳定。结果是:

运行 pdflatex 和 makeindex 的结果

如您所见,只有数字的大小减小了。

  1. 如何减小整个页码列表的字体大小(包括逗号和空格)?

  2. 如何消除词汇表标题(此处:“Symbolverzeichnis”)和词汇表第一项(此处:“

答案1

您可以重新定义词汇表环境来注入较小的命令(我并不喜欢这样,它太小了,您只需写几个点,它就会给我的眼睛相同的输出。)

词汇表是一个长表,它在前面插入一个空格。这个空格\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

相关内容