Labels, Cross-References, and Hyperlinks
Name sections, equations, figures, and tables with \label, then refer to them with \ref or \pageref. Loading hyperref turns contents entries and cross-references into clickable links.
EasyLaTeX compiler setting: pdfLaTeX; load hyperref. After adding or moving labels, compile in EasyLaTeX and wait for the complete job.
Adding Labels
Place labels immediately after the command that establishes the number, or inside the numbered environment:
\section{Experimental Method}\label{sec:method}
\begin{table}
\caption{Experimental Parameters}\label{tab:parameters}
...
\end{table}
Labels are internal to the document and do not appear in the PDF. Every label must be unique.
Referring to Numbers and Pages
See Section \ref{sec:method}; see Table \ref{tab:parameters} (page \pageref{tab:parameters} ).
\ref prints the object's number; \pageref prints its page. Numbers follow document order and update after sections or floats move.
Enabling Clickable Links
Load hyperref in the preamble, usually after most other packages:
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
Link colors affect presentation only. Follow the configuration provided by your institution's or journal's template when applicable. Use \url for a URL and \href for a link with custom text:
\url{https://www.latex-project.org/}
\href{https://www.latex-project.org/}{LaTeX Project}
Automatic Reference Names
hyperref provides \autoref, which adds names such as “section” or “figure” according to the label type:
See \autoref{sec:method} and \autoref{tab:parameters}.
The package and document class determine the names. If a template requires specific wording, writing “Section \ref” explicitly gives you more control.
Label Placement and Naming
Place a label after \caption, inside an equation environment, or immediately after a heading command:
\caption{Results}\label{fig:result}
Use type prefixes such as sec:, fig:, tab:, eq:, and lst:. Do not include numbers that may change in label names, and remember to rename labels when copying content.
Common Problems
References Display ??
Compile the complete main file in EasyLaTeX and wait for the job to finish. The platform handles the passes needed for references. If ?? remains, check label spelling, duplicate names, placement, and the first log error.
A Reference Points to the Wrong Object
In a float, put \label after \caption. For equations, put it inside equation or align so it does not attach to an earlier counter.
Link or Bookmark Warnings from hyperref
Avoid complex math commands or non-expandable content directly in headings. Supply a simpler alternative when necessary: \section[Short title]{Long title containing a formula}. For different PDF bookmark text, use \texorpdfstring{TeX text}{PDF text}.
Complete Example
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
\begin{document}
\tableofcontents
\section{Experimental Method}\label{sec:method}
This section describes the method.
\begin{equation}
E = mc^2
\label{eq:mass-energy}
\end{equation}
Equation \eqref{eq:mass-energy} is on page \pageref{eq:mass-energy}; for the method, see \autoref{sec:method}.
\end{document}