使用包 {glossaries-extra} 可点击的首字母缩略词

使用包 {glossaries-extra} 可点击的首字母缩略词

我正在使用该包glossaries-extra来定义我的首字母缩略词。它们以简短版本出现在文本中,并且代码正确地生成了缩写列表。问题是我无法单击它们。事实上,它们不会像使用 进行引用时那样以蓝色显示\cite{}。有谁能告诉我我错在哪里?我使用的代码如下。

\documentclass[a4paper]{report}
\usepackage [acronym]{glossaries-extra}
\setabbreviationstyle[acronym]{long-short}
\newacronym{fem}{FEM}{Finite Element Models}
\makeglossaries
\begin{document}
This is the first time the acronym \gls{fem} appears, so I want to keep it in its long version. This is the second time the acronym \gls{fem} appears, so I want to keep it in its short version. 
\end{document}

答案1

两点:

  • 要获得可点击的条目,hyperref需要在包之前加载包glossaries-extra。这是少数hyperref需要先加载包再加载其他包的情况之一,通常应该在其他包之后加载。

  • 需要一个点击可以到达的地方,例如\printglossaries


\documentclass[a4paper]{report}

\usepackage{hyperref}


\usepackage[acronym]{glossaries-extra}
\setabbreviationstyle[acronym]{long-short}
\newacronym{fem}{FEM}{Finite Element Models}
\makeglossaries


\begin{document}
This is the first time the acronym \gls{fem} appears, so I want to keep it in its long version. This is the second time the acronym \gls{fem} appears, so I want to keep it in its short version. 

\printglossaries
\end{document}

在此处输入图片描述

相关内容