如何影响词汇表名称和正文之间的垂直间隙

如何影响词汇表名称和正文之间的垂直间隙

我正在使用glossaries软件包来生成术语/符号/缩写列表,但我不知道如何影响词汇表标题和第一个词汇表条目之间的垂直间隙。也就是说,需要一个较小的间隙。我发现了一个肮脏的黑客如何使用\begingroup..\endgroup和来缩小它\titlespacing*,但是否可以使用一些词汇表内置的方法来影响这个间隙?即使在定义新样式时,我也不知道哪个属性/命令负责这个空间。

\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

负责该空间的命令是词汇表开头使用的分段命令(\section*在您的示例中)。这使其与文档其余部分的结构保持一致。举例来说:

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

得出的结果为:

生成的文档的图像

\section*{Sample}和之间的间隙longtable与词汇表中的等效间隙相同。如果您确实想减少词汇表中的这个间隙(尽管我不建议这样做),而不改变整体分段样式,您可以重新定义\glossarypreamble以添加一些负空间,例如:

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

将其纳入上面的例子:

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

其结果是:

生成的文档的图像

这里词汇表的差距较小,但样本部分的差距与以前相同。

相关内容