Debian Codegraph @

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

raw
1 \input pictures
2 %\listfiles
3 \documentclass{book}
4 \advance\textwidth-1in
5 \advance\oddsidemargin.5in
6 \advance\marginparwidth-.75in
7 %\advance\evensidemargin.5in
8 \usepackage{calc,listpen}
9 \usepackage{tabularx,array}
10 \usepackage{floatpagestyle}
11
12 \usepackage{graphicx}
13
14 \usepackage{color}
15 \definecolor{gray}{gray}{.5}
16 \definecolor{emphblue}{rgb}{0,0,0.5}
17 %light
18 %\definecolor{lyellow}{cmyk}{0,0,0.24,0}
19 %\definecolor{lred}{cmyk}{0,0.05,0.3,0}
20 %saturated
21 %\definecolor{lyellow}{cmyk}{0,0,1,0}
22 \definecolor{lyellow}{rgb}{1,1,.6}
23 %\definecolor{lred}{cmyk}{0,0.24,0.84,0}
24 \definecolor{lred}{rgb}{1,.94,.62}
25 \definecolor{lredblack}{cmyk}{0,0.36,0.6,1}
26 \def\emphcolor{\color{emphblue}}
27
28 \usepackage{fancyhdr}\pagestyle{fancy}\fancyfoot{} \fancyhead[LE]{\leavevmode\hspace*{-\marginparwidth}\hskip-\marginparsep
29 \def\arraystretch{1,2}\begin{tabular}{@{}l@{}}
30 \smash{\rlap{\bfseries \large \thepage}}\hskip\marginparwidth\hskip\marginparsep
31 \vrule\hbox to\textwidth{\slshape\leftmark\hfill}\vrule
32 \hskip\marginparwidth\hskip\marginparsep\smash{\llap{\bfseries \large \thepage}}
33 \\ \hline
34 \end{tabular}\hskip-\marginparsep\hspace*{-\marginparwidth}}
35 \fancyhead[LO]{\leavevmode\hspace*{-\marginparwidth}\hskip-\marginparsep
36 \def\arraystretch{1,2}\begin{tabular}{@{}l@{}}
37 \smash{\rlap{\bfseries \large \thepage}}\hskip\marginparwidth\hskip\marginparsep
38 \vrule\hbox to\textwidth{\hfill\slshape\rightmark}\vrule
39 \hskip\marginparwidth\hskip\marginparsep\smash{\llap{\bfseries \large \thepage}}
40 \\ \hline
41 \end{tabular}\hskip-\marginparsep\hspace*{-\marginparwidth}}
42 \fancyhead[RE]{}\fancyhead[CE]{}
43 \fancyhead[RO]{}\fancyhead[CO]{}
44 \renewcommand\headrulewidth{0pt}
45 \fancyheadoffset[LE,RO]{0pt}
46 \fancyheadoffset[RE,LO]{0pt}
47 \fancyheadoffset{0pt}
48
49 \usepackage[font={small,color=lredblack},labelfont=bf,labelsep=period,
50 singlelinecheck=no]{caption}[2004/11/28]
51 \captionsetup[floatfoot]{font={color=lredblack}}
52
53 \usepackage[font=small,captionskip=5pt,
54 footskip=.5\skip\footins,footnoterule=fullsize,
55 floatrowsep=qquad,capbesidesep=quad,capbesideposition=inside,
56 facing=yes,floatHaslist=yes,doublefloataswide=yes]{floatrow}
57 \usepackage{fr-fancy}
58
59 \DeclareNewFloatType{textbox}{fileext=lor,name=Text,placement=tp}
60
61 \newfloatcommand{ttextbox}{textbox}
62
63 \newcommand\TEXTBOX[1][]{%
64 Here goes first line of text \text\par
65 There goes second line of text#1\par
66 Thence goes third line of text \text\par
67 Hence goes fourth line of text}
68
69 \DeclareObjectSet{indent}{\raggedright\parindent15pt\parskip2pt\color{lredblack}}
70
71 \floatsetup[textbox]{style=plain,heightadjust=all,
72 % frameset={\fboxrule=1pt\fboxsep=12pt},
73 font={color=lredblack},margins=centering,captionskip=7pt,
74 capposition=bottom,objectset=indent,
75 %capbesideframe=yes,
76 capbesideposition=outside,
77 capbesidewidth=\marginparwidth,valign=t}
78
79 %\floatsetup[widetextbox]{margins=hanginside,facing=yes,rowfill={\fill,\fill},
80 % floatwidth=\textwidth}
81
82 \DeclareMarginSet{hanginside}{\setfloatmargins*
83 {\strut\hskip-\marginparwidth\hskip-\marginparsep}{}%\hfill
84 }
85 \DeclareMarginSet{hangoutside}{\setfloatmargins*
86 {}{\hskip-\marginparwidth\hskip-\marginparsep\strut}%\hfill
87 }
88
89 \DeclareColorBox{framedfigure}{\fcolorbox{gray}{white}}
90 \DeclareColorBox{yellowplate}{\fcolorbox{lyellow}{lyellow}}
91 \DeclareColorBox{redplate}{\fcolorbox{lred}{lred}}
92 \DeclareColorBox{Redplate}{\colorbox{lred}}
93
94 \DeclareCBoxCorners{Redplate}
95 {\floatfacing{}{{\color{red}
96 \linethickness{.5pt}\put(-.5pt,-.5pt)
97 {{\put(0pt,0pt){\line(0,1){\FRcolorboxht}}}%
98 {\put(0pt,0pt){\line(1,0){\FRcolorboxwd}}}%
99 {\linethickness{.24pt}\put(-2pt,-2pt){\line(0,1){2cm}}}%
100 {\linethickness{.24pt}\put(-2pt,-2pt){\line(1,0){3cm}}}}%
101 }}}
102 {\floatfacing{{\color{red}
103 \linethickness{.5pt}\put(.5pt,-.5pt)
104 {{\put(0pt,0pt){\line(0,1){\FRcolorboxht}}}%
105 {\put(0pt,0pt){\line(-1,0){\FRcolorboxwd}}}%
106 {\linethickness{.24pt}\put(2pt,-2pt){\line(0,1){2cm}}}%
107 {\linethickness{.24pt}\put(2pt,-2pt){\line(-1,0){3cm}}}}%
108 }}{}}
109 {}
110 {}
111
112 \providecommand*{\pkg}[1]{\texttt{#1}}
113 \providecommand*{\com}[1]{\texttt{\char`\\#1}}
114 \providecommand*{\Lopt}[1]{\textsf{#1}}
115 \providecommand*{\file}[1]{\texttt{#1}}
116 \providecommand*{\env}[1]{\texttt{#1}}
117 \providecommand*{\meta}[1]{$\langle$\textit{#1}$\rangle$}
118
119 \def\text{{\mdseries And more text and some more text and a bit more text and
120 a little more text and a little peace of text to fill space}}
121
122 \def\Text{text%{\mdseries \text. \text. \text. \text.}
123 }
124
125 \unitlength1.44pt
126
127 \floatsetup[widefloat]{style=plain,margins=hangleft,objectset=centering,framearound=row,
128 colorframeset=yellowplate,framestyle=colorbox,framefit=yes,heightadjust=object,valign=c}
129
130 \begin{document}
131 \providecommand\RaggedRight{\raggedright}
132
133
134 \Text
135
136 \Text
137
138 \begin{figure*}[H]%
139 \begin{floatrow}[4]
140 \ffigbox
141 {\caption{Figure~I in the row (\texttt{floatrow}), ``column'' width}%
142 \label{fig:row:Dog:rowbox}}
143 {\setlength\unitlength{\hsize/72}\input{TheDog.picture}}
144 \ffigbox[\FBwidth]
145 {\caption{Figure~II in the row (\texttt{floatrow}), graphics width}%
146 \label{fig:row:WcatI:rowbox}}
147 {\unitlength1.08\unitlength\input{TheCat.picture}}
148 \ffigbox[\Xhsize/2]
149 {\caption{Figure~III in the row, float's width box has the
150 half of the rest space of row}%
151 \label{fig:row:mouse:rowbox}}
152 {{\setlength\unitlength{\hsize/58}%^^A
153 {\input{Mouse.picture}}}}
154 \ffigbox[\Xhsize]
155 {\caption{Figure~IV in the row,
156 occupies the rest space of row}%
157 \label{fig:row:cheese:rowbox}}
158 {\setlength\unitlength{\hsize/80}\input{Cheese.picture}}
159 \end{floatrow}
160 \end{figure*}%
161 The result you see in the row of
162 figures~\ref{fig:row:Dog:rowbox}--\ref{fig:row:cheese:rowbox}.
163
164 \Text
165
166 \Text
167 \clearpage
168
169 \begin{figure*}[H]
170 \begin{floatrow}
171 \ffigbox[\FBwidth+2cm]
172 {\unitlength.9\unitlength\input{BlackCat.picture}}
173 {\caption{The left beside figure uses settings for vertical top alignment}%
174 \label{leftfig:BOXED:valigned:widerowbox}}%
175 \ffigbox[\FBwidth+2.4cm]
176 {\caption{The beside figure at the right side in float row uses settings for vertical top alignment too}%^^A
177 \label{rightfig:BOXED:valigned:widerowbox}}
178 {\unitlength1.25\unitlength\input{Cat.picture}}
179 \end{floatrow}
180 \end{figure*}%^^A
181
182 \Text
183
184 \Text
185 \clearpage
186
187 \begin{figure*}[H]
188 \ffigbox%^^A[\FBwidth+2cm]
189 {\unitlength.9\unitlength\input{BlackCat.picture}}
190 {\caption{The left beside figure uses settings for vertical top alignment}%
191 \label{leftfig:BOXED:valigned:outrowbox}}%
192 \end{figure*}%^^A
193
194 \Text
195
196 \Text
197 \clearpage
198
199 \begin{figure*}[H]
200 \ffigbox[\FBwidth+2cm]
201 {\unitlength.9\unitlength\input{BlackCat.picture}}
202 {\caption{The left beside figure uses settings for vertical top alignment}%
203 \label{leftfig:BOXED:valigned:outrowbox}}%
204 \end{figure*}%^^A
205
206 \Text
207
208 \Text
209 \clearpage
210
211 \floatsetup[widefloat]{style=plain,margins=hangleft,objectset=centering,framearound=row,
212 colorframeset=yellowplate,framestyle=colorbox,framefit=yes,heightadjust=object,valign=t}
213
214 \thisfloatsetup{rowfill=yes,facing=yes}
215 \begin{figure*}[H]
216 \begin{floatrow}
217 \ffigbox[\FBwidth+2cm]
218 {\unitlength.9\unitlength\input{BlackCat.picture}}
219 {\caption{hangLEFT: The left beside figure uses settings for vertical top alignment}%
220 \label{leftfig:BOXED:valigned:widerowbox2}}%
221 \ffigbox[\FBwidth+2.4cm]
222 {\caption{hangLEFT: The beside figure at the right side in float row uses settings
223 for vertical top alignment too}%^^A
224 \label{rightfig:BOXED:valigned:widerowbox2}}
225 {\unitlength1.25\unitlength\input{Cat.picture}}
226 \end{floatrow}
227 \end{figure*}%^^A
228
229 \Text
230
231 \Text
232 \clearpage
233
234 \floatsetup[widefloat]{style=plain,margins=hanginside,rowfill=yes,
235 objectset=centering,framearound=row,
236 colorframeset=redplate,framestyle=colorbox,framefit=yes,heightadjust=object,valign=t}
237
238 \begin{figure*}[H]
239 \begin{floatrow}
240 \ffigbox[\FBwidth+2cm]
241 {\unitlength.9\unitlength\input{BlackCat.picture}}
242 {\caption{hangINside: The left beside figure uses settings for vertical top alignment}%
243 \label{leftfig:BOXED:valigned:widerowbox2}}%
244 \ffigbox[\FBwidth+2.4cm]
245 {\caption{hangINside: The beside figure at the right side in float row uses settings
246 for vertical top alignment too}%^^A
247 \label{rightfig:BOXED:valigned:widerowbox2}}
248 {\unitlength1.25\unitlength\input{Cat.picture}}
249 \end{floatrow}
250 \end{figure*}%^^A
251
252 \Text
253
254 \Text
255 \clearpage
256
257
258 \begin{figure*}[H]
259 \begin{floatrow}
260 \ffigbox[\FBwidth+2cm]
261 {\unitlength.9\unitlength\input{BlackCat.picture}}
262 {\caption{hangINside: The left beside figure uses settings for vertical top alignment}%
263 \label{leftfig:BOXED:valigned:widerowbox2}}%
264 \ffigbox[\FBwidth+2.4cm]
265 {\caption{hangINside: The beside figure at the right side in float row uses settings
266 for vertical top alignment too}%^^A
267 \label{rightfig:BOXED:valigned:widerowbox2}}
268 {\unitlength1.25\unitlength\input{Cat.picture}}
269 \end{floatrow}
270 \end{figure*}%^^A
271
272 \Text
273
274 \Text
275 \clearpage
276
277 \floatsetup[widefloat]{style=plain,margins=hangoutside,
278 rowfill=yes,objectset=centering,framearound=row,
279 colorframeset=redplate,framestyle=colorbox,framefit=yes,heightadjust=object,valign=t}
280
281 \begin{figure*}[H]
282 \begin{floatrow}
283 \ffigbox[\FBwidth+2cm]
284 {\unitlength.9\unitlength\input{BlackCat.picture}}
285 {\caption{hangOUTside: The left beside figure uses settings for vertical top alignment}%
286 \label{leftfig:BOXED:valigned:widerowbox2}}%
287 \ffigbox[\FBwidth+2.4cm]
288 {\caption{hangOUTside: The beside figure at the right side in float row uses settings
289 for vertical top alignment too}%^^A
290 \label{rightfig:BOXED:valigned:widerowbox2}}
291 {\unitlength1.25\unitlength\input{Cat.picture}}
292 \end{floatrow}
293 \end{figure*}%^^A
294
295 \Text
296
297 \Text
298 \clearpage
299
300
301 \begin{figure*}[H]
302 \begin{floatrow}
303 \ffigbox[\FBwidth+2cm]
304 {\unitlength.9\unitlength\input{BlackCat.picture}}
305 {\caption{hangOUTside: The left beside figure uses settings for vertical top alignment}%
306 \label{leftfig:BOXED:valigned:widerowbox2}}%
307 \ffigbox[\FBwidth+2.4cm]
308 {\caption{hangOUTside: The beside figure at the right side in float row uses settings
309 for vertical top alignment too}%^^A
310 \label{rightfig:BOXED:valigned:widerowbox2}}
311 {\unitlength1.25\unitlength\input{Cat.picture}}
312 \end{floatrow}
313 \end{figure*}%^^A
314
315 \Text
316
317 \Text
318 \clearpage
319
320 \begin{figure*}[H]
321 \fcapside[\FBwidth+2cm]
322 {\unitlength.9\unitlength\input{BlackCat.picture}}
323 {\caption{The left beside figure uses settings for vertical top alignment}%
324 \label{leftfig:BOXED:valigned:besoutrowbox}}%
325 \end{figure*}%^^A
326 The result you see in the row of
327 figures~\ref{leftfig:BOXED:valigned:rowbox}--\ref{rightfig:BOXED:valigned:rowbox}.
328
329 \Text
330
331 \Text
332 \clearpage
333
334 \makeatletter
335 %\newcommand\flrow@nullpic[2][cc]{{\let\unitlength\relax
336 % \picture(\z@,\z@)(\z@,\z@)\put(\z@,\z@){\makebox(\z@,\z@)[#1]{#2}}\endpicture}}
337 %\newcommand\flrow@ll@col@put{\floatfacing{}{{\color{red}%
338 % \put(-\@wholewidth,-\@wholewidth)
339 % {{\put(\z@,\z@){\line(0,1){\TeXr@ruleht}}}%
340 % {\put(\z@,\z@){\line(1,0){\TeXr@rulewd}}}%
341 % {\linethickness{.24\p@}\put(-2\p@,-2\p@){\line(0,1){2cm}}}%
342 % {\linethickness{.24\p@}\put(-2\p@,-2\p@){\line(1,0){3cm}}}}%
343 %}}}
344 %\newcommand\flrow@ul@col@put{}
345 %\newcommand\flrow@lr@col@put{\floatfacing{{\color{red}
346 % \put(\@wholewidth,-\@wholewidth)
347 % {{\put(\z@,\z@){\line(0,1){\TeXr@ruleht}}}%
348 % {\put(\z@,\z@){\line(-1,0){\TeXr@rulewd}}}%
349 % {\linethickness{.24\p@}\put(2\p@,-2\p@){\line(0,1){2cm}}}%
350 % {\linethickness{.24\p@}\put(2\p@,-2\p@){\line(-1,0){3cm}}}}%
351 %}}{}}
352 %\newcommand\flrow@ur@col@put{}
353 %\newcommand\flrow@l@color@side[2]{{\let\unitlength\relax
354 % \picture(\z@,\z@)(\z@,\z@)
355 % \put(\z@,#1){{\flrow@ll@col@put}}
356 % \put(\z@,#2){{\flrow@ul@col@put}}
357 % \endpicture}}
358 %\newcommand\flrow@r@color@side[2]{{\let\unitlength\relax
359 % \picture(\z@,\z@)(\z@,\z@)
360 % \put(\z@,#1){{\flrow@lr@col@put}}
361 % \put(\z@,#1){{\flrow@ur@col@put}}
362 % \endpicture}}
363 %
364 %\def\FRcolor@block#1#2#3{%
365 % {\set@color\rlap{\edef\TeXr@rulewd{#1}\@tempdima#2\advance\@tempdima#3%
366 % \edef\TeXr@ruleht{\the\@tempdima}%
367 % \flrow@l@color@side{-#3}{#2}\ifcolors@
368 % \vrule\@width#1\@height#2\@depth#3\fi
369 % \flrow@r@color@side{-#3}{#2}}}}
370
371 %\def\fcolorbox#1#{\color@fbox{#1}}
372 %\def\color@fbox#1#2#3{%
373 % \color@b@x{\fboxsep\z@\color#1{#2}\fbox}{\color#1{#3}}}
374
375 %\def\colorbox#1#{\color@box{#1}}
376 %\def\color@box#1#2{\color@b@x\relax{\color#1{#2}}}
377 %
378 %\long\def\color@b@x#1#2#3{%
379 % \leavevmode
380 % \setbox\z@\hbox{\kern\fboxsep{\set@color#3}\kern\fboxsep}%
381 % \dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@
382 % \dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@
383 % {#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}%
384 % \box\z@}}}
385
386 \makeatother
387
388 Example of row with two textboxes
389 (boxes~\ref{row:text:I}--\ref{row:text:II}).
390
391 \floatsetup[widetextbox]{margins=hangoutside,facing=yes,rowfill=yes,
392 framestyle=FRcolorbox,colorframeset=Redplate,colorframecorners=Redplate,
393 frameset={\fboxrule=0pt\fboxsep=12pt}}
394
395
396 \begin{textbox*}
397 \begin{floatrow}
398 \ttextbox
399 {hangOUTside: \TEXTBOX\footnote{Text of footnote. \text}}
400 {\caption{Beside text~I in float row. \text}%
401 \label{row:text:I}}%
402
403 \floatbox{textbox}
404 {hangOUTside: \TEXTBOX. \text.
405
406 \floatfoot{Text of float foot. \text}}%
407 {\caption{Beside text~II in float row}%
408 \label{row:text:II}}%
409 \end{floatrow}
410 \end{textbox*}
411
412 \Text
413 \clearpage
414
415 \begin{textbox*}
416 \begin{floatrow}
417 \ttextbox
418 {hangINside: \TEXTBOX\footnote{Text of footnote. \text}}
419 {\caption{Beside text~I in float row. \text}%
420 \label{row:text:I}}%
421
422 \floatbox{textbox}
423 {hangINside: \TEXTBOX. \text.
424
425 \floatfoot{\color{lredblack}Text of float foot. \text}}%
426 {\caption{Beside text~II in float row}%
427 \label{row:text:II}}%
428 \end{floatrow}
429 \end{textbox*}
430
431 \Text
432
433 \floatsetup[widefigure]{margins=hangoutside,facing=yes,rowfill=yes,
434 framestyle=FRcolorbox,colorframeset=Redplate,colorframecorners=Redplate,framefit=no,
435 frameset={\fboxrule=0pt\fboxsep=8pt}}
436 \begin{figure*}[H]%
437 \CommonHeightRow{\begin{floatrow}[3]%
438 \ffigbox[\FBwidth]{\resizebox!\CommonHeight
439 {\vrule width 70pt height 2cm}}{\caption{}}
440 \ffigbox[\FBwidth]{\resizebox!\CommonHeight
441 {\vrule width 81pt height 1.2cm}}{\caption{}}
442 \ffigbox[\FBwidth]{\resizebox!\CommonHeight
443 {\vrule width 50pt height 2cm}}{\caption{}}
444 \end{floatrow}}%
445 \end{figure*}
446
447
448 \end{document}