Chapter 6, Cross-Referencing

Contents:


Cross-referencing

\documentclass{book}
\begin{document}
\chapter{Statistics}
\section{Most used packages on arXiv.org}\label{sec:packages}
The Top Five packages, used on arXiv.org\footnote{according
to the arXMLiv project\label{fn:project}}:
\begin{enumerate}
  \item graphicx
  \item amssymb \label{item:amssymb}
  \item amsmath \label{item:amsmath}
  \item epsfig
  \item amsfonts
\end{enumerate}
\chapter{Mathematics}
\emph{amsmath}, on position \ref{item:amsmath} of the top list
in section~\ref{sec:packages} on page~\pageref{sec:packages},
is indispensable to high-quality mathematical typesetting in
\LaTeX. \emph{amssymb}, on position \ref{item:amssymb},
provides a huge amount of math symbols.
See also the footnote on page~\pageref{fn:project}.
\end{document}
Cross-referencing

Cross-referencing, after second compiling run

Cross-referencing, after second compiling run

Referring to a page

\documentclass{book}
\begin{document}
\chapter{Statistics}
\section{Introduction}
\newpage
\section{Most used packages on arXiv.org}\label{sec:packages}
The Top Five packages, used on arXiv.org\footnote{according
to the arXMLiv project\label{fn:project}}:
\begin{enumerate}
  \item graphicx
  \item amssymb \label{item:amssymb}
  \item amsmath \label{item:amsmath}
  \item epsfig
  \item amsfonts
\end{enumerate}
\chapter{Mathematics}
\emph{amsmath}, on position \ref{item:amsmath} of the top list
in section~\ref{sec:packages} on page~\pageref{sec:packages},
is indispensable to high-quality mathematical typesetting in
\LaTeX. \emph{amssymb}, on position \ref{item:amssymb},
provides a huge amount of math symbols.
See also the footnote on page~\pageref{fn:project}.
\end{document}
Referring to a page

Variable page references

\documentclass{book}
\usepackage{varioref}
\begin{document}
\chapter{Statistics}
\section{Introduction}
\newpage
\section{Most used packages on arXiv.org}\label{sec:packages}
The Top Five packages, used on arXiv.org\footnote{according
to the arXMLiv project\label{fn:project}}:
\begin{enumerate}
  \item graphicx
  \item amssymb \label{item:amssymb}
  \item amsmath \label{item:amsmath}
  \item epsfig
  \item amsfonts
\end{enumerate}
\chapter{Mathematics}
\emph{amsmath}, on position \ref{item:amsmath} of the top list
in section~\vref{sec:packages}, is indispensable to
high-quality mathematical typesetting in \LaTeX.
\emph{amssymb}, on position \ref{item:amssymb}, provides a
huge amount of math symbols. See also the footnote
\vpageref{fn:project}.
\end{document}
Variable page references

Clever referencing

\documentclass{book}
\usepackage{cleveref}
\crefname{enumi}{position}{positions}
\begin{document}
\chapter{Statistics}\label{stats}
\section{Most used packages on arXiv.org}\label{packages}
The Top Five packages, used on arXiv.org\footnote{according
to the arXMLiv project\label{project}}:
\begin{enumerate}
  \item graphicx
  \item amssymb \label{amssymb}
  \item amsmath \label{amsmath}
  \item epsfig
  \item amsfonts
\end{enumerate}
\begin{table}[tp]
  \centering
  (Identify obsolete packages on CTAN)
  \caption{Obsolete packages}\label{obsolete}
\end{table}
\chapter{Mathematics}
\emph{amsmath}, on \cref{amsmath} of the top list in
\cref{packages} of \cref{stats}, is indispensable to
high-quality mathematical typesetting in \LaTeX.
\emph{amssymb}, on \cref{amssymb}, provides a huge
amount of math symbols. \Cref{obsolete} shows obsolete and
outdated packages that should be avoided. See also the
\cref{project}.
\end{document}
Clever referencing

Back to the list of contents

Leave a Reply

Required fields are marked *