# Specify \svgscale instead of \svgwidth for Inkscape pdf_tex

The image.pdf_tex documents created with Inkscape's PDF+LaTeX export use this code

  \ifx\svgwidth\undefined%
\setlength{\unitlength}{293.02998953bp}%
\ifx\svgscale\undefined%
\relax%
\else%
\setlength{\unitlength}{\unitlength * \real{\svgscale}}%
\fi%
\else%
\setlength{\unitlength}{\svgwidth}%
\fi%


which makes it sound that instead of the usual

\def\svgwidth{15cm}
\input{image.pdf_tex}


you could do something like

\def\svgscale{0.2}
\input{image.pdf_tex}


However, it gives an error in pdflatex's output:

(.image.pdf_tex
! Undefined control sequence.
<argument> \unitlength * \real
{\svgscale }
l.43 ...nitlength}{\unitlength * \real{\svgscale}}
%
?


How can I make this work?

The reason is that I want to include to vector graphic subfigures that have different sizes, but at should be displayed at the same scale.

• the package is using calc package syntax so add \usepackage{calc} to your document. – David Carlisle Aug 30 '17 at 21:30
• Note that changing that one line to \setlength{\unitlength}{\svgscale\unitlength}% seems to work, but since this is an autogenerated document it doesn't feel like the right way? – Laurenz Aug 30 '17 at 21:30
• @DavidCarlisle yup, that does the trick! If you add this as an answer I can accept it. – Laurenz Aug 30 '17 at 21:32

The package is using calc package syntax so add
\usepackage{calc}