8

in my document i got:

\begin{figure}[h]
\centering
\def\svgscale{0.5}
\includesvg[svgpath = pictures/]{somefile}
\caption{svg image}
\end{figure}

Which does indeed import the picture, but the pictures size does not change with values like 0.5 or 1.5.

with 0.5 i was expecting a reduction in widht and height of 50%. Is that wrong?

3 Answers3

12

Youre right, this one works quite nice:

\includesvg[width = 200pt, svgpath = pictures/somepicture]

keeps the aspect ratio automatically.

5

The following worked for me:

\includesvg[width=30pt]{images/logo.svg}
lnogueir
  • 159
  • This answer almost identical to one that has already been given. – Roland Apr 28 '21 at 03:38
  • 2
    Yea, except the one already given, didn't work for me. That's why I'm adding this here. The [], {} is what made it work – lnogueir Apr 28 '21 at 03:53
  • The command \includesvg[parameters]{svg filename} works like \includegrpahicx where [] is for parameters and {} is for the filenmame. The filename is essential, it cannot work without it and @James Baker may just have omitted it just because it is not necessary for the answer. svgpath is just when your file is not in your current working directory. The essential part of the answer is \includesvg[width = value pt] which basically is yours too. – Roland Apr 28 '21 at 04:48
1

I used this and it works.

\usepackage{graphicx}
\usepackage{svg}
...
\begin{figure}[h]
\centering
\def\svgscale{0.9}
\includesvg[svgpath = folder/]{fileName.svg}
\end{figure}
konmaz
  • 11