Automated Processing Tool: Cross-Referencing #
Author: Erhua
Keywords: automation tool, table of contents
In this section, we discuss cross-referencing.
Cross-Referencing in a Standard Document #
Cross-referencing consists of two parts: first, the thing to be referenced, and second, the reference itself. This involves defining labels and referencing labels.
Defining a label: at the appropriate location, assign a label (label) to an object (usually one with a number) and give it an identifier.
Referencing a label: in another part of the document, use the defined label to reference the object’s number or title page number.
Note:
Labels are generally used for various automatically numbered objects, most of which are pre-defined commands or environments in LaTeX. Of course, it is also possible to define your own labeled objects.
If the object is generated by a command (such as \section), the label can be placed directly after the command. If it is an environment, it can be placed inside the environment (such as the figure environment and the tabular environment).
Once labels are defined, we can easily refer to them. There are two reference commands:
\ref{label} % Produces the number of the referenced object
\pageref{label} % Produces the page number of the referenced object
\documentclass[]{article}
\usepackage{ctex}
\usepackage{amsmath}
\usepackage[paperwidth = 200mm,paperheight = 150mm]{geometry}
\newCJKfontfamily\qingsong{FZQKBYSJW--GB1-0}
\begin{document}
\qingsong
\section{锦瑟}\label{sec:jinse}
\begin{equation}\label{eq:jifen}
\alpha + \beta = \int^{\infty}_{-\infty}\sum_{i = 1}^{n}a_nx\ \text{d}x
\end{equation}
\begin{figure}[htbp]
\centering
\includegraphics[width = 0.15\textwidth]{111.jpeg}
\caption{小波}\label{fig:xiaobo}
\end{figure}
\section{无题}\label{sec:wuti}
Okay, we have finished the previous section, which is Section \ref{sec:jinse}. Now let's start writing this section, which is Section \ref{sec:wuti}.
First, let's look at Equation \ref{eq:jifen}, which looks nice; then let's look at the next figure, which is Figure \ref{fig:xiaobo}, also very nice.
\end{document}
Other Packages #
\usepackage{nameref} % Get the content of the referenced chapter or heading
\usepackage{hyperref} % Automatically identify whether it is a figure, table, or other referenced item