Cross-References in LaTeX
Use \label and \ref to create automatically-updated cross-references to sections, figures, and equations.
Quick Answer
latex
\section{Methods}\label{sec:methods}
% Later:
As described in Section~\ref{sec:methods}, ...Labeling Different Elements
latex
% Sections:
\section{Introduction}\label{sec:intro}
\subsection{Background}\label{sec:background}
% Equations:
\begin{equation}
E = mc^2 \label{eq:einstein}
\end{equation}
% Figures:
\begin{figure}[htbp]
\includegraphics[width=\linewidth]{plot.pdf}
\caption{Results}\label{fig:results}
\end{figure}
% Tables:
\begin{table}[htbp]
\caption{Summary}\label{tab:summary}
...
\end{table}Referencing
latex
% Basic ref (number only):
see Section~\ref{sec:intro} % → "see Section 1"
see Figure~\ref{fig:results} % → "see Figure 3"
see Equation~\eqref{eq:einstein} % → "see Equation (1)"
see Table~\ref{tab:summary} % → "see Table 2"
% Page reference:
see page~\pageref{sec:intro}
% Note: ~ is a non-breaking space — keeps "Figure" and "3" togetherWriting your thesis in LaTeX?
MonsterWriter's LaTeX Workspace gives you real-time PDF preview with no compile limits — at a fraction of Overleaf's price. Works just like Overleaf, costs 11× less.
Try MonsterWriter freeautoref (Smart References)
With hyperref, use \autoref to automatically include the element type name.
latex
\usepackage{hyperref}
\autoref{sec:intro} % → "Section 1"
\autoref{fig:results} % → "Figure 3"
\autoref{eq:einstein} % → "Equation (1)"
\autoref{tab:summary} % → "Table 2"
% Customize the type names:
\renewcommand{\sectionautorefname}{Section}
\renewcommand{\figureautorefname}{Figure}Label Naming Conventions
Use prefixes to keep labels organized. There's no enforced convention — choose one and be consistent.
| Element | Convention | Example |
|---|---|---|
| Section | sec: | sec:intro |
| Figure | fig: | fig:results |
| Table | tab: | tab:summary |
| Equation | eq: | eq:einstein |
| Chapter | ch: | ch:methods |
| Appendix | app: | app:data |
Compile Twice
Labels are written to a .aux file on the first compile and read on the second. Always compile twice (or use latexmk) to resolve all references. ?? in the output means unresolved references.
Related Topics
More LaTeX Topics
Bold TextItalic TextUnderline TextStrikethroughFont SizeText ColorText AlignmentHyperlinksSectionsTable of ContentsNew PageNew LineMarginsLine SpacingPage NumbersHeaders & FootersMinipageTablesFigures & ImagesListsEquationsFractionsSquare RootSubscript & SuperscriptSummationIntegralMatrixGreek LettersArrowsTilde (~)Delta (δ, Δ)Hash (#)BibliographyFootnotes