[Tex/LaTex] Chapter ref with LaTeX

cross-referencing

In LaTeX, we can say something like:

"See equation \ref{eq} on page \pageref{eq}..."

Is there any way to do:

"See equation \ref{eq} in chapter \chapterref{eq}..."

Best Answer

hyperref offers \autoref which will turn \autoref{chap:foo} into "chapter X"

\documentclass{book}

\usepackage{hyperref}

\begin{document}
    \chapter{Foo}
    \label{chap:foo}
    
    This is the beginning of \autoref{chap:foo}
\end{document}

Produces:

chapter foo

To edit how hyperref references appear, see answers to this question

cleveref is another package that offers this sort of functionality.

The LaTeX wikibook has details on various cross-referencing options.

Related Question