我成功地使用glossaries-extra
样式alltree
根据最宽元素自动对齐缩写和符号列表。现在,我想在不破坏的情况下将 DFT 和离散傅里叶变换之间的水平间距增加 2 毫米\glsfindwidesttoplevelname[abbreviations,symbols]
。这可行吗,还是表格样式更合适?谢谢!
梅威瑟:
\documentclass[
a4paper,
10pt,
]{scrreprt}
\usepackage[no-math]{fontspec}
\usepackage[showframe]{geometry}
\usepackage{hyperref}
% Glossaries
\usepackage[abbreviations,symbols,nonumberlist,nogroupskip]{glossaries-extra}
\makeglossaries[abbreviations,symbols]
% No glossary title
\renewcommand{\glossarysection}[2][]{}
\setglossarypreamble[abbreviations]{\vspace*{-\baselineskip}}
\setglossarypreamble[symbols]{\vspace*{-\baselineskip}}
% Glossaries style
\setglossarystyle{alttree}
\setabbreviationstyle{long-short}
\renewcommand{\glsnamefont}[1]{\normalfont{#1}}
% Abbreviations
\newabbreviation{fem}{FEM}{finite element method}
\newabbreviation{dft}{DFT}{discrete Fourier transfom}
% Symbols
\glsxtrnewsymbol[description={Fourier series constant component multiplier}]{a0}{a\textsubscript{0}}
\glsaddallunused % Print all entries including uncited ones
\glsfindwidesttoplevelname[abbreviations,symbols] % Automatically find widest element
\begin{document}
\chapter{List of Abbreviations and Symbols}
\section{Abbreviations}
\printglossary[type=abbreviations]
\section{Symbols}
\printglossary[type=symbols]
\end{document}