Master LaTeX cross-referencing system. Learn to reference figures, tables, equations, sections with labels, and use advanced packages like cleveref.
\label{prefix:name}
\ref{prefix:name}
Element Type | Prefix | Example | Reference |
---|---|---|---|
Chapter | chap: | \label{chap:intro} | Chapter~\ref{chap:intro} |
Section | sec: | \label{sec:methods} | Section~\ref{sec:methods} |
Subsection | subsec: | \label{subsec:data} | Section~\ref{subsec:data} |
Figure | fig: | \label{fig:results} | Figure~\ref{fig:results} |
Table | tab: | \label{tab:stats} | Table~\ref{tab:stats} |
Equation | eq: | \label{eq:main} | Equation~\ref{eq:main} |
Algorithm | alg: | \label{alg:sort} | Algorithm~\ref{alg:sort} |
Theorem | thm: | \label{thm:main} | Theorem~\ref{thm:main} |
Lemma | lem: | \label{lem:helper} | Lemma~\ref{lem:helper} |
Appendix | app: | \label{app:code} | Appendix~\ref{app:code} |
fig:sales-growth
not fig:1
~
before \ref{}
commandsCommand | Purpose | Example Output |
---|---|---|
\label{name} | Create label | (invisible) |
\ref{name} | Reference number | 1, 2, 3… |
\pageref{name} | Reference page | 5, 10, 15… |
\eqref{name} | Equation reference | (1), (2), (3)… |
\cref{name} | Smart reference | figure 1, table 2… |
\Cref{name} | Capitalized reference | Figure 1, Table 2… |