References with text in LaTeX

前端 未结 3 1993
情书的邮戳
情书的邮戳 2021-01-30 19:21

In LaTeX you can easily reference a section by using \\label{} next to a section and then \\ref{} to create the reference. However, the reference only

3条回答
  •  执笔经年
    2021-01-30 20:12

    I think you can do this with the hyperref package, although I've not tried it myself. From the relevant LaTeX Wikibook section:

    The hyperref package introduces another useful command; \autoref{}. This command creates a reference with additional text corresponding to the targets type, all of which will be a hyperlink. For example, the command \autoref{sec:intro} would create a hyperlink to the \label{sec:intro} command, wherever it is. Assuming that this label is pointing to a section, the hyperlink would contain the text "section 3.4", or similar (capitalization rules will be followed, which makes this very convenient). You can customize the prefixed text by redefining \typeautorefname to the prefix you want, as in:

    \def\subsectionautorefname{section}

提交回复
热议问题