25. Inserting images

LaTeX provides commands for adding images within text. Parameters allow you to resize the images or scale the images, as well as define placement relative to the margins.

Adding the graphicx package

The graphicx pack­age pro­vid­es a key-value in­ter­face for op­tional ar­gu­ments to the \in­clude­graph­ics com­mand.

Note: Do not use the other graphics package when using graphicx.

Add the graphicx package using the following command:

1
\usepackage{graphicx}

Insert images using includegraphics

Then insert an image within a text flow using includegraphics.

In the following example, the image is resized:

1
\includegraphics[width=10.91cm, height=2.33cm]{images/logo.png}

Note: The file extension can be omitted, but I prefer to keep the entire filename, including the extension.

In this example, the image is resized to the following values;

Alternatively, the image can be scaled.

1
\includegraphics[scale=1.75]{images/logo.png}[-1em]

Note: [-1em] is a positioning element, which moves the image 1em to the left of the defined left margin. This is a page design issue.

You can optionally set the path to graphics using the \graphicspath command:

1
\graphicspath{ {images/} }

Click to continue.