Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Q] \resizebox for whole figure ?

1,074 views
Skip to first unread message

Stefan A. Deutscher

unread,
Jul 2, 1997, 3:00:00 AM7/2/97
to

Howdy,

I just composed a figure as follows:

\begin{figure}[hbtp] % centered
\psdraft
\begin{minipage}[t]{\linewidth}
\hspace{18bp}
\includegraphics[clip,angle=270,width=0.9707\linewidth]{fig1.ps.gz}
\end{minipage}
\hfill
\begin{minipage}[b]{\linewidth}
\psfull
\centering\includegraphics[clip,height=0.80\linewidth]{fig2.ps.gz}
\end{minipage}
\caption{Some caption.}
%
\end{figure}


which displays fine except it is too long and overlaps the page number.
Getting all the factors / sizing right took a while since fig1.ps is
about 7 MB worth of PostScript which even on a PentiumPro-150 with 64 MB
takes a while in GhostView to display.
Anyway, I had hoped to be able to wrap the whole thing in a

\resizebox{!}{\textheight}{ whole thing }

environment but I get

! LaTeX Error: Not in outer par mode.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.32 }

? x

So -- is there any other way or do I have to bite the bullet and fiddle
with it again? Keith Reckdahl's writeup had me hope it might work, and
my Graphics Companion is at work.

Cheers! Stefan


--
============================================================================
Stefan A. Deutscher | (+1-423-) voice fax
The University of Tennessee, Knoxville | UTK : 974-7838 974-7843
Department of Physics and Astronomy | ORNL : 574-5897 574-1118
401, A. H. Nielsen Building | home : 522-7845 522-7845
Knoxville, T.N. 37996-1200, USA | email: s...@utk.edu
============================================================================
Dictated with OS/2 Warp 4 VoiceType dictation. Using slrn 0.9.3.2 offline.

Keith Reckdahl

unread,
Jul 2, 1997, 3:00:00 AM7/2/97
to

Stefan A. Deutscher <s...@utk.edu> wrote:
> I just composed a figure as follows:
> \begin{figure}[hbtp] % centered
> \psdraft
> \begin{minipage}[t]{\linewidth}
> \hspace{18bp}
> \includegraphics[clip,angle=270,width=0.9707\linewidth]{fig1.ps.gz}
> \end{minipage}
> \hfill
> \begin{minipage}[b]{\linewidth}
> \psfull
> \centering\includegraphics[clip,height=0.80\linewidth]{fig2.ps.gz}
> \end{minipage}
> \caption{Some caption.}
> %
> \end{figure}
>which displays fine except it is too long and overlaps the page number.

As a rule of thumb, a one-line caption takes up about 5% of the
textheight. (This depends on your fontsize and margins, of course).
So I have a single figure I want to fit on a float page, I use

\begin{figure}
\centering
\includegraphics[height=0.95\textheight,
width=\textwidth,keepaspectratio]{file.eps}
\caption{This is the caption}
\end{figure}

When I have two stacked graphics that I want to fit on a float page,
I allocate 5% of the space for the caption, 5% for the space
between the graphics, leaving 45% for each of the two graphics.

\begin{figure}
\centering
\includegraphics[height=0.45\textheight,
width=\textwidth,keepaspectratio]{file1.eps}
\par\vspace{0.05\textheight}
\includegraphics[height=0.45\textheight,
width=\textwidth,keepaspectratio]{file2.eps}
\caption{This is the caption}
\end{figure}

> Anyway, I had hoped to be able to wrap the whole thing in a
> \resizebox{!}{\textheight}{ whole thing }

Since the figure environment must be in outer par mode, you cannot
include the figure in any box. However, you could scale the contents
of the graphics to 0.95\textheight, but this makes the linebreaks
more difficult because the contents of \resizebox are processed in
LR mode. (You probably would want to use \resizebox* to resize the
totalheight.) That would end up something like

\begin{figure}
\centering
\resizebox*{!}{0.95\textheight}{
\begin{tabular}{c}
\includegraphics[clip,angle=270,width=0.9707\linewidth]{fig1.ps.gz}\\
\includegraphics[clip,height=0.80\linewidth]{fig2.ps.gz}
\end{tabular}}
\caption{This is the caption}
\end{figure}

You may want to change \\ to \\[0.05\textheight] to add some space...

Good luck,
Keith

0 new messages