%%
%% This is file `graphfig.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% graphfig.dtx  (with options: `package')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from graphfig.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file graphfig.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
%% + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
%% | Copyright(C) 1997-1999 by Francesco Bosisio                 |
%% |                                                             |
%% | This program can be redistributed and/or modified under the |
%% | terms of the LaTeX Project Public License Distributed from  |
%% | CTAN archives in directory macros/latex/base/lppl.txt;      |
%% | either version 1 of the License, or any later version.      |
%% |                                                             |
%% | E-mail:   fbosisio@bigfoot.com                              |
%% | Web page: http://www.bigfoot.com/~fbosisio/LaTeX            |
%% | CTAN location: macros/latex/contrib/supported/bosisio/      |
%% + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
%%
%%
%% If you make any improvment, find any bug or have
%% any suggestion, please let me know about it.
%%
\def\FileName{graphfig}
\def\fileversion{2.0}
\def\filedate{1997/15/12}
\def\docdate{1997/15/12}
\def\filedescr{Commands to include graphics files (BF)}
%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{\FileName}[\filedate\space v\fileversion\space\filedescr]
\RequirePackage{graphics}
%%
\newif\if@AllowSubFigure\@AllowSubFigurefalse
\newif\if@AllowHfloat\@AllowHfloatfalse
%%
\DeclareOption{subfigure}{\@AllowSubFiguretrue}
\DeclareOption{AllowH}{\@AllowHfloattrue}
%%
\ProcessOptions
%%
\if@AllowSubFigure
  \RequirePackage{subfigure}[1995/03/06 v2.0]
  \def\thesubfigure{\alph{subfigure}}
  \renewcommand*\@thesubfigure{{\subcaplabelfont(\thesubfigure)}\space}
  \let\SubGR@PH=\subfigure
\else
  \newcommand*\SubGR@PH[2][]{#2}
\fi
\if@AllowHfloat
  \RequirePackage{float}[1995/03/29 v1.2c]
  \restylefloat{figure}
\fi
%%
\newif\if@FirstPicture\@FirstPicturetrue
\let\SubFig@Label=\relax
%%
\newcommand*\@Graph@Figure[3]{\resizebox{#1}{#2}{\includegraphics*{#3}}}
\newcommand*\graphfile{\@ifnextchar*{\graphfile@star}{%
\@ifnextchar[{\GraphFile@width}{\GraphFile@noSize}}%
}
\def\graphfile@star*{\@ifnextchar[{\GraphFile@heigth}{\GraphFile@noSize}}
%%
\def\GraphFile@width[#1]{%
\@ifnextchar[{\@GraphFile@width@heigth{#1}}{\@GraphFile@widthNOheigth{#1}}%
}
\def\@GraphFile@width@heigth#1[#2]#3{%
\@ifnextchar[{\@GraphFile@Draw{.#1\linewidth}{.#2\linewidth}{#3}}{%
\@GraphFile@Draw{.#1\linewidth}{.#2\linewidth}{#3}[]}%
}
\def\@GraphFile@widthNOheigth#1#2{%
\@ifnextchar[{\@GraphFile@Draw{.#1\linewidth}{!}{#2}}{%
\@GraphFile@Draw{.#1\linewidth}{!}{#2}[]}%
}
\def\GraphFile@heigth[#1]#2{%
\@ifnextchar[{\@GraphFile@Draw{!}{.#1\linewidth}{#2}}{%
\@GraphFile@Draw{!}{.#1\linewidth}{#2}[]}%
}
\newcommand*\GraphFile@noSize[1]{%
\@ifnextchar[{\@GraphFile@Draw{\expandafter\width}{!}{#1}}{%
\@GraphFile@Draw{\expandafter\width}{!}{#1}[]}%
}
%%
\def\@GraphFile@Draw#1#2#3[#4]{%
\if@FirstPicture%
  \@FirstPicturefalse%
  \def\TMP@Graph{\SubGR@PH[#4\SubFig@Label]{\@Graph@Figure{#1}{#2}{#3}}}%
\else%
  \ifx\TMP@Graph\undefined%
    \SubGR@PH[#4\SubFig@Label]{\@Graph@Figure{#1}{#2}{#3}}\hspace*{\fill}%
  \else%
    \hspace*{-4pt}\TMP@Graph\hspace*{\fill}%
    \let\TMP@Graph\undefined%
    \SubGR@PH[#4\SubFig@Label]{\@Graph@Figure{#1}{#2}{#3}}\hspace*{\fill}%
  \fi%
\fi%
}
%%
\newcommand*\FigureDefaultPlacement[1]{\def\Default@FigurePlacement{#1}}
\def\Default@FigurePlacement{htbp}
%%
\newenvironment{Figure}[2][\Default@FigurePlacement]{%
\@FirstPicturetrue%
\figure[#1]%
\hspace*{\fill}%
\let\@Figure@CR=\\%
\def\\{\par\hspace*{\fill}}%
\@ifnextchar[{\@Figure@quadra{#2}}{\def\MK@Figure@Caption{\caption{#2}}}%
}{%
\ifx\TMP@Graph\undefined\else%
  \if@AllowSubFigure%
    \renewcommand*\SubGR@PH[2][]{##2}%
    \TMP@Graph\hspace*{\fill}%
    \let\SubGR@PH=\subfigure%
  \else%
    \TMP@Graph\hspace*{\fill}%
  \fi%
  \global\let\TMP@Graph\undefined%
\fi%
\MK@Figure@Caption%
\let\Mk@Figure@Caption\undefined%
\let\SubFig@Label=\relax%
\let\\=\@Figure@CR%
\let\@Figure@CR\undefined%
\endfigure%
\def\thesubfigure{\thefigure\alph{subfigure}}%
}
%%
\def\@Figure@quadra#1[#2]{%
\def\MK@Figure@Caption{\caption{#1}\label{#2}}%
\def\SubFig@Label{\expandafter\label{#2:\expandafter\alph{subfigure}}}%
}
\endinput
%%
%% End of file `graphfig.sty'.
