Adding Images to Your Documents
This article concerns the
See other variants:

You may need to add a graphics file to your LaTeX source. LaTeX provides highly sophisticated ways of achieving that and Texpad supports them in new innovative ways. Live typesetter TexpadTeX will even typeset your document with these images into PDF shown in the in-build viewer live as you type the in the editor.

Required Commands & Packages

To typeset with images in either Texpad iOS and macOS, you must use a graphics package, e.g. graphicx (added to your LaTeX source using the usual \usepackage{graphicx} command, see package documentation on CTAN ). This package provides the command \includegraphics{...} to add an image to your LaTeX source.

So to include an image saved as file my-image.png, we would simply write the following LaTeX code,

A basic example of adding images to your LaTeX document
With Texpad’s live typesetter TexpadTeX, you may or may not specify the file extension .png in the \includegraphics command. Other typesetters such as pdfLaTeX may differ, with standard practice being omitting of the extension.

Where to Save an Image File

The image file my-image.png in the above example would be expected to be residing either in the same directory as the .tex file that includes it, or in a folder that is on the typesetter’s search path.

It is best practice to store all of the includes of a project in the parent folder of the root .tex file, or in a subfolder under the parent folder. This makes the project easy to move as a whole as the paths to these image files can be entered in \includegraphics command relative to the root .tex file. When the project folder moves to a new location, paths of all the image files stay constant as they are relative to the project folder.

The Windows variant of this article will be updated in due course. To try out Texpad for Windows before it is publicly released, please sign up for a beta.