我有一个章节:
\section{Introduction} \label{sec:introduction}
我希望能够得到一个链接,链接文本是该部分的名称。我可以使用hyperref
实现:
The \hyperrf[sec:introduction]{Introduction} introduces the paper.
但这需要重复章节标题(“介绍”)。 有没有办法获取它?ref
返回章节编号,这是不正确的。 autoref
返回“部分”和章节编号,这也不正确。
我有一个章节:
\section{Introduction} \label{sec:introduction}
我希望能够得到一个链接,链接文本是该部分的名称。我可以使用hyperref
实现:
The \hyperrf[sec:introduction]{Introduction} introduces the paper.
但这需要重复章节标题(“介绍”)。 有没有办法获取它?ref
返回章节编号,这是不正确的。 autoref
返回“部分”和章节编号,这也不正确。
有几个包可以为您提供此功能。nameref作为超链接的一部分进行分发,用于执行此操作:
http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=nameref
还有一个更通用的交叉引用包,称为zref: http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=zref
它由与hyperref相同的作者Heiko Oberdiek编写;这是我会选择的包。以下是一个示例:
\documentclass[oneside,12pt]{article}
\usepackage[user,titleref]{zref}
\begin{document}
\section{Introduction of sorts.}\zlabel{sec:intro}
Hello
\subsection{Structure}
We begin in `\ztitleref{sec:intro}'.
\end{document}
请注意,它甚至删除了章节标题末尾的句点。\newsavebox
\savebox
\usebox
你可以在 ctan.org
上搜索,我怀疑这已经被完成了。