summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/fitbox/sample.tex
blob: ea8c2b60ad30e51281ad9f4f61c9ec71a499011f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
\documentclass{article}
\usepackage{graphicx}
\usepackage{fitbox}
\begin{document}

We start from an image at maximal size:

{\centering\fitbox{\includegraphics{vitruvian}}\par}

Now it is resized.  Here we allow down to 50\% of scale:

{\centering\fitbox[minheight=0.5\fitboxnatheight,
  minwidth=0.5\fitboxnatwidth]{\includegraphics{vitruvian}}\par}




Now we make the figure smaller:

{\centering\fitbox[maxwidth=\fitboxnatwidth, 
  maxheight=\fitboxnatwidth]{\includegraphics{vitruvian}}\par}

{\centering\fitbox[maxwidth=\fitboxnatwidth, 
  maxheight=\fitboxnatwidth]{\includegraphics{vitruvian}}\par}



We leave some space, so the full size figure would not fit anymore:

{\centering\fitbox{\includegraphics{vitruvian}}\par}

The figure is now on the next page.  Let us leave some space under the
next figure:

{\centering\fitbox[minheight=0.5\fitboxnatheight,
  minwidth=0.5\fitboxnatwidth, 
  belowboxspace=\baselineskip]{\includegraphics{vitruvian}}\par}
We left some space for a caption.

\end{document}