Debian Codegraph @

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

raw
1 %frsample02 - sample head
2 %one-column non-facing layout with left margin
3 %figures use BOXED style
4 %text boxes use modified Boxed style
5 \input pictures
6 %\listfiles
7 \documentclass{book}
8
9 \usepackage{calc}
10 \usepackage{tabularx,array}
11
12 \IfFileExists{pstricks.sty}{\usepackage{pstricks}\psset{unit=1pt}}{}
13
14 \IfFileExists{fancyhdr.sty}{\RequirePackage{fancyhdr}\pagestyle{fancy}\fancyfoot{}
15 \fancyhead[LE]{\leavevmode\hspace*{-.5\marginparwidth}\hskip-\marginparsep
16 \def\arraystretch{1,2}\begin{tabular}{@{}l@{}}
17 \leavevmode\rlap{\thepage}\hskip.5\marginparwidth\hskip\marginparsep
18 \hbox to\textwidth{\slshape\leftmark\hfill}\\\hline\end{tabular}}
19 \fancyhead[LO]{\leavevmode\hspace*{-.5\marginparwidth}\hskip-\marginparsep
20 \def\arraystretch{1,2}\begin{tabular}{@{}l@{}}
21 \hskip.5\marginparwidth\hskip\marginparsep
22 \hbox to\textwidth{{\slshape\rightmark}\quad\hfill\thepage}\\\hline\end{tabular}}
23 \fancyhead[RE]{}\fancyhead[CE]{}
24 \fancyhead[RO]{}\fancyhead[CO]{}
25 \def\headrulewidth{0pt}}
26 {\pagestyle{plain}}
27
28 %load floatrow
29 \usepackage{floatrow}
30 \usepackage{listpen}
31 \floatsetup{font={small,sf},footskip=.5\skip\footins,
32 footnoterule=limited,captionskip=5pt,margins=raggedright,
33 objectset=raggedright,capbesideposition=right,
34 capbesidesep=quad,floatrowsep=quad,style=BOXED}
35 \usepackage{fr-fancy}
36 \usepackage{floatpagestyle}
37
38 % new float
39 \DeclareNewFloatType{textbox}{fileext=lor,name=Text,placement=tp}
40
41 \DeclareObjectSet{unindent}{\leftskip12pt\parindent-\leftskip\parskip2pt}
42
43 \floatsetup[textbox]{style=Boxed,heightadjust=all,
44 frameset={\fboxrule=1pt\fboxsep=12pt},
45 capposition=bottom,objectset=unindent,
46 capbesideframe=yes,heightadjust=object,
47 valign=t}
48
49 \newif\ifWideLayout\WideLayouttrue
50
51 \DeclareMarginSet{hangleft}%
52 {\setfloatmargins
53 {\hskip-.5\marginparwidth\hskip-\marginparsep}{\hfil}}
54 \floatsetup[widefloat]{margins=hangleft}
55
56 %load caption
57 \usepackage[font=small,labelfont=bf,labelsep=period,
58 justification=justified,singlelinecheck=no]{caption}[2004/11/28]
59
60 \newif\ifLoadRotating
61 \IfFileExists{rotating.sty}
62 {\usepackage[figuresright]{rotating}
63
64 \DeclareMarginSet{expand}%
65 {\setfloatmargins
66 {}{\hskip-\headsep\hskip-.7\headheight plus1fil}}
67 \floatsetup[rotfloat]{capbesideposition=right,margins=expand}
68 \LoadRotatingtrue}{\LoadRotatingfalse}
69
70 %load subfig
71 \newif\ifLoadSubfig
72 \IfFileExists{subfig.sty}
73 {\usepackage[justification=justified,font=rm]{subfig}
74 \LoadSubfigtrue}{\LoadSubfigfalse}
75
76 \newif\ifLoadSubcaption\LoadSubcaptiontrue
77
78 %load wrapfig
79 \newif\ifLoadWrapfig
80 \IfFileExists{wrapfig.sty}{\usepackage{wrapfig}
81 \LoadWrapfigtrue}{\LoadWrapfigfalse}
82
83 \let\wideemptyfloatpage\emptyfloatpage
84
85 \providecommand*{\pkg}[1]{\texttt{#1}}
86 \providecommand*{\com}[1]{\texttt{\char`\\#1}}
87 \begin{document}
88
89 \chapter{One Column Document and~Wide Floats}
90
91 \begin{sl}
92 This example shows floats in one-column document, wide float left hanged.
93
94 \emph{Common settings.}\\
95 Font for float contents \verb|\small| sans serif (except tables),
96 in this case font settings for subfloats was restored Roman family;
97 skips before foot material half reduced;
98 skip between caption and object also half reduced;
99 footnote rule has maximum width 1\,in (here is created special footnote style);
100 box alignment and justification of object contents flushed to left margin;
101 separation between beside caption and object equals to 1\,em; separation
102 between beside float boxes also equals to 1\,em. Common float style
103 \texttt{BOXED} (box around all float contents).
104 \begin{verbatim}
105 \floatsetup{font={small,sf},footskip=.5\skip\footins,
106 footnoterule=limited,captionskip=5pt,margins=raggedright,
107 objectset=raggedright,capbesideposition=right,
108 capbesidesep=quad,floatrowsep=quad,style=BOXED}
109 \end{verbatim}
110
111 \emph{Common caption settings.}\\
112 For caption text used \verb|\small| font, caption label font bold, separated
113 by period sign, justification justified.
114 \begin{verbatim}
115 \usepackage[font=small,labelfont=bf,labelsep=period,
116 justification=justified,singlelinecheck=no]{caption}
117 \end{verbatim}
118
119 \emph{Common subcaption settings.}\\
120 Justification centerlast (last line centered). Restored roman family.
121 \begin{verbatim}
122 \usepackage[justification=justified,font=rm]{subfig}
123 \end{verbatim}
124
125 \emph{Special settings for float types.}
126
127 \emph{Textbox.}\\
128 The new float textbox uses corrected \texttt{Boxed} style (changed frame
129 settings); object contents left aligned (\verb|\raggedright|), with
130 \verb|\parindent|${{}=15}$\,pt, \verb|\parskip|${{}=15}$\,pt.
131 To get aligned subfloats the key \texttt{heightadjust=all} loaded.
132 \begin{verbatim}
133 \DeclareNewFloatType{textbox}{fileext=lor,name=Text,placement=tp}
134
135 \DeclareObjectSet{unindent}{\leftskip12pt\parindent-\leftskip\parskip2pt}
136
137 \floatsetup[textbox]{style=Boxed,heightadjust=all,
138 frameset={\fboxrule=1pt\fboxsep=12pt},
139 capposition=bottom,objectset=unindent,
140 capbesideframe=yes,heightadjust=object,
141 valign=t}
142 \end{verbatim}
143
144 \emph{Special settings for special float layout.}
145
146 \emph{Wide float.}\\
147 For wide float set hanged indentation to the left margin.
148 \begin{verbatim}
149 \DeclareMarginSet{hangleft}%
150 {\setfloatmargins
151 {\hskip-.5\marginparwidth\hskip-\marginparsep}{\hfil}}
152 \floatsetup[widefloat]{margins=hangleft}
153 \end{verbatim}
154
155 \emph{Rotated float.}\\
156 For rotated floats beside caption placed to right side of object;
157 right side expanded to the top of running head. To delete running head from pages
158 with rotated float was used \verb|\emptyfloatpage| macro\footnote{In current example the
159 \protect\com{wideemptyfloatpage} command is the synonym.} and
160 loaded \pkg{floatpagestyle} package.
161 \begin{verbatim}
162 \DeclareMarginSet{expand}%
163 {\setfloatmargins
164 {}{\hskip-\headsep\hskip-.7\headheight plus1fil}}
165 \floatsetup[rotfloat]{capbesideposition=right,margins=expand}
166 \end{verbatim}
167
168 \end{sl}
169
170 \input fr-sample
171
172 \end{document}