References
Internal References
If the command \label{} is placed in a numbered environment, then the command \ref{} references it by number.
The same descriptive string is passed to both.
\documentclass[12pt]{article}
\usepackage{hyperref} % For clickable links
\usepackage{amsthm} % For numbered theorems
\newtheorem{theorem}{Theorem}
\begin{document}
\section{First section}\label{sec:first}
Some stuff.
\begin{theorem}\label{thm:a-theorem}
A theorem.
\end{theorem}
\section{Second section}
In Section \ref{sec:first}, some stuff was done.
Theorem \ref{thm:a-theorem} was especially interesting.
\end{document}
Equations are numbered with \begin{equation} and \end{equation} or \begin{align} and \end{align} for aligned equations.
An asterisk * makes them unnumbered, such as in \begin{align*} and \end{align*}.
\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
The equation
\begin{equation}\label{eq:einstein}
E = m \cdot c^2
\end{equation}
is famous.
Equation \ref{eq:einstein} explains the mass defect of atomic nuclei.
\end{document}
External References
External references are in a separate BibTex file.
The extension of a BibTex file is .bib.
In a BibTex file, an entry is denoted by @ with its type and then its information.
Anything outside this environment is a comment.
Google Scholar provides the BibTex format for most references.
Book
@article{feynman2014qed,
title={QED: The strange theory of light and matter},
author={Feynman, Richard P},
year={2014},
publisher={Princeton University Press}
}
Article
@article{vaswani2017attention,
title={Attention is all you need},
author={Vaswani, A},
journal={Advances in Neural Information Processing Systems},
year={2017}
}
Miscellaneous
@misc{enyeart2024latex,
title={Latex Tutorial},
author={Enyeart, Dustin},
year={2024},
url={https://latex-tutorial.readthedocs.io/en/latest/}
}
The package biblatex is for bibliographies.
If the previous code block is in the file refs.bib, then the command \addbibresource{refs.bib} includes these BibTex entries.
They are cited with the command \cite{}.
The bibliography is printed with \printbibliography.
\documentclass[12pt]{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{refs.bib}
\begin{document}
Quantum electrodynamics is cool \cite{feynman2014qed}.
\printbibliography
\end{document}