我可以使整个“表 1”可点击作为 Latex 中的参考吗?

Woe*_*eIs 6 latex

在我的文档中,我使用 label 函数来标记表格和数字:

\label{}
Run Code Online (Sandbox Code Playgroud)

然后我使用该\ref{}函数来引用表格或图形。在我的文本中。

我遇到的问题是,在我的文本中我这样写:

As can be seen in Table \ref{table1}.
Run Code Online (Sandbox Code Playgroud)

它会将我的文本输出为:

As can be seen in Table 1.
Run Code Online (Sandbox Code Playgroud)

然而,只有数字“1”是可点击的并通向表格。我希望“表格”部分也可以点击,这样您就可以点击“表格 1”的任何部分并被引用到表格中。

我已经通过使用\phantomsection\label{}and then尝试了不同的方法\hyperref[]{},但这不会动态输出表格或数字编号。

rkt*_*kta 10

使用\autoref.

\autoref 根据类型创建带有文本的引用。

一张图片会告诉更多然后一千个字:

在此处输入图片说明

示例代码:

\documentclass[a4paper]{article}

\usepackage[english]{babel}

\usepackage{graphicx}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}

\begin{document}

\textbackslash ref to the Figure \ref{fig:example}

\textbackslash autoref to the  \autoref{fig:example}

\textbackslash nameref to the figure \nameref{fig:example}

\begin{figure}
\centering
\includegraphics[width=0.3\textwidth]{example-image-a}
\caption{\label{fig:example}Example image}
\end{figure}


\end{document}
Run Code Online (Sandbox Code Playgroud)

要更改插入的文本\autoref,例如表格:

\renewcommand{\tableautorefname}{bettertablename}
Run Code Online (Sandbox Code Playgroud)

有关hyperref所有选项,请参阅手册。