+3 votes
69 views
in Office by (242k points)
reopened
LaTeX: insert pictures - this is how it works

1 Answer

+4 votes
by (1.6m points)
 
Best answer

This is how you integrate a graphic

Would you like to insert an image into your LaTeX document? We'll show you how it works..

image image

A graphic or an image is an important part of many documents. With a few simple commands you can easily insert graphics into your LaTeX document. LaTeX takes care of the correct placement of the graphic for you in the text. You can find out how to insert an image in LaTeX in this tipps + tricks article.

This is how you integrate a graphic

Step 1:

First, add the graphics package to the preamble:

\usepackage{graphicx}

Step 2:

You can now integrate graphics within the document using the command: " File name " must be replaced with the name and path of the graphic. You do not have to specify the file extension of the graphic. If the graphic is not in the same folder as your main document, you will also need to provide the path to where the file is located.

\includegraphics{"Dateiname"}

3rd step:

In the previous step, insert the graphic unformatted at the point where it is also included in your .tex file. However, you are given further options for formatting the graphic. To do this, insert the following environment, including the commands, into your document:

\begin{figure}[h]
\centering
\includegraphics{tippstricks}
\caption{Meine Grafik}
\label{fig:meine-grafik}
\end{figure}

  • With \begin{figure} and \end{figure} you initiate the necessary figure-Umbgebung for the stated below commands.
  • The option [h] tells LaTeX where to place the graphic in the text.
  • In addition, you have the options (h) ere, (t) op, (b) ottom or placement on the next (p) age.
  • \centering tells LaTeX to center the graphic on the page.
  • \includegraphics{tippstricks} behaves analogously to step 2.
  • \caption{Meine Grafik} gives your graphic a label, the correct formatting is automatically generated by LaTeX.
  • Finally, define \label{fig:meine-grafik} a label for your graphic with which you can later reference the graphic in the text.
image

...