Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm relatively new to LaTeX and trying to come to grips with it. I understand I can resize a figure to fit the column width or text height quite easily:

\includegraphics[width=1\columnwidth]...

or

\includegraphics[height=.1\textheight]...

I was wondering if there is an easy way to get a figure and its caption to fit in a page.

share|improve this question
    
Welcome to TeX.sx! –  egreg Dec 21 '12 at 16:06
    
Do you only want to scale the figure or do you want to scale the font size of the caption too? –  jonalv Dec 21 '12 at 16:09
1  
if the figure itself is fit to the \textheight, there won't be enough space for the caption. nonetheless, if you put it into a float -- \begin{figure][p] -- it will stay together, but you will get a complaint that it's too large. you might try to apply a scaling factor, e.g. [scale=.8], instead of the height or width to get it to an acceptable size. –  barbara beeton Dec 21 '12 at 16:09

2 Answers 2

Generally it's better really to design the figure to fit (or scale by a fixed amount) scaling arbitrary sized figures to fit the page means that each scales by a different amount so you get inconsistent font sizes in each figure.

However for when you need it you can go

\begin{figure}[p]
\includegraphics[height=\dimexpr \textheight - 4\baselineskip\relax]{myfig}
\caption{zzzz}
\end{figure}

assuming 4 lines worth of space is enough for your caption and its surrounding space. Using [p] as clearly it can not fit on a text page if it is that big.

share|improve this answer
\begin{figure*}[tb] 
\centering
 \makebox[\textwidth]{\includegraphics[width=.9\paperwidth]{./fig/fig5.eps}}
\caption{The SAP data model based on an UML class diagram: classes and relationships.}
\label{fig:Fig5}
\end{figure*}
share|improve this answer
1  
Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  Peter Jansson Jun 13 '13 at 13:13
    
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  zeroth Jun 13 '13 at 13:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.