% !TEX root = ../manual.tex
% !TEX program = xelatexmk
% !TEX spellcheck = en_GB

\section{Images}
Another thing \LaTeX\ does well is including images. For this the |graphicx| package is required:
\begin{lstlisting}
\usepackage{graphicx}
\end{lstlisting}
An image can be added as follows:
\begin{lstlisting}
\begin{figure}[ht]
	\centering
	\includegraphics[width=.7\linewidth]{logo}
	\caption{This is the Scintilla logo}
	\label{fig:logo}
\end{figure}
\end{lstlisting}
\begin{figure}[ht]
	\centering
	\includegraphics[width=.7\linewidth]{logo}
	\caption{This is the Scintilla logo}
	\label{fig:logo}
\end{figure}

Let's look at all elements:
\begin{multicols}{2}
\begin{lstlisting}
\begin{figure}[ht]
\end{figure}
\end{lstlisting}
\columnbreak
The figure environment, and where to place it. In this case ‘h’ (here) ‘t’ (top). This isn’t required to include an image, but is required if you want to label it.
\end{multicols}
\begin{multicols}{2}
\begin{lstlisting}
\centering
\end{lstlisting}
\columnbreak
Center the image and caption.
\end{multicols}
\begin{multicols}{2}
\begin{lstlisting}
\includegraphics[width=.8
\linewidth]{logo}
\end{lstlisting}
\columnbreak
Add the image at .8 of the text width. The file extension is not required.
\end{multicols}
\begin{multicols}{2}
\begin{lstlisting}
\caption{This is the Scintilla logo}
\end{lstlisting}
\columnbreak
The caption with text.
\end{multicols}
\begin{multicols}{2}
\begin{lstlisting}
\label{fig:logo}
\end{lstlisting}
\columnbreak
This makes sure that we can later reference this image.
\end{multicols}

You can set the default width of images by adding the following to your preamble:
\begin{lstlisting}
\setkeys{Gin}{width=\linewidth}
\end{lstlisting}
