1

I am trying to include some gnuplot-generated figures using the epslatex terminal, which creates an .eps file and a .tex file. The way to include these figures in the document is writing

\include{./figure}

These files include all the commands that set the tics, the legend and so on. My question is: is it possible to change the size of the whole set of elements included in figure.tex without modifying that file?

Something like this:

\resizebox{\linewidth}{!}{
\begin{figure}
    \include{./presion_posicion2}
    \caption{Diagrama presión-posición para el ensayo 2}
    \label{fig:ensayo2}
\end{figure}
}
LaRiFaRi
  • 43,807

1 Answers1

1

it should be \input instead of \include and the other way round with \resizebox:

\begin{figure}
\resizebox{\linewidth}{!}{\input{./presion_posicion2}}
    \caption{Diagrama presión-posición para el ensayo 2}
    \label{fig:ensayo2}
\end{figure}

You can everything define inside the figure environment, it will be valid for the code of \input

  • @Herbert, which one do you prefer \scalebox or \resizebox ? – Display Name Dec 26 '10 at 15:41
  • 1
    @xport: \scalebox only when I have a lot of images and want all scale down by the same factor and no one is wider than \linewidth. When I need some images as wide as the linewidth or part of it, then \resizebox is the better choice. –  Dec 26 '10 at 15:59
  • @Herbert, thank you for this tip of the day. – Display Name Dec 26 '10 at 16:05
  • @Herbert, may I also ask why should be \input instead? I read this http://tex.stackexchange.com/questions/246/when-should-i-use-input-vs-include/250#250 but I didn't see the point – astrojuanlu Dec 26 '10 at 20:50
  • Anyway, thank you for your answer. It worked! – astrojuanlu Dec 26 '10 at 20:51
  • @Juanlu001: \include starts with a new page, which is useful for chapters in books and has its own auxiliary file. It also cannot be nested. \input can be used in the preamble and elsewhere and be nested because it does nothing else then replacing itself with the code of the given file name. –  Dec 26 '10 at 21:00