Labels and cross-references
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
Never write "see Section 3" by hand
- If you write a number by hand and later add a section, every number is wrong.
- LaTeX solves this with labels. Tag something:
\section{Methods}\label{sec:methods}
- The name
sec:methodsis just a nickname you choose.
Refer to it anywhere
- Then point at it with
\ref— LaTeX inserts the current number:
As shown in Section~\ref{sec:methods}, ...
- The
~is a space that never breaks across lines, so "Section" and its number stay together.
It needs two passes
- On the first compile LaTeX learns the numbers; on the second it fills them in.
- Our Run does this for you automatically. (The same trick powers a table of contents.)
Label the Methods section with \label{sec:methods}, then refer to it from the last line with \ref{sec:methods}. LaTeX fills in the correct number for you.
Click Run to compile and preview the PDF.