LaTex: Figures
Images in LaTex
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\includegraphics[width=\linewidth]{boat.jpg}
\caption{A boat.}
\label{fig:boat1}
\end{figure}
Figure \ref{fig:boat1} shows a boat.
\end{document}
Use \ref to reder to a figure in text
Image Positioning / setting the float
\begin{figure}[h!]
h - same locatio
t - top of page
b - bottom of page
p - on an extra page
! - override
Multiple images/Subfigures
Need package graphicx and subcaption
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.4\linewidth}
\includegraphics[width=linewidth]{image.jpg}
\caption{image.}
\end{subfigure}
\begin{subfigure}[b]{0.4\linewidth}
\includegraphics[width=linewidth]{image.jpg}
\caption{image.}
\end{subfigure}
\caption{images}
\label{fig:images}
\end{figure}