I'm writing a document including figures exported from Inkscape (in pdf+latex format). These figures use a figure environment containing all the text labels and a \includegraphics macro that imports the graphical part of the figure from the pdf file.
By default these figures use the same font as the rest of the document, which is too large for my needs. To work it around I have scaled the figure up, and then scaled it down to the original size using \resizebox. This doesn't alter the size of graphics, only the size of font used for rendering text labels, which is perfect.
However, there is one weird glitch that I can't get rid off. All figures are shifted to the right and are slightly smaller than figures included directly (that is, without wrapping with figure environment) in the \resizebox.
Below is a test document exposing this behavior:
\documentclass{article}
\usepackage[pdftex]{graphicx}
\usepackage{color}
\begin{document}
\begin{figure}[!t]
\def\svgwidth{1.5\textwidth}%
\resizebox{\textwidth}{!}{%
\input{testfig.pdf_tex}%
}
\caption{Test with ``figure'' environment.}
\end{figure}
\begin{figure}[!t]
\resizebox{\textwidth}{!}{%
\includegraphics[width=1.5\textwidth]{testfig.pdf}%
}
\caption{Test without ``figure'' environment.}
\end{figure}
\vbox{}
\end{document}
A testfig.pdf_tex file exported from Inkscape (with comments removed):
\begingroup
\makeatletter
\providecommand\color[2][]{%
\errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}
\renewcommand\color[2][]{}%
}
\providecommand\transparent[1]{%
\errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}
\renewcommand\transparent[1]{}%
}
\providecommand\rotatebox[2]{#2}
\ifx\svgwidth\undefined
\setlength{\unitlength}{778.02519531pt}
\else
\setlength{\unitlength}{\svgwidth}
\fi
\global\let\svgwidth\undefined
\makeatother
\begin{picture}(1,0.36433855)%
\put(0,0){\includegraphics[width=\unitlength]{testfig.pdf}}%
\put(0.51462818,0.17761502){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{Some text}}}%
\end{picture}%
\endgroup


!in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the!to turn it into an image again. – Martin Scharrer♦ Jul 13 '11 at 13:47\resizebox*seems to do the exact same thing as\resizebox, unless I'm missing something. Is there any documentation for this macro? The*makes searching for it difficult. – Andrzej Jul 13 '11 at 14:04\resizebox*here. This macro in its normal ans star form is described in thegrfguide. – Martin Scharrer♦ Jul 13 '11 at 14:16