![如何將單字與cleveref連結?](https://rvso.com/image/391720/%E5%A6%82%E4%BD%95%E5%B0%87%E5%96%AE%E5%AD%97%E8%88%87cleveref%E9%80%A3%E7%B5%90%EF%BC%9F.png)
是否可以將單字連結到文件末尾的含義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}