LaTeX Figures¶
Quick Links
Referencing Figures¶
The example below highlights how the \label
command is used to define a unique label to this specific figure and how it can be referenced within the text of the document using the \ref
command.
\begin{figure}[H]
\centering
\includegraphics[height=1in]{UWL_Logo}
\caption{Figure with Caption}
\label{fig:uwl-logo}
\end{figure}
The UWL logo can be seen in \ref{fig:uwl-logo}.
Also note how the "Figure" prefix is automatically added within the document text whenever the reference is called.
Referencing Sub-Figures¶
The example below highlights how the \ref
command operates exactly the same on subfigure
as it does on figure
environment.
\begin{figure}[H]
\begin{subfigure}[b]{0.5\textwidth}
\centering
\includegraphics[height=1in]{UWL_Logo}
\caption{UWL Logo}
\label{fig:uwl-logo}
\end{subfigure}%
\begin{subfigure}[b]{0.5\textwidth}
\centering
\includegraphics[height=1in]{Artemis_Logo}
\caption{Artemis Logo}
\label{fig:artemis-logo}
\end{subfigure}%
\caption{Sub-Figures with Sub-Captions}
\label{fig:uwl-and-artemis-logos}
\end{figure}
The logos used in this document can be found in \ref{fig:uwl-and-artemis-logos}.
\ref{fig:uwl-logo} displays the UWL logo and \ref{fig:artemis-logo} displays the Artemis logo.
Referencing Range of Figures¶
The example below highlights how the \refrange
command can be used to reference a range of figures.
\begin{minipage}[c]{0.33\textwidth}
\begin{figure}[H]
\centering
\includegraphics[height=1in]{UWL_Logo}
\caption{UWL Logo}
\label{fig:uwl-logo}
\end{figure}
\end{minipage}%
\begin{minipage}[c]{0.33\textwidth}
\begin{figure}[H]
\centering
\includegraphics[height=1in]{Artemis_Logo}
\caption{Artemis Logo}
\label{fig:artemis-logo}
\end{figure}
\end{minipage}
\begin{minipage}[c]{0.33\textwidth}
\begin{figure}[H]
\centering
\includegraphics[height=1in]{Orion_Logo}
\caption{Orion Logo}
\label{fig:orion-logo}
\end{figure}
\end{minipage}
\vspace{\baselineskip}
We can reference a range of figures as seen here: \refrange{fig:uwl-logo}{fig:orion-logo}.
Also note how the "Figures" prefix is automatically added within the document text whenever the range reference is called.