I'm working on my masters thesis and so I have a bunch of tikz files that I want to include in the thesis. This I do by using adjustbox to limit the size to \textwidth as such
\adjustbox{max width=\textwidth,bgcolor=blue}{\input{test.tikz}}.
Now my problem is that I have created external files containing common draw commands in order to creating multiple UML like diagrams and memory diagrams easier... this however, for some reason, adds padding to the including picture! Why, and what can I do to avoid it?
Example: The test file "test.ext" used in the example only contains 100x5 '%'s so nothing really should be included in the final image?
Code:
\adjustbox{max width=\textwidth,bgcolor=blue}{
\input{test.ext} <-- this causes the problem
\begin{tikzpicture}[]
\draw[fill=blue!20] (0,0) rectangle (3,1);
\end{tikzpicture}
}
Result:
.

%at the end of the lines doing the\inputand starting the\adjustbox. – Roelof Spijker Apr 04 '12 at 14:53adjustbox. The issue are indeed spurious spaces as shown in Torbjørn T.s answer below. This use-case looks also like it could benefit from my other package (and class)standalone. With it you can compile the picture on its own and include it using\includestandalone[<options>]{<filename>}. – Martin Scharrer Apr 04 '12 at 21:33