-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathfloatsty.sty
120 lines (115 loc) · 4.99 KB
/
floatsty.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
% -*- LaTeX -*-
%%% ====================================================================
%%% @LaTeX-style-file{
%%% author = "Glenn Paulley",
%%% version = "0.1",
%%% date = "2002 April 15",
%%% time = "17:18:41",
%%% filename = "floatsty.sty",
%%% address = "iAnywhere Solutions
%%% 415 Phillip Street
%%% Waterloo, Ontario, Canada
%%% N2L 3X2",
%%% telephone = "(519) 883-6244",
%%% FAX = "(519) 747-4971",
%%% checksum = "",
%%% email = "[email protected]",
%%% codetable = "ISO/ASCII",
%%% keywords = "",
%%% supported = "yes",
%%% abstract = "Contains the LaTeX style command definitions
%%% for typesetting figures and tables using the FLOAT
%%% package.",
%%% docstring = "The checksum field above contains a CRC-16
%%% checksum as the first value, followed by the
%%% equivalent of the standard UNIX wc (word
%%% count) utility output of lines, words, and
%%% characters. This is produced by Robert
%%% Solovay's checksum utility.",
%%% }
%%% ====================================================================
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{floatsty}
[2002/04/15 v0.1 Float styles (GNP)]
\RequirePackage{float}
%
% Define a caption style like floatc@plain, except that the captions are
% ragged-right and flush-left, not centered.
%
\def\floatc@thinruled#1#2{\setbox\@tempboxa\hbox{{\@fs@cfont #1:} #2}%
\ifdim\wd\@tempboxa>\hsize {\@fs@cfont #1:} #2\par
\else\hbox to\hsize{\box\@tempboxa}\fi}
%
% The thinruled style has two rules, one above and one below the figure.
% The caption, flush-left, is underneath the last rule.
%
\def\fs@thinruled{\def\@fs@cfont{\rm}\let\@fs@capt\floatc@thinruled
\def\@fs@pre{\hrule\kern2pt}%
\def\@fs@post{\vskip7pt\relax}%
\def\@fs@mid{\kern2pt\hrule\kern2pt\vskip2pt}%
\let\@fs@iftopcapt\iffalse}
%
% Define thinruledc style, which includes the caption WITHIN the rules.
% The heading is centered if short enough, overwise it's formatted as
% a paragraph. The caption title and number are in cm small caps.
%
\def\floatc@thinruledc#1#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}
%
% The thinruledc style has two rules, one above and one below the figure.
% The caption is positioned above the last rule.
%
\def\fs@thinruledc{\def\@fs@cfont{\sc}\let\@fs@capt\floatc@thinruledc
\def\@fs@pre{\hrule\kern2pt\vskip2pt}%
\def\@fs@mid{\vskip7pt\relax}%
\def\@fs@post{\vskip5pt\kern2pt\hrule\kern2pt\vskip6pt}%
\let\@fs@iftopcapt\iffalse}
%
% Define IEEE style, which includes a 10-pt sans-serif (eg. Helvetica)
% caption WITHIN the rules. The heading is centered if short enough,
% otherwise it's formatted as a paragraph.
%
\newlength{\@fs@ieee@ctmp}%
\newlength{\@fs@ieee@figindent}%
\setlength{\@fs@ieee@figindent}{1pc}%
\def\floatc@IEEE#1#2{\setbox\@tempboxa\hbox{{\@fs@cfont #1.~}{\sffamily\bfseries\normalsize #2}}%
\setlength{\@fs@ieee@ctmp}{\hsize}%
\addtolength{\@fs@ieee@ctmp}{-\@fs@ieee@figindent}%
\addtolength{\@fs@ieee@ctmp}{-\@fs@ieee@figindent}%
\ifdim\wd\@tempboxa>\@fs@ieee@ctmp%
% IF longer than one indented paragraph line
% THEN set as an indented paragraph
\begin{list}{}{\leftmargin\@fs@ieee@figindent \rightmargin\leftmargin}%
\item[]{\@fs@cfont #1.~}{\sffamily\bfseries\normalsize #2}\par%
\end{list}%
\else%
\hbox to\hsize{\hfil\box\@tempboxa\hfil}%
\fi}%
%
% The IEEE style has two rules, one above and one below the figure.
% The caption is positioned above the last rule.
%
\def\fs@IEEE{\def\@fs@cfont{\sffamily\bfseries\normalsize}\let\@fs@capt\floatc@IEEE
\def\@fs@pre{\vskip3pt\hrule\kern2pt\vskip2pt}%
\def\@fs@mid{\vskip7pt\relax}%
\def\@fs@post{\vskip5pt\kern2pt\hrule\kern2pt\vskip6pt}%
\let\@fs@iftopcapt\iffalse}
\def\floatc@PARC#1#2{\setbox\@tempboxa\hbox{{\@fs@cfont #1.~}{\sffamily\bfseries\small #2}}%
\setlength{\@fs@ieee@ctmp}{\hsize}%
\addtolength{\@fs@ieee@ctmp}{-\@fs@ieee@figindent}%
\addtolength{\@fs@ieee@ctmp}{-\@fs@ieee@figindent}%
\ifdim\wd\@tempboxa>\@fs@ieee@ctmp%
% IF longer than one indented paragraph line
% THEN set as an indented paragraph
\begin{list}{}{\leftmargin\@fs@ieee@figindent \rightmargin\leftmargin}%
\item[]{\@fs@cfont #1.~}{\sffamily\bfseries\small #2}\par%
\end{list}%
\else%
\hbox to\hsize{\hfil\box\@tempboxa\hfil}%
\fi}%
\def\fs@PARC{\def\@fs@cfont{\sffamily\bfseries\small}\let\@fs@capt\floatc@PARC
\def\@fs@pre{\vskip3pt\hrule\kern2pt\vskip2pt}%
\def\@fs@mid{\vskip7pt\relax}%
\def\@fs@post{\vskip5pt\kern2pt\hrule\kern2pt\vskip6pt}%
\let\@fs@iftopcapt\iffalse}