1

I'm using the classic thesis style by André Miede. As I have to import a lot of Matlab plots, I'm using matlab2tikz.

In the LaTeX document, I want the TikZ object to act like a normal jpg/png included by \includegraphicx.

When I include the TikZ object with

\begin{figure} 
\input{thetikzfile.tex} % <thetikzfile> contains \begin{tikz} etc.
\end{figure}

it is not properly aligned to the text, which would be the case if I had inserted a jpg with the command \includegraphicx

enter image description here

I tried to align the TikZ object using \centering; however, I still get the same result.

doncherry
  • 54,637
Matthaeus
  • 111
  • 2
    Welcome to TeX.sx! If I am correct in assuming that your thetikzfile.tex file consists only of your tikzpicture environment, \include is not the appropriate command to use here; try \input instead. See this. – jub0bs Apr 09 '13 at 11:03
  • 1
    Have you tried input instead of include? I use the former all the time and it works perfectly. – Anke Apr 09 '13 at 11:04
  • I've edited the code. I did actually use \input. – Matthaeus Apr 09 '13 at 15:02
  • Can you describe how it is mis-aligned? Not centered? Have you tried to use a bounding box in your TikZ code? – Herr K. Apr 09 '13 at 15:12
  • @KevinC I've uploaded an example on imgur.link

    I haven't modified the tikzpicture, which I got from the matlab2tikz function, at all. I'll have a try when I'm back at home.

    – Matthaeus Apr 09 '13 at 15:25
  • @Matthaeus: It seems like an issue with classicthesis. I have no problem getting the correct alignment if the classicthesis package is not used. This post might be relevant Figures and margins in classicthesis. Some preliminary trial on my part has not been successful, however. – Herr K. Apr 09 '13 at 22:15
  • I've found the error: I scaled the the tikzpicture by setting the axis to \textwidth, whereas I should have scaled the tikzpicture to \textwidth – Matthaeus Apr 11 '13 at 11:30

0 Answers0