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:




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

  • 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

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

\includegraphics[height=\dimexpr \textheight - 4\baselineskip\relax]{myfig}

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.

| improve this answer | |
\caption{The SAP data model based on an UML class diagram: classes and relationships.}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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