graphics - francois-rozet/sleek-template GitHub Wiki

Graphics

This page explains how to include graphically external documents such as images and graphics.

First of all, it should be noted that it is highly preferable to include vectorial images (especially pdf), to your document.

Commands

\includegraphics[arguments]{path/file.ext}

Where

  • arguments are the style properties added to the image;
  • path is the relative path to the file;
  • ext is its type format extension.

Most image type format (jpg, png, gif, bmp, etc.) are supported by this command. However, it should be noted that, if possible, it is highly preferable to include vectorial images, such as pdf or eps, to your document.

To set the size of the image you can either use the arguments

  • size=x to scale x times the image.
  • width=x\textwidth to set the width of the image relatively to the text width.
  • heigth=x\textheight to set the height of the image relatively to the text height.

x is a number without dimension.

Environments

\begin{figure}[p]
    \centering
    \includegraphics[width=0.5\textwidth]{resources/example.pdf}
    \caption{Here is a caption}
    \label{fig:example}
\end{figure}

Where

  • [p] is the (not-mandatory) positioning of the figure relatively to the page. It can take the values t, b and h, respectively, top, bottom and here. If the chosen position is too restrictive, the program could choose another.
  • \centering centers the image.
  • \caption captions the figure.
  • \label labels the figure for cross-referencing (see cross-referencing).
⚠️ **GitHub.com Fallback** ⚠️