Graphics, Figures & Tablessetting size for epslatex

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mathfeel
Posts: 11
Joined: Fri Jun 13, 2008 1:17 pm

setting size for epslatex

Post by mathfeel »

When I include a eps/latex combo generated by, say, gnuplot or xfig using \input{*} command, how do I set the width analogous to \includegraphic[width=0.8\textwidth]{*}?

I know one way is to edit the \includegraphic line in the generated latex file, but if the same eps/latex combo is to be used in multiple documents with potentially different width (e.g. single column versus two columns), it makes sense to be able to set it in the master document.

Thank,

--MZ

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

setting size for epslatex

Post by php1ic »

Use \resizebox{} around the \input{} to scale the entire figure. The correct font sizes and placements are automatically calculated relative to the size of the drawing. Using the output from xfig as an example

Code: Select all

\begin{figure}[htb]
\centering
\resizebox{1.0\textwidth}{!}{\input{fig.pstex_t}}
\end{figure}
The syntax is \resizebox{width}{height}, in the example the ! keeps the aspect ratio.
Post Reply