Debian Codegraph @

texmf-dist/doc/latex/floatrow/frsample01.tex

raw
1 %sample file
2 %all possible combinations of predefined floatrow styles
3 %plain environments and float rows
4 %caption above/below float object
5 \documentclass{book}
6
7 \usepackage[footskip=4pt,objectset=centering]{floatrow}
8
9 %load caption
10 \usepackage[font=small,labelfont=bf,labelsep=period,
11 justification=justified,singlelinecheck=no]{caption}[2004/11/28]
12
13 \providecommand*{\com}[1]{\texttt{\char`\\#1}}
14
15 %%%try with fancy shadowbox frame
16 %%%there is the trick: base boxed and BOXED styles changed to use shadowbox frame
17 %\usepackage{fr-fancy}
18 %\DeclareFloatStyle{boxed}{capposition=bottom,captionskip=2pt,
19 % framestyle=shadowbox,heightadjust=object,framearound=object}
20 %\DeclareFloatStyle{BOXED}{capposition=bottom,framestyle=shadowbox,
21 % framefit=yes,heightadjust=all,framearound=all}
22
23 \setlength\textfloatsep{8ptplus2ptminus2pt}
24 \setlength\intextsep{8ptplus2ptminus2pt}
25 \advance\textheight2in
26 \advance\topmargin-.75in
27 \hbadness2000
28 \advance\textwidth.5in
29 \advance\evensidemargin-.25in
30 \advance\oddsidemargin-.25in
31
32 \begin{document}
33 \chapter{Float Boxes with Foots: Variants of Layout}
34
35 In this sample file are gathered plain float environments and float rows
36 with usage of all predefined base float styles. You may try to run this document
37 with \texttt{shadowbox} frame: uncomment line with \verb|\usepackage{fr-fancy}|
38 at the preamble and lines below.
39
40 The default vertical alignment of float objects is centered.
41 To change alignment to top edge you may say:
42 \begin{verbatim}
43 \floatsetup{valign=t}
44 \end{verbatim}
45 like in current sample.
46 Keys are analogous to option of vertical alignment in minipage and \verb|\parbox|:
47 \texttt{t}---for top alignment, \texttt{c}---for center alignment,
48 \texttt{b}---for bottom alignment, and \texttt{s}---to stretch float object material
49 to full height.
50
51 \emph{Note}. All float styles with frames get \verb|frameset={\fboxsep7.5pt}|
52 to get more visible differences between fitted and non-fitted frames.
53
54 %%%aligns float objects by top
55 \floatsetup{valign=t}
56
57 \newcommand\PICTURE[4]{\begin{picture}(#1,#2)
58 \put(0,0){\line(#3,#4){#1}}\put(0,0){\line(1,0){#1}}\put(0,0){\line(0,1){#2}}
59 \put(0,#2){\line(#3,-#4){#1}}\put(0,#2){\line(1,0){#1}}
60 \put(#1,0){\line(0,1){#2}}
61 \end{picture}}
62 \newcommand\FIGS[5][]{
63 \clearpage
64 \markboth
65 {{\small Variant #3: \texttt{style=#2,capposition=#4,footposition=#5}}}
66 {{\small Variant #3: \texttt{style=#2,capposition=#4,footposition=#5}}}
67
68 \noindent Var.\,#3: \protect\com{floatsetup}\texttt{\{style=#2,\allowbreak capposition=#4,\allowbreak
69 footposition=#5\}}
70
71 \clearfloatsetup{figure}
72 \floatsetup[figure]{style=#2,capposition=#4,footposition=#5#1
73 %%%you may try to create row with usage of predefined height uncomment next line
74 %%%and [150] few lines below
75 %,heightadjust=all
76 }
77 \begingroup\samepage
78 \begin{figure}[H]
79 {\PICTURE{20}{20}11}%
80 \caption{%
81 Plain figure in \texttt{#2} style. Caption position \texttt{#4}}%
82 \label{fig:plain:#3}%
83 \floatfoot{\sloppy Much more, more and more and more and more and more and more and more text inside macro
84 \protect\com{floatfoot}}%
85 \end{figure}
86
87 \medskip
88 \strut\vrule
89 \medskip
90
91 \begin{figure}[H]
92 \begin{floatrow}[3]
93 \floatbox{figure}
94 {\caption{Beside figure in float row, ``column'' width. And more text\protect\footnote{\texttt{footpos=#5}}}}
95 {\PICTURE{20}{20}11%
96 \floatfoot{\sloppy Text inside \protect\com{floatfoot}}%
97 \label{figI:#2:row:#3}}
98
99 \floatbox{figure}[\FBwidth]
100 {\caption{Beside figure, graphic width\strut}\label{figII:#2:row:#3}}
101 {\PICTURE{96}{48}21%
102 \floatfoot{\sloppy More and more text inside the \protect\com{floatfoot}}}
103
104 %%%you may try to create float rows with usage of predefined height - uncomment [150pt]
105 %%%and key heightadjust in \floatsetup few lines above
106 \floatbox{figure}[\Xhsize]%[150pt]
107 {\caption{Beside figure in float row. Float row in \texttt{#2} style, caption \texttt{#4}}}
108 {\PICTURE{35}{35}11%
109 \floatfoot{\sloppy Much more, more and more, more and more text inside \protect\com{floatfoot}}%
110 \label{figIII:#2:row:#3}}
111 \end{floatrow}
112 \end{figure}
113
114 \medskip
115 \strut\vrule
116 \medskip
117
118 \captionof{figure}{Alone caption inside \protect\com{captionof}}
119
120 \medskip
121 \strut\vrule
122 \medskip
123
124 \captionof*{figure}{Alone starred caption inside \protect\com{captionof*}}
125
126 \medskip
127 \strut\vrule
128 \medskip
129
130 \floatbox{figure}{}{\caption{Alone caption inside \protect\com{floatbox}. Float row in \texttt{#2} style, caption \texttt{#4}. The next goes alone graphics inside \protect\com{floatbox}. The last goes row of the alone graphics}}
131
132 \medskip
133 \strut\vrule
134 \medskip
135
136 \floatbox{figure}{\PICTURE{35}{35}11}{}
137
138 \medskip
139 \strut\vrule
140 \medskip
141
142 \begin{figure}[H]
143 \begin{floatrow}[3]
144 \floatbox{figure}
145 {}
146 {\PICTURE{20}{20}11}
147
148 \floatbox{figure}[\FBwidth]
149 {}
150 {\PICTURE{96}{48}21}
151
152 \floatbox{figure}[\Xhsize]%[150pt]
153 {}
154 {\PICTURE{35}{35}11}
155 \end{floatrow}
156 \end{figure}
157
158 \endgroup}
159
160 \clearpage\raggedright
161 %
162 \FIGS[,frameset={\fboxsep7.5pt}]{BOXED}{I}{TOP}{caption}
163 \FIGS[,frameset={\fboxsep7.5pt}]{BOXED}{II}{bottom}{caption}
164
165 \FIGS{Ruled}{III}{TOP}{caption}
166 \FIGS{Ruled}{IV}{bottom}{caption}
167
168 \FIGS[,frameset={\fboxsep7.5pt}]{Boxed}{V}{TOP}{caption}
169 \FIGS[,frameset={\fboxsep7.5pt}]{Boxed}{VI}{bottom}{caption}
170
171 %
172 \FIGS[,frameset={\fboxsep7.5pt}]{BOXED}{VII}{TOP}{default}
173 \FIGS[,frameset={\fboxsep7.5pt}]{BOXED}{VIII}{bottom}{default}
174
175 \FIGS{Ruled}{IX}{TOP}{default}
176 \FIGS{Ruled}{X}{bottom}{default}
177
178 \FIGS[,frameset={\fboxsep7.5pt}]{Boxed}{XI}{TOP}{default}
179 \FIGS[,frameset={\fboxsep7.5pt}]{Boxed}{XII}{bottom}{default}
180
181 %
182 \FIGS[,frameset={\fboxsep7.5pt}]{BOXED}{XIII}{TOP}{bottom}
183 \FIGS{Ruled}{XIV}{TOP}{bottom}
184
185 \FIGS[,frameset={\fboxsep7.5pt}]{Boxed}{XV}{TOP}{bottom}
186
187 \clearpage
188 \textbf{The next variants (XVI--XXI) show layout of framed styles
189 with key \texttt{framefit=no}; \texttt{boxed} style (native style of \textsf{float} package),
190 and \texttt{BOXED} with added key \texttt{framefit=no}.}
191 \vfill\vbox{}\vfill
192
193 \floatsetup{floatrowsep=qquad}
194 \clearpage
195 \FIGS[,frameset={\fboxsep7.5pt}]{boxed}{XVI}{TOP}{caption}
196 \FIGS[,framefit=no,frameset={\fboxsep7.5pt}]{BOXED}{XVII}{TOP}{caption}
197
198 \FIGS[,frameset={\fboxsep7.5pt}]{boxed}{XVIII}{TOP}{default}
199 \FIGS[,framefit=no,frameset={\fboxsep7.5pt}]{BOXED}{XIX}{TOP}{default}
200
201 \FIGS[,frameset={\fboxsep7.5pt}]{boxed}{XX}{TOP}{bottom}
202 \FIGS[,framefit=no,frameset={\fboxsep7.5pt}]{BOXED}{XXI}{TOP}{bottom}
203
204 \FIGS{plain}{XXII}{TOP}{caption}
205 \FIGS{plain}{XXIII}{bottom}{caption}
206
207 \FIGS{plain}{XXIV}{TOP}{default}
208 \FIGS{plain}{XXV}{bottom}{default}
209
210 \FIGS{plain}{XXVI}{TOP}{bottom}
211
212 \end{document}