summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/floatrow/frsample11.tex
blob: 661631789c639e6b95c908e4f260bf67b6b0f041 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
%frsample02 - sample head
%one-column non-facing layout with left margin
%figures use BOXED style
%text boxes use modified Boxed style
\input pictures
%\listfiles
\documentclass{book}

\usepackage{calc}
\usepackage{tabularx,array}

\IfFileExists{pstricks.sty}{\usepackage{pstricks}\psset{unit=1pt}}{}

\IfFileExists{fancyhdr.sty}{\RequirePackage{fancyhdr}\pagestyle{fancy}\fancyfoot{}
\fancyhead[LE]{\leavevmode\hspace*{-.5\marginparwidth}\hskip-\marginparsep
  \def\arraystretch{1,2}\begin{tabular}{@{}l@{}}
  \leavevmode\rlap{\thepage}\hskip.5\marginparwidth\hskip\marginparsep
  \hbox to\textwidth{\slshape\leftmark\hfill}\\\hline\end{tabular}}
\fancyhead[LO]{\leavevmode\hspace*{-.5\marginparwidth}\hskip-\marginparsep
  \def\arraystretch{1,2}\begin{tabular}{@{}l@{}}
  \hskip.5\marginparwidth\hskip\marginparsep
  \hbox to\textwidth{{\slshape\rightmark}\quad\hfill\thepage}\\\hline\end{tabular}}
\fancyhead[RE]{}\fancyhead[CE]{}
\fancyhead[RO]{}\fancyhead[CO]{}
\def\headrulewidth{0pt}}
{\pagestyle{plain}}

%load floatrow
\usepackage{floatrow}
\usepackage{listpen}
\floatsetup{font={small,sf},footskip=.5\skip\footins,
   footnoterule=limited,captionskip=5pt,margins=raggedright,
   objectset=raggedright,capbesideposition=right,
   capbesidesep=quad,floatrowsep=quad,style=BOXED}
\usepackage{fr-fancy}
\usepackage{floatpagestyle}

% new float
\DeclareNewFloatType{textbox}{fileext=lor,name=Text,placement=tp}

\DeclareObjectSet{unindent}{\leftskip12pt\parindent-\leftskip\parskip2pt}

\floatsetup[textbox]{style=Boxed,heightadjust=all,
  frameset={\fboxrule=1pt\fboxsep=12pt},
  capposition=bottom,objectset=unindent,
  capbesideframe=yes,heightadjust=object,
  valign=t}

\newif\ifWideLayout\WideLayouttrue

\DeclareMarginSet{hangleft}%
  {\setfloatmargins
     {\hskip-.5\marginparwidth\hskip-\marginparsep}{\hfil}}
\floatsetup[widefloat]{margins=hangleft}

%load caption
\usepackage[font=small,labelfont=bf,labelsep=period,
   justification=justified,singlelinecheck=no]{caption}[2004/11/28]

\newif\ifLoadRotating
\IfFileExists{rotating.sty}
{\usepackage[figuresright]{rotating}

\DeclareMarginSet{expand}%
  {\setfloatmargins
     {}{\hskip-\headsep\hskip-.7\headheight plus1fil}}
\floatsetup[rotfloat]{capbesideposition=right,margins=expand}
\LoadRotatingtrue}{\LoadRotatingfalse}

%load subfig
\newif\ifLoadSubfig
\IfFileExists{subfig.sty}
{\usepackage[justification=justified,font=rm]{subfig}
\LoadSubfigtrue}{\LoadSubfigfalse}

\newif\ifLoadSubcaption\LoadSubcaptiontrue

%load wrapfig
\newif\ifLoadWrapfig
\IfFileExists{wrapfig.sty}{\usepackage{wrapfig}
\LoadWrapfigtrue}{\LoadWrapfigfalse}

\let\wideemptyfloatpage\emptyfloatpage

\providecommand*{\pkg}[1]{\texttt{#1}}
\providecommand*{\com}[1]{\texttt{\char`\\#1}}
\begin{document}

\chapter{One Column Document and~Wide Floats}

\begin{sl}
This example shows floats in one-column document, wide float left hanged.

\emph{Common settings.}\\
Font for float contents \verb|\small| sans serif (except tables),
in this case font settings for subfloats was restored Roman family;
skips before foot material half reduced;
skip between caption and object also half reduced;
footnote rule has maximum width 1\,in (here is created special footnote style);
box alignment and justification of object contents flushed to left margin;
separation between beside caption and object equals to 1\,em; separation
between beside float boxes also equals to 1\,em. Common float style
\texttt{BOXED} (box around all float contents).
\begin{verbatim}
\floatsetup{font={small,sf},footskip=.5\skip\footins,
   footnoterule=limited,captionskip=5pt,margins=raggedright,
   objectset=raggedright,capbesideposition=right,
   capbesidesep=quad,floatrowsep=quad,style=BOXED}
\end{verbatim}

\emph{Common caption settings.}\\
For caption text used \verb|\small| font, caption label font bold, separated
by period sign, justification justified.
\begin{verbatim}
\usepackage[font=small,labelfont=bf,labelsep=period,
   justification=justified,singlelinecheck=no]{caption}
\end{verbatim}

\emph{Common subcaption settings.}\\
Justification centerlast (last line centered). Restored roman family.
\begin{verbatim}
\usepackage[justification=justified,font=rm]{subfig}
\end{verbatim}

\emph{Special settings for float types.}

\emph{Textbox.}\\
The new float textbox uses corrected \texttt{Boxed} style (changed frame
settings); object contents left aligned (\verb|\raggedright|), with
\verb|\parindent|${{}=15}$\,pt, \verb|\parskip|${{}=15}$\,pt.
To get aligned subfloats the key \texttt{heightadjust=all} loaded.
\begin{verbatim}
\DeclareNewFloatType{textbox}{fileext=lor,name=Text,placement=tp}

\DeclareObjectSet{unindent}{\leftskip12pt\parindent-\leftskip\parskip2pt}

\floatsetup[textbox]{style=Boxed,heightadjust=all,
  frameset={\fboxrule=1pt\fboxsep=12pt},
  capposition=bottom,objectset=unindent,
  capbesideframe=yes,heightadjust=object,
  valign=t}
\end{verbatim}

\emph{Special settings for special float layout.}

\emph{Wide float.}\\
For wide float set hanged indentation to the left margin.
\begin{verbatim}
\DeclareMarginSet{hangleft}%
  {\setfloatmargins
     {\hskip-.5\marginparwidth\hskip-\marginparsep}{\hfil}}
\floatsetup[widefloat]{margins=hangleft}
\end{verbatim}

\emph{Rotated float.}\\
For rotated floats beside caption placed to right side of object;
right side expanded to the top of running head. To delete running head from pages
with rotated float was used \verb|\emptyfloatpage| macro\footnote{In current example the
\protect\com{wideemptyfloatpage} command is the synonym.} and
loaded \pkg{floatpagestyle} package.
\begin{verbatim}
\DeclareMarginSet{expand}%
  {\setfloatmargins
     {}{\hskip-\headsep\hskip-.7\headheight plus1fil}}
\floatsetup[rotfloat]{capbesideposition=right,margins=expand}
\end{verbatim}

\end{sl}

\input fr-sample

\end{document}