我想在文本中引用一些重要的关键字(由索引定义)和概念(由词汇表定义)。假设我[[Prototype]]
在某个地方创建了索引, class
在inheritance
其他地方创建了词汇表。
我的问题是如何引用它们,以便此处显示的文本如下所示:
伪乳胶代码:
In Chapter 5, we addressed the \ref{index:Prototype} mechanism in
detail, and why it's confusing and inappropriate to describe it as
\ref{glossary:class} or \ref{glossary:inheritance} ...
期望输出:
In Chapter 5, we addressed the [[Prototype]](§1.2.3 page 123)
mechanism in detail, and why it's confusing and inappropriate to
describe it as class (Glossary page 234) or inheritance (Glossary
page 235) ...
答案1
包选项创建一个计数器,当顶级条目在词汇表中列出时,entrycounter
该计数器会自动递增。默认情况下,这也会在条目前面显示计数器值,但可以通过重新定义为不执行任何操作来更改。的参数由\refstepcounter
\glsentrycounterlabel
\label
glsentry-
标签在哪里标签是条目的标签。
\documentclass{report}
\usepackage[entrycounter]{glossaries}
\makeglossaries
\newglossaryentry{sample}{name={sample},description={an example}}
\renewcommand{\glsentrycounterlabel}{}
\begin{document}
\gls{sample} described on page \pageref{glsentry-sample}.
\printglossaries
\end{document}