![左对齐,而不是居中的符号列表](https://linux22.com/image/444041/%E5%B7%A6%E5%AF%B9%E9%BD%90%EF%BC%8C%E8%80%8C%E4%B8%8D%E6%98%AF%E5%B1%85%E4%B8%AD%E7%9A%84%E7%AC%A6%E5%8F%B7%E5%88%97%E8%A1%A8.png)
默认情况下,我的符号列表居中:
我如何才能使它像上面的图表列表一样左对齐?以下是我在序言中使用的方法:
\usepackage[symbols,nogroupskip,sort=use]{glossaries-extra}
\makenoidxglossaries
\glsxtrnewsymbol[description={Cumulative distribution function attached to the point process}]{F(x)}{\ensuremath{F(x)}}
\glsxtrnewsymbol[description={Same as $F(x/s)$}]{F_s(x)}{\ensuremath{F_s(x)}}
\glsxtrnewsymbol[description={Density attached to $F$}]{f(x)}{\ensuremath{f(x)}}
\glsxtrnewsymbol[description={Density attached to $f_s$}]{f_s(x)}{\ensuremath{f_s(x)}}
在主文档中:
\listoffigures
\hypersetup{linkcolor=red}
\printnoidxglossary[type=symbols,style=long,title={List of Symbols}] % list of symbols
答案1
由于long
样式基于longtable
,因此您会自动得到一个水平居中的列表。要将其左对齐,您可以根据样式的原始定义定义自己的自定义样式long
:
\newglossarystyle{mylong}{%
\renewenvironment{theglossary}%
{\begin{longtable}[l]{@{}lp{\glsdescwidth}}}% %<-------------- added [l] and @{} here
{\end{longtable}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand{\glossentry}[2]{%
\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
\glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline
}%
\renewcommand{\subglossentry}[3]{%
&
\glssubentryitem{##2}%
\glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space
##3\tabularnewline
}%
\ifglsnogroupskip
\renewcommand*{\glsgroupskip}{}%
\else
\renewcommand*{\glsgroupskip}{ & \tabularnewline}%
\fi
}