diff --git a/images/birb.png b/images/birb.png new file mode 100644 index 0000000..7f52366 Binary files /dev/null and b/images/birb.png differ diff --git a/images/seahorse.png b/images/seahorse.png new file mode 100644 index 0000000..91a58bc Binary files /dev/null and b/images/seahorse.png differ diff --git a/lbol.tex b/lbol.tex index dbd1ceb..b8f0ad5 100644 --- a/lbol.tex +++ b/lbol.tex @@ -1379,6 +1379,63 @@ You can also specify absolute paths to your files. For example, on a Windows sys \graphicspath{ {/home/user/latex/images/} } \end{Verbatim} +\section{Adding and Scaling an Image} + +To include an image, use the \texttt{includgraphics} command: + +\begin{Verbatim}[] +\includegraphics{birb} +\end{Verbatim} + +\noindent{}which includes our ``birb'' picture: + +\includegraphics{birb} + +A couple of things to note: First, because of our \texttt{graphicspath}, this file could be located either in \texttt{images} or \texttt{standalone/build}. Second, we did not need to specify the file extension. + +We can also scale the image by using a \texttt{scale} option, where 1 is equivalent to 100%: + +\begin{Verbatim}[] +\includegraphics[scale=0.5]{birb} +\includegraphics[scale=0.9]{birb} +\includegraphics[scale=1.5]{birb} +\end{Verbatim} + +\includegraphics[scale=0.5]{birb} +\includegraphics[scale=0.9]{birb} +\includegraphics[scale=1.5]{birb} + +While it may be tempting to start with a huge image and simply scale it down, the entire image will be included in the final pdf document and can greatly increase its size. If you intend to distribute your document electronically, it helps to scale your image as close as possible to the size you actually need before including it in your file. + +Note that images act like words—they neither float, and follow each other on the same line. This means that we could use something like this \Verb+\includegraphics[sca+ \Verb+le=1]{seahorse}+ \includegraphics[scale=1]{seahorse} to include inline graphics. However, this can affect the line spacing in our paragraph, as our ``seahorse'' image shows. We can adjust this a little bit by scaling the image appropriately, as in this example: \includegraphics[scale=0.4]{seahorse}, which I've inserted using \Verb+\includegraphics[scale=0.4]{seahorse}+. + +You can also scale the x and y dimensions separately: + +\begin{Verbatim}[] +\includegraphics[width=0.5\textwidth, height=1cm]{birb} +\end{Verbatim} + +\includegraphics[width=0.5\textwidth, height=1cm]{birb} + +\section{Rotating Images} + +We can also use an \texttt{angle} option to rotate our images: + +\begin{Verbatim}[] +\includegraphics[angle=0]{seahorse} +\includegraphics[angle=90]{seahorse} +\includegraphics[angle=180]{seahorse} +\includegraphics[angle=270]{seahorse} +\includegraphics[angle=360]{seahorse} +\end{Verbatim} + +\includegraphics[angle=0]{seahorse} +\includegraphics[angle=90]{seahorse} +\includegraphics[angle=180]{seahorse} +\includegraphics[angle=270]{seahorse} +\includegraphics[angle=360]{seahorse} + + \chapter{Referencing}\label{ch:referencing}