In LaTeX you can easily insert pictures. In this practical tip, we will explain how this works.
Insert images in LaTeX
You can insert pictures in LaTeX with just a few lines. To do this, follow the steps below.
- Implement the graphics package using "\ usepackage {graphicx}".
- With the command "\ includegraphics {grafik}" you can implement a graphic. In the curly brackets write the file name of your graphic without the file extension.
- If the image file is not in the same folder as the TEX file, you can navigate upwards with ".. \" or integrate graphics from subfolders with "subfolder / graphics".
- Supported file formats in Pdflatex are PS, EPS, PDF, GIF, JPG, and TIF. In further practical tips, we will show you how you can convert XCF to PNG or JPG, BMP to JPG and SVG to GIF.
- The Figure environment is useful for placing and scaling the graphic in a meaningful manner and for a caption and reference in the body text. We present these to you in the following picture gallery.
- This practical tip shows you how to create an automatic list of figures that lists all inserted images.
Latest videos
With the Graphicx package you can simply insert pictures into your document using the "\ includegraphics" command. If the graphic is in the same order as the TEX file, you only have to write the file name without the file extension in curly brackets. However, the result looks modest. If you want to include it in the body text, place it, scale it, center it, label it, and reference it, you need additional commands.
If you enter the paper size in the document class (line 1), you can better estimate how many centimeters or percent of the page width your image should have. With the German language package from Babel (line 3), your images are automatically referred to as "image" instead of "figure". If you want a different name, you can change it with the caption package (line 5).
The Figure environment (lines 16-27) allows you to place the graphic on the page (lines 17-20), center it (line 21), give it a name for a list of figures and a caption (lines 24-25 ) and define a reference day (line 26). You can also scale the graphic (lines 22-23).
The result is a well-placed graphic with the right size, a caption and an internal reference that always works - even if you move graphics or insert new graphics.