LaTeX: Include and Scale SVG (Scalable Vector Graphics) Image

Here is a step-by-step guide on including and scaling SVG image on LaTeX.

1) Download and install Inkscape: https://inkscape.org/en/download/

2) Suppose, I have an SVG image named image.svg.
Run the following command that exports your SVG image to PDF and LaTeX format.


inkscape -D -z --file=image.svg --export-pdf=image.pdf --export-latex

This will create two new files named image.pdf and image.pdf_tex.

3) Include the image in LaTeX:


\begin{figure}[h]
    \centering    
    \def\svgwidth{\columnwidth}
    \input{images/image.pdf_tex}
    \caption{Your image caption}
    \label{fig:your image label}
\end{figure}

You can see that I have defined \svgwidth which is used for scaling the SVG image. More about Scaling SVG images is written below:

Scaling SVG image

You can scale the image by defining \svgwidth or by including calc package.

You have to define \svgwidth before \input command:


\begin{figure}[h]
    \centering      
    \def\svgwidth{\columnwidth}
    \input{images/image.pdf_tex}    
\end{figure}

If you are using calc package, then you have to include the calc package in the preamble and then define \svgscale.


% include svg package in the preamble
% i.e. before \begin{document}
\usepackage{calc}
...
\begin{document}
...
\begin{figure}[h]
    \centering      
    \def\svgscale{0.5}
    \input{images/image.pdf_tex}    
\end{figure}

More detail can be found here: How to include an SVG image in LaTeX