是否可以将单词与文件末尾的含义联系起来cleveref
?
这是我的代码的 MWE:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{cleveref}
\begin{document}
Today I ran like a \label{cheetah}cheetah and it was amazing to feel the wind.
\pagebreak
\cref{cheetah}: is a large cat of the subfamily Felinae that occurs in North, Southern and East Africa, and a few localities in Iran. It inhabits a variety of mostly arid habitats like dry forests, scrub forests, and savannahs.
\end{document}
我希望句子中的名字 cheetah 可以链接到文档末尾的含义,并且当我调用\cref{cheetah}
它时只显示名字 cheetah 而不是数字。
答案1
有好消息也有坏消息。坏消息是你不能使用\label
和\cref
来实现交叉引用的目标。这是因为,鉴于你的设置,LaTeX 无法\label
与最近增加的计数器变量有意义地关联。
但也有好消息!您可以使用包中的\hyperlink
和宏完全实现排版目标。和都是接受两个参数的宏。第一个必须相同——在下面的例子中。第二个是自由格式——和,在下面的例子中分别是。\hypertarget
hyperref
\hyperlink
\hypertarget
cheetah_def
cheetah
\textbf{Cheetah}
\documentclass{article}
\usepackage{hyperref}
\begin{document}
Today I ran like a \hyperlink{cheetah_def}{cheetah} and
it was amazing to feel the wind.
\pagebreak
\noindent
\hypertarget{cheetah_def}{\textbf{Cheetah}}: A large cat
of the subfamily Felinae that occurs in North, Southern
and East Africa, and a few localities in Iran. It inhabits
a variety of mostly arid habitats such as dry forests,
scrub forests, and savannahs.
\end{document}