Let
X
Lesson 8 of 8

Cross-Referencing, Footnotes, and Finishing Your Document

~9 min read

By the end of this lesson you can cross-reference any numbered element, add footnotes and clickable links, find the right packages, and debug common errors. This ties together everything into a complete, polished document.

Cross-references with \label and \ref

Attach a \label{key} to any numbered element — section, figure, table, equation — then reference its number anywhere with \ref{key} and its page with \pageref{key}. Numbers update automatically when you reorder content.

\section{Method}\label{sec:method}
% ...
As described in Section~\ref{sec:method} on
page~\pageref{sec:method}, the approach is...

Use a prefix convention so keys stay readable: sec: for sections, fig: for figures, tab: for tables, eq: for equations.

Smart references with cleveref

Load \usepackage{cleveref} and use \cref{key} — it writes the word for you (“Figure 3”, “Section 2”) and even handles ranges and lists of references.

Footnotes

LaTeX is a typesetting system\footnote{Built on
Donald Knuth's TeX.} used widely in academia.

Hyperlinks and PDF metadata

Load \usepackage{hyperref} (usually last) to make the table of contents, citations, and references clickable, and to add external links:

\usepackage{hyperref}
% ...
Visit \href{https://letx.app}{LetX} to try it online.
Plain URL: \url{https://letx.app}

Finding and using packages

Packages extend LaTeX. Load them in the preamble with \usepackage{name}. A few you will reach for often:

PackageAdds
amsmathAdvanced math environments
graphicxImages via \includegraphics
booktabsProfessional table rules
hyperrefClickable links and bookmarks
geometryPage margins and size
xcolorColored text and backgrounds

Debugging common errors

  • Read the first error. Later errors are often knock-on effects of the first.
  • It names a line. The log shows l.42 — the real mistake is at or just before it.
  • Undefined control sequence? A typo or a missing \usepackage.
  • Missing $ inserted? A math character (_, ^) used in normal text.
  • Still stuck? Comment out half the document to isolate the offending block.

See the Common LaTeX Problems reference for fixes to specific errors.

You did it

You now have the full toolkit: structure, formatting, math, figures, tables, references, and finishing. The best way to cement it is to build a real document — open a template on LetX and start writing.

Frequently asked questions

My \ref shows ?? — how do I fix it?

References resolve from the previous compile’s .aux file, so compile twice. Also make sure each \ref has a matching \label. On LetX the multi-pass build runs automatically.

Where should hyperref go in the preamble?

Load hyperref last (or nearly last). It redefines many commands, so loading it after other packages avoids conflicts; cleveref is one of the few that should come after hyperref.

How do I find the right package for something?

Search the feature plus “latex package”, or browse CTAN (the Comprehensive TeX Archive Network). Common needs are covered by amsmath, graphicx, booktabs, hyperref, and geometry.