Debian Codegraph @

texmf-dist/doc/latex/fitbox/sample.tex

raw
1 \documentclass{article}
2 \usepackage{graphicx}
3 \usepackage{fitbox}
4 \begin{document}
5
6 We start from an image at maximal size:
7
8 {\centering\fitbox{\includegraphics{vitruvian}}\par}
9
10 Now it is resized. Here we allow down to 50\% of scale:
11
12 {\centering\fitbox[minheight=0.5\fitboxnatheight,
13 minwidth=0.5\fitboxnatwidth]{\includegraphics{vitruvian}}\par}
14
15
16
17
18 Now we make the figure smaller:
19
20 {\centering\fitbox[maxwidth=\fitboxnatwidth,
21 maxheight=\fitboxnatwidth]{\includegraphics{vitruvian}}\par}
22
23 {\centering\fitbox[maxwidth=\fitboxnatwidth,
24 maxheight=\fitboxnatwidth]{\includegraphics{vitruvian}}\par}
25
26
27
28 We leave some space, so the full size figure would not fit anymore:
29
30 {\centering\fitbox{\includegraphics{vitruvian}}\par}
31
32 The figure is now on the next page. Let us leave some space under the
33 next figure:
34
35 {\centering\fitbox[minheight=0.5\fitboxnatheight,
36 minwidth=0.5\fitboxnatwidth,
37 belowboxspace=\baselineskip]{\includegraphics{vitruvian}}\par}
38 We left some space for a caption.
39
40 \end{document}