2 %% This is file `fr-subfig.sty',
3 %% generated with the docstrip utility.
5 %% The original source files were:
7 %% floatrow.dtx (with options: `frforsubfig')
11 %% For the copyright see the source file.
13 %% Any modified versions of this file must be renamed
14 %% with new filenames distinct from fr-subfig.sty.
16 %% For distribution of the original source see the terms
17 %% for copying and modification in the file floatrow.dtx.
19 %% This generated file may be distributed as long as the
20 %% original source files, as listed above, are part of the
21 %% same distribution. (The sources need not necessarily be
22 %% in the same archive or directory.)
23 \NeedsTeXFormat{LaTeX2e}[1995/06/01]
24 \ProvidesPackage{fr-subfig}
25 [2007/12/24 v0.1g (beta) floatrow: additions for subfig]
26 %%^^A|\newcommand\CenterFloatBoxes{\CADJfalse\OADJfalse|
42 \def\@tempb{2005/06/28 ver: 1.3 subfig package}
43 \expandafter\let\csname @tempa\expandafter\endcsname
44 \csname ver@subfig.\@pkgextension\endcsname
45 \ifx\@tempa\@tempb\else
46 \PackageWarning{fr-subfig}{The additions cooperated with \MessageBreak
47 version `2005/06/28 ver: 1.3' of package subfig,\MessageBreak
48 but only version\MessageBreak
49 \csname ver@subfig.\@pkgextension\endcsname'\MessageBreak
54 \@ifdefinable\FBsubcheight{\let\FBsubcheight\relax}
55 \@ifdefinable\FBsuboheight{\let\FBsuboheight\relax}
56 \newcommand\adjustsubfloats{\@tempswafalse
57 \ifCADJ\@tempswatrue\fi\ifOADJ\@tempswatrue\fi
58 \if@tempswa\FB@writeaux{%
59 \string\global\string\c@FBcnt\thepage
60 \ifCADJ\string\edef\string\FBsubcheight{\the\FBsc@max}\fi
61 \ifOADJ\string\edef\string\FBsuboheight{\the\FBso@max}\fi
63 \global\let\FBsubcheight\relax\global\let\FBsuboheight\relax
64 \global\FBso@max\z@\global\FBsc@max\z@}
65 \long\def\sf@@@subfloat#1[#2][#3]#4{%
66 \@ifundefined{FBsc@max}{}%
67 {\FB@readaux{\let\FBsuboheight\relax}}%
71 \else\ifdim \lastskip=\z@ \else
76 \sf@bottom=\sf@farskip
79 \sf@bottom=\sf@nearskip
82 \setbox\@tempboxa \hbox{#4}%
83 \ifdim\wd\@tempboxa=\z@\ht\@tempboxa\z@\dp\@tempboxa\z@
84 \setbox\z@\hbox{{\caption@@@make
85 {\caption@lfmt{\@nameuse{sub\@captype name}}%
86 {\@nameuse{thesub\@captype}}\relax}{}}}\@tempdima=\wd\z@
91 \let\sf@ifpositiontop\@firstoftwo
93 \@tempdima=\wd\@tempboxa
94 \@ifundefined{FBsc@max}{}%
95 {\global\advance\Xhsize-\wd\@tempboxa
97 \advance\dimen@\dp\@tempboxa
98 \ifdim\dimen@>\FBso@max
99 \global\FBso@max\dimen@
109 \ifdim \lastskip=\z@ \else
110 \@tempskipb\sf@top\relax\@xaddvskip
114 \ifx \@empty#3\relax \else
115 \sf@subcaption{#1}{#2}{#3}%
119 \hrule width0pt height0pt depth0pt
122 \@ifundefined{FBsc@max}%
124 {\ifx\FBsuboheight\relax
127 \vbox to \FBsuboheight{\FBafil\box\@tempboxa\FBbfil}%
130 \ifx \@empty#3\relax \else
132 \hrule width0pt height0pt depth0pt
133 \sf@subcaption{#1}{#2}{#3}%
138 \@ifundefined{FBsc@max}{}%
139 {\addtocounter{FRobj}{-1}%
140 \ifnum\c@FRobj>0% bugfix
143 \ifmaincaptiontop\else
144 \global\advance\@nameuse{c@\@captype}\m@ne
146 \endgroup\ignorespaces}
147 \DeclareFROpt{subcapbesideposition}{\flrow@SFbesidealign{#1}}
148 \newcommand*\flrow@SFbesidealign[1]{%
149 \caption@ifinlist{#1}{t,top}{%
150 \let\flrow@SFBalign\TopFloatBoxes
151 }{\caption@ifinlist{#1}{b,bottom,default}{%
152 \let\flrow@SFBalign\BottomFloatBoxes
153 }{\caption@ifinlist{#1}{c,center}{%
154 \let\flrow@SFBalign\CenterFloatBoxes
155 }{\PackageError{floatrow}%
156 {Undefined sublabel position `#1'}{\flrow@eh}%
158 \newcommand\flrow@SFBalign{\BottomFloatBoxes}
159 \newcommand\sidesubfloat{%
160 \ifx\@captype\@undefined
161 \@latex@error{\noexpand\subfloat outside float}\@ehd
164 \expandafter\@firstofone
166 {\flrow@sidesubfloat}}
167 \def\flrow@sidesubfloat{\flrow@SFBalign
169 \@ifundefined{caption@setfloattype}%
171 \caption@setfloattype
178 \caption@setoptions{subfloat}%
179 \caption@setoptions{sub\@captype}%
180 \let\sf@oldlabel=\label
181 \let\label=\subfloat@label
182 \ifmaincaptiontop\else
183 \advance\@nameuse{c@\@captype}\@ne
185 \refstepcounter{sub\@captype}%
186 \setcounter{sub\@captype @save}{\value{sub\@captype}}%
187 \@ifnextchar [% %] match left bracket
188 {\flrow@@sidesubfloat}%
189 {\flrow@@sidesubfloat[\@empty]}}
190 \long\def\flrow@@sidesubfloat[#1]{%
191 \@ifnextchar [% %] match left bracket
192 {\flrow@@@sidesubfloat{sub\@captype}[{#1}]}%
193 {\flrow@@@sidesubfloat{sub\@captype}[\@empty{#1}][{#1}]}}
194 \long\def\flrow@@@sidesubfloat#1[#2][#3]#4{%
195 \@ifundefined{FBsc@max}{}%
196 {\FB@readaux{\let\FBsuboheight\relax}}%
200 \else\ifdim \lastskip=\z@ \else
206 \setbox\@tempboxa \hbox{#2}%
207 \@tempdima\wd\@tempboxa
208 \setbox\@tempboxa \hbox{#4}%
209 \advance\@tempdima\wd\@tempboxa
210 \advance\@tempdima\labelsep
211 \@ifundefined{FBsc@max}{}%
212 {\global\advance\Xhsize-\wd\@tempboxa
213 \dimen@=\ht\@tempboxa
214 \advance\dimen@\dp\@tempboxa
215 \ifdim\dimen@>\FBso@max
216 \global\FBso@max\dimen@
224 \ifdim \lastskip=\z@ \else
225 \@tempskipb\sf@top\relax\@xaddvskip
230 \ifx \@empty#3\relax \else
231 \hbox{\caption@@@make
232 {\caption@lfmt{\@nameuse{sub\@captype name}}%
233 {\@nameuse{thesub\@captype}}\relax}{}}%
235 \end@FBBOX\hskip\labelsep\ignorespaces
242 \@ifundefined{FBsc@max}{}%
243 {\addtocounter{FRobj}{-1}%
247 \ifmaincaptiontop\else
248 \global\advance\@nameuse{c@\@captype}\m@ne
250 \endgroup\ignorespaces}
251 \newcommand\subfloatlabel{\@ifnextchar[%]
252 {\flrow@subfloatlabel}{\subfloat[]{}}}
253 \@ifdefinable\flrow@subfloatlabel{}
254 \def\flrow@subfloatlabel[#1]{%
255 \ifx\@captype\@undefined
256 \@latex@error{\noexpand\subfloat outside float}\@ehd
259 \count@#1\advance\count@\m@ne
260 \csname c@sub\@captype\endcsname\count@\relax
262 {\flrow@@subfloatlabel[#1]}%
263 {\subfloat[]{}\endgroup}}
264 \@ifdefinable\flrow@@subfloatlabel{}
265 \@ifundefined{newseparatedlabel}\@tempswatrue\@tempswafalse
267 \def\FRsf@Flabel{\label}
269 \newseparatedlabel\FRsf@Flabel{\@captype}{sub\@captype}
271 \def\flrow@@subfloatlabel[#1][#2]{%
272 \subfloat[]{\FRsf@Flabel{#2}}\endgroup}
275 %% End of file `fr-subfig.sty'.