4

I am trying to use the adjustbox package. When I use the adjustbox command inside a \ffigbox (floatrow package) it works fine. Now I wanted to use it inside a figure environment. Therfore I used the following code:

\begin{figure}
\centering
\adjustbox{max width=\linewidth}{\include{images/plot/associativity}}
%\include{images/plot/associativity}
\caption{Associativity compared to execution time}\label{fig:intro:associativity}
\floatfoot{Matrix multiplication on the \emph{leon3}, normalized by longest execution time. Lower is better. There is no optimal solution across all problem sizes}
\end{figure}

Latex gives me the following error if I use the \adjustbox line, and works fine if I use the pure include:

Extra }, or forgotten \endgroup \end{figure}

Since my MWE turned out to actually contian an error, but I think the parantheses in this adjustbox line are balanced, I have an issue, I am tryuing to build a new (non working) MWE

MWE:

\documentclass{report}
\usepackage{tikz}
\usepackage{adjustbox}      
\usepackage{filecontents}

\begin{document}
\begin{filecontents}{asso.tex}
\begin{tikzpicture}

\end{tikzpicture}
\end{filecontents}

\begin{figure}
\centering
\adjustbox{max width=\linewidth}{\include{asso}}
%\include{asso}
\end{figure}
\end{document}
ted
  • 3,377
  • 1
    You have an extra }, just like the error says in the \adjustbox line. End it with two }} rather than }}}. – Werner Jul 24 '13 at 20:47
  • 4
    This question appears to be off-topic because it is about a typing error – egreg Jul 24 '13 at 20:48
  • give me a sec guzs, I checked for the brace in my main document quite a few times and thought i had it right. I am just checking if I made a mistake putting together the mwe, or I have an actual problem. – ted Jul 24 '13 at 20:51
  • @egreg I am trying to get a proper MWE, but either I am to tired or I have the wrong MWE. – ted Jul 24 '13 at 21:04
  • 1
    Using \include inside \adjustbox is asking for troubles. Use \include only for big chunks like chapters (and it's not so useful as it was in the past); it should be \input. – egreg Jul 24 '13 at 21:04
  • @egreg: thanks for your eagle eye, it fixed it. I went on to learn about include vs input. – ted Jul 24 '13 at 21:16
  • @ted: Yes, \include is the problem, since it issues a \clearpage... Does using \input solve your problem? – Werner Jul 24 '13 at 21:19
  • @Werner: yes it does (see comment just above yours). – ted Jul 24 '13 at 21:26

1 Answers1

4

\include is the wrong command to use; it should be reserved to big chunks of text, such as chapters. See When should I use \input vs. \include? for more information.

egreg
  • 1,121,712