我们在研究所内共享词汇表和符号,我想记录可用的词汇表和符号以及它们的标签。因此我使用\glsaddall{}
它,它非常有效。最后一步,我想更改表格的外观,以便在任何条目前面显示标签。怎么做?
答案1
\glscurrententrylabel
您可以使用个人词汇表样式的命令访问标签,即
\documentclass{article}
\usepackage{glossaries}
\makeglossaries
\loadglsentries{example-glossaries-brief}
\newglossarystyle{labelStyle}{%
\renewenvironment{theglossary}%
{\begin{longtable}{p{.2\textwidth}p{.3\textwidth}p{.5\textwidth}}}%
{\end{longtable}}%
\renewcommand*{\glossaryheader}{% setting the table's header
\bfseries & \bfseries Label & \bfseries Description
\\\tabularnewline\endhead}%
\renewcommand*{\glsgroupheading}[1]{}% no heading between groups
\renewcommand*{\glossentry}[2]{% main entries displayed
\textbf{\glstarget{##1}{\glossentryname{##1}}}% name
& \glscurrententrylabel% label
& \glossentrydesc{##1}% description
\tabularnewline% end of row
}%
\renewcommand*{\glsgroupskip}{}% no distance between groups
}
\begin{document}
\glsaddall
\printglossary[style=labelStyle]
\end{document}