-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfloat.sty
142 lines (142 loc) · 5.74 KB
/
float.sty
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
%%
%% This is file `float.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% float.dtx (with options: `package')
%%
%% IMPORTANT NOTICE:
%% This file is a stripped version of `float.dtx',
%% copyright (c) 1991-9 Anselm Lingnau ([email protected])
%%
%% This file may only be distributed together with the corresponding
%% `float.dtx' file. See `float.dtx' for distribution conditions on
%% the original source.
%%
%% Package `float' to use with LaTeX 2e
%% Copyright (C) 1991-1999 Anselm Lingnau, all rights reserved
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{float}
[1999/05/29 v1.2d Float enhancements (AL)]
\newcounter{float@type}
\@ifundefined{c@figure}%
{\setcounter{float@type}{1}}%
{\setcounter{float@type}{4}}
\newcommand\floatstyle[1]{\@ifundefined{fs@#1}%
{\float@error{#1}}%
{\def\float@style{#1}}}
\newcommand\float@error[1]{\PackageError{float}{%
Unknown float style `#1'
}{\@eha}}
\newcommand\floatname[2]{\@namedef{fname@#1}{#2}}
\newcommand\floatplacement[2]{\@namedef{fps@#1}{#2}}
\newcommand\restylefloat[1]{\expandafter\edef\csname
fst@#1\endcsname{\expandafter\noexpand\csname
fs@\float@style\endcsname}%
\@namedef{#1}{\bgroup\@nameuse{fst@#1}\@float{#1}}%
\@namedef{#1*}{\bgroup\@nameuse{fst@#1}\@dblfloat{#1}}%
\expandafter\let\csname end#1\endcsname\float@end
\expandafter\let\csname end#1*\endcsname\float@dblend}
\newcommand\newfloat[3]{\@namedef{ext@#1}{#3}
\floatplacement{#1}{#2}%
\@ifundefined{fname@#1}{\floatname{#1}{#1}}{}
\expandafter\edef\csname ftype@#1\endcsname{\value{float@type}}%
\addtocounter{float@type}{\value{float@type}}
\restylefloat{#1}%
\expandafter\edef\csname fnum@#1\endcsname%
{\expandafter\noexpand\csname fname@#1\endcsname{}
\expandafter\noexpand\csname the#1\endcsname}
\@ifnextchar[{\@xnewfloat{#1}}%
{\@ifundefined{c@#1}{\newcounter{#1}\@namedef{the#1}{\arabic{#1}}}%
{}}}
\def\@xnewfloat#1[#2]{\@ifundefined{c@#1}{\newcounter{#1}[#2]%
\expandafter\edef\csname the#1\endcsname{%
\expandafter\noexpand\csname
the#2\endcsname.\noexpand\arabic{#1}}}%
{\PackageWarning{float}{Can't redefine counter variable for #1.}}}
\let\@Hxfloat\@xfloat
\def\@xfloat#1[{\@ifnextchar{H}{\@HHfloat{#1}[}{\@Hxfloat{#1}[}}
\newsavebox\float@box
\newif\if@flstyle
\def\@HHfloat#1[H]{%
\expandafter\let\csname end#1\endcsname\float@endH
\let\@currbox\float@box
\def\@captype{#1}\setbox\@floatcapt=\vbox{}%
\expandafter\ifx\csname fst@#1\endcsname\relax
\@flstylefalse\else\@flstyletrue\fi
\setbox\@currbox\color@vbox\normalcolor
\vbox\bgroup \hsize\columnwidth \@parboxrestore
\reset@font \normalsize \@setnobreak \@setminipage
\ignorespaces}
\newcommand\float@makebox{%
\vbox{\hsize\columnwidth \@parboxrestore
\@fs@pre\@fs@iftopcapt
\ifvbox\@floatcapt\unvbox\@floatcapt\par\@fs@mid\fi
\unvbox\@currbox
\else\unvbox\@currbox
\ifvbox\@floatcapt\par\@fs@mid\unvbox\@floatcapt\fi
\fi\par\@fs@post\vskip\z@}}
\newcommand\float@end{\global\@minipagefalse \outer@nobreak
\egroup \color@endbox
\global\setbox\@currbox\float@makebox
\ifnum\@floatpenalty <\z@ \@largefloatcheck
\@cons\@currlist\@currbox
\ifnum\@floatpenalty < -\@Mii
\penalty -\@Miv \@tempdima\prevdepth
\vbox{}\prevdepth \@tempdima \penalty\@floatpenalty
\else \vadjust{\penalty -\@Miv
\vbox{}\penalty\@floatpenalty}\@Esphack
\fi\fi\egroup}
\newcommand\float@endH{\par\vskip\z@skip
\global\@minipagefalse \outer@nobreak
\egroup \color@endbox \vskip\intextsep
\if@flstyle\float@makebox\egroup\else\box\@currbox\fi
\vskip\intextsep\relax}
\newcommand\float@dblend{\if@twocolumn
\par\vskip\z@\egroup \outer@nobreak \color@endbox
\ifnum\@floatpenalty <\z@ \@largefloatcheck
\@cons\@dbldeferlist\@currbox\fi
\ifnum \@floatpenalty =-\@Mii \@Esphack\fi\egroup\else\float@end\fi}
\newsavebox\@floatcapt
\renewcommand\caption{\refstepcounter\@captype
\expandafter\ifx\csname fst@\@captype\endcsname\relax
\let\@tempf\@caption
\else\let\@tempf\float@caption\fi \@dblarg{\@tempf\@captype}}
\long\def\float@caption#1[#2]#3{\addcontentsline{\@nameuse{ext@#1}}{#1}%
{\protect\numberline{\@nameuse{the#1}}{\ignorespaces #2}}
\global\setbox\@floatcapt\vbox\bgroup\@parboxrestore
\normalsize\@fs@capt{\@nameuse{fnum@#1}}{\ignorespaces #3}%
\@ifnextchar[{\float@ccon}{\egroup}}
\long\def\float@ccon[#1]{#1\par\egroup}
\newcommand\listof[2]{%
\@ifundefined{ext@#1}{\float@error{#1}}{%
\@ifundefined{chapter}{\def\@tempa{\section*}}%
{\def\@tempa{\chapter*}}%
\@tempa{#2\@mkboth{\uppercase{#2}}{\uppercase{#2}}}%
\@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
\@starttoc{\@nameuse{ext@#1}}}}
\newcommand\floatc@plain[2]{\setbox\@tempboxa\hbox{{\@fs@cfont #1:} #2}%
\ifdim\wd\@tempboxa>\hsize {\@fs@cfont #1:} #2\par
\else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi}
\newcommand\fs@plain{\def\@fs@cfont{\rmfamily}\let\@fs@capt\floatc@plain
\def\@fs@pre{}\def\@fs@post{}\def\@fs@mid{\vspace{10pt}\relax}%
\let\@fs@iftopcapt\iffalse}
\newcommand\floatc@ruled[2]{{\@fs@cfont #1} #2\par}
\newcommand\fs@ruled{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled
\def\@fs@pre{\hrule height.8pt depth0pt \kern2pt}%
\def\@fs@post{\kern2pt\hrule\relax}%
\def\@fs@mid{\kern2pt\hrule\kern2pt}%
\let\@fs@iftopcapt\iftrue}
\newcommand\fs@boxed{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@plain
\def\@fs@pre{\setbox\@currbox\vbox{\hbadness10000
\moveleft3.4pt\vbox{\advance\hsize by6.8pt
\hrule \hbox to\hsize{\vrule\kern3pt
\vbox{\kern3pt\box\@currbox\kern3pt}\kern3pt\vrule}\hrule}}}%
\def\@fs@mid{\kern2pt}%
\def\@fs@post{}\let\@fs@iftopcapt\iffalse}
\floatstyle{plain}
\endinput
%%
%% End of file `float.sty'.