Browse Source

Added information about scaling and rotating images

main
Kenneth John Odle 6 months ago
parent
commit
32f3c96cda
  1. BIN
      images/birb.png
  2. BIN
      images/seahorse.png
  3. 57
      lbol.tex

BIN
images/birb.png

After

Width: 796  |  Height: 736  |  Size: 156 KiB

BIN
images/seahorse.png

After

Width: 395  |  Height: 148  |  Size: 33 KiB

57
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}

Loading…
Cancel
Save