我像这样使用词汇表包:
\usepackage[toc,xindy]{glossaries}
\include{glossaryentries}
\renewcommand*\glspostdescription{\dotfill}
\makeglossaries
....
\setglossarystyle{long}
\printglossary[title=List of Notations]
并得到
它完全符合我的要求,除了一些条目,比如图片中的第二个条目,页码出现在左侧而不是右侧。我不知道为什么。有人知道我该怎么做吗?
此特定条目的描述如下
\newglossaryentry{supportfunction}{
name ={\ensuremath{h(K, \vect{u} )}},
description ={support function of $K$ evaluated in the direction $ \vect{u} $},
sort =hKu
}
一个简单的例子:
\documentclass[11pt]{book}
\usepackage{hyperref}
\usepackage{glossaries}
\renewcommand*\glspostdescription{\dotfill}
\makeglossaries
\newglossaryentry{supportfunction}{
name ={\ensuremath{h(K, \boldsymbol{u} )}},
description ={support function of $K$ evaluated in the direction $ \boldsymbol{u} $},
sort =hKu
}
\begin{document}
\gls{supportfunction}
\setglossarystyle{long}
\printglossary
\end{document}
答案1
可以通过明确使用来重现longtable
:
\documentclass[11pt]{book}
\usepackage{hyperref}
\usepackage{glossaries}
\begin{document}
\begin{longtable}{lp{\glsdescwidth}}
\ensuremath{h(K, \boldsymbol{u} )} &
support function of $K$ evaluated in the direction
$ \boldsymbol{u} $\dotfill\space
1\tabularnewline
\end{longtable}
\end{document}
这基本上就是long
样式的作用。问题似乎出在 后面的空格上\dotfill
。由于这是样式的一部分,最简单的解决方案是根据 定义自定义样式long
:
\documentclass[11pt]{book}
\usepackage{hyperref}
\usepackage{glossaries}
\makeglossaries
\newglossarystyle{longdotted}{%
\setglossarystyle{long}%
\renewcommand{\glossentry}[2]{%
\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
\glossentrydesc{##1}\dotfill ##2\tabularnewline
}%
}
\newglossaryentry{supportfunction}{
name ={\ensuremath{h(K, \boldsymbol{u} )}},
description ={support function of $K$ evaluated in the direction
$ \boldsymbol{u} $},
sort =hKu
}
\begin{document}
\gls{supportfunction}
\setglossarystyle{longdotted}
\printglossary
\end{document}