%%
%% This is file `genmpage.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% genmpage.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 genmpage.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file genmpage.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) 2001 Thomas Lotze
%%
%% This file may be distributed under the terms of the LaTeX Project
%% Public License, as described in lppl.txt in the base LaTeX
%% distribution. Either version 1.0 or, at your option, any later
%% version.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{genmpage}[2001/02/16 Generalized minipage environment (Thomas Lotze)]
\RequirePackage{keyval}
\newlength\@GenMPparindent

\def\@iiiminipage#1#2[#3]#4{%
  \@ifnextchar[%
    {\@ivminipage{#1}{#2}{#3}{#4}}
    {\@ivminipage{#1}{#2}{#3}{#4}[]}}

\def\@ivminipage#1#2#3#4[#5]{%
  \setkeys{GenMP}{plain,#5}%
  \if@GenMPwidth\else\@GenMPwidth#4\fi
  \if@GenMPheight\else
    \def\@GenMPtempa{#2}\def\@GenMPtempb{\relax}%
    \ifx\@GenMPtempa\@GenMPtempb%
      \let\@GenMPheight=\relax
    \else
      \def\@GenMPheight{#2}%
    \fi
  \fi
  \if@GenMPouter\else\def\@GenMPouter{#1}\fi%
  \if@GenMPinner\else\def\@GenMPinner{#3}\fi%
  \@GenMPparindent\parindent
  \leavevmode
  \@pboxswfalse
  \@tempdima\@GenMPwidth
  \def\@mpargs{{\@GenMPouter}{\@GenMPheight}[\@GenMPinner]{\@GenMPwidth}}%
  \setbox\@tempboxa\vbox\bgroup
    \color@begingroup
      \hsize\@tempdima
      \textwidth\hsize \columnwidth\hsize
      \@parboxrestore
      \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
      \let\@footnotetext\@mpfootnotetext
      \let\@listdepth\@mplistdepth \@mplistdepth\z@
      \@minipagerestore
      \@setminipage}

\def\@setminipage{%
  \@minipagetrue
  \@GenMPtop
  \@GenMPflush
  \@GenMPresetfont
  \@GenMPffamily\@GenMPfseries\@GenMPfshape\selectfont
  \@GenMPfsize
  \@GenMPsetpi
  \everypar{\@minipagefalse\everypar{}}}

\let\@GenMPendminipage\endminipage
\def\endminipage{%
  \@GenMPbottom
  \@GenMPendminipage}

\let\@GenMPflush=\relax
\define@key{GenMP}{flush}[]{\let\@GenMPflush=\relax}
\define@key{GenMP}{raggedright}[]{\let\@GenMPflush=\raggedright}
\define@key{GenMP}{RaggedRight}[]{\let\@GenMPflush=\RaggedRight}
\define@key{GenMP}{raggedleft}[]{\let\@GenMPflush=\raggedleft}
\define@key{GenMP}{center}[]{\let\@GenMPflush=\centering}

\let\@GenMPffamily=\relax
\let\@GenMPfseries=\relax
\let\@GenMPfshape=\relax
\let\@GenMPresetfont=\relax
\let\@GenMPfsize=\relax
\define@key{GenMP}{ffamily}{\def\@GenMPffamily{\fontfamily{#1}}}
\define@key{GenMP}{fseries}{\def\@GenMPfseries{\fontseries{#1}}}
\define@key{GenMP}{fshape}{\def\@GenMPfshape{\fontshape{#1}}}
\define@key{GenMP}{resetfont}[true]{%
  \def\@GenMPread{#1}\def\@GenMPtempa{true}%
  \ifx\@GenMPread\@GenMPtempa%
    \let\@GenMPresetfont=\normalfont
  \else
    \let\@GenMPresetfont=\relax
  \fi}
\define@key{GenMP}{fsize}{\def\@GenMPfsize{\csname #1\endcsname}}

\let\@GenMPsetpi=\relax
\define@key{GenMP}{keepparindent}[true]{%
  \def\@GenMPread{#1}\def\@GenMPtempa{true}%
  \ifx\@GenMPread\@GenMPtempa%
    \def\@GenMPsetpi{\parindent\@GenMPparindent}%
  \fi}
\define@key{GenMP}{parindent}{\def\@GenMPsetpi{\parindent#1}}

\newlength\@GenMPwidth
\newif\if@GenMPwidth
\let\if@GenMPwidth\iffalse
\define@key{GenMP}{width}{\let\if@GenMPwidth\iftrue\@GenMPwidth#1}
\define@key{GenMP}{widtharg}[]{\let\if@GenMPwidth\iffalse}
\newif\if@GenMPheight
\let\if@GenMPheight\iffalse
\define@key{GenMP}{height}{\let\if@GenMPheight\iftrue\def\@GenMPheight{#1}}
\define@key{GenMP}{heightarg}[]{\let\if@GenMPheight\iffalse}

\newif\if@GenMPouter
\let\if@GenMPouter\iffalse
\let\@GenMPtop=\relax
\let\@GenMPbottom=\relax
\define@key{GenMP}{outer}{%
  \def\@GenMPread{#1}\def\@GenMPtempa{T}%
  \ifx\@GenMPread\@GenMPtempa%
    \def\@GenMPtop{\vspace{0pt}}%
    \def\@GenMPouter{t}%
  \else
    \def\@GenMPtempa{B}%
    \ifx\@GenMPread\@GenMPtempa%
      \def\@GenMPbottom{\vspace{0pt}}%
      \def\@GenMPouter{b}%
    \else
      \def\@GenMPouter{#1}%
    \fi
  \fi
  \let\if@GenMPouter\iftrue
}
\define@key{GenMP}{outerarg}[]{\let\if@GenMPouter\iffalse}

\newif\if@GenMPinner
\let\if@GenMPinner\iffalse
\define@key{GenMP}{inner}{\let\if@GenMPinner\iftrue\def\@GenMPinner{#1}}
\define@key{GenMP}{innerarg}[]{\let\if@GenMPinner\iffalse}

\def\defineMPstyle#1#2{%
  \define@key{GenMP}{#1}[]{\setkeys{GenMP}{#2}}}

\defineMPstyle{plain}{}
\endinput
%%
%% End of file `genmpage.sty'.
