Including an Inkscape drawing in LaTeX

The Inkscape drawing package can export to a large variety of vector drawing formats, including LaTeX. If you save your drawing to a file foo.tex, you can include the file in a LaTeX document as follows.

\documentclass{article}
\usepackage{pstricks}
\begin{document}
Testing Inkscape \LaTeX\ output.

\input{foo.tex}

\end{document}

Of course you could always export the drawing to an image format and include that image the way you’d include any other image. But you also have the option of directly including the content Inkscape output in your LaTeX file rather than referencing it as an external file using the input statement. This makes your LaTeX file self-contained and is something you could not do, for example, with a PNG file.

Two notes:

  1. You must use the pstricks package.
  2. You must compile the file with latex and not pdflatex. To create a PDF file, you must first compile to PostScript.

The next post is a sort of opposite of this one. It explains how to use LaTeX inside an Inkscape drawing.

One thought on “Including an Inkscape drawing in LaTeX

Comments are closed.