How do I emit the text content of a reference in LaTeX?

前端 未结 3 820
我在风中等你
我在风中等你 2021-01-06 04:38

I have a section:

\\section{Introduction} \\label{sec:introduction}

I\'d like a link to the section where the link text is the name of the

3条回答
  •  走了就别回头了
    2021-01-06 04:57

    There are a couple of packages that provide this for you. nameref is distributed as part of hyperref to do this:
    http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=nameref

    There is a more general package for cross-referencing basically anything, called zref: http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=zref

    It's by the same author as hyperref, Heiko Oberdiek; it's the one that I would choose. Here's an example:

    \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}
    

    Note that it even removes the trailing period in the section title.

提交回复
热议问题