%%
%% This is file `rabat.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% prepamath.dtx  (with options: `package')
%% 
%% prepamath.dtx
%% Copyright 2014 Prepamath, J.-C. Charpentier.
%% Class `prepamath' to use with LaTeX 2e
%% Copyright (C) 2014 Prepamath, Jean-C\^ome Charpentier.
%%
\def\fileversion{1.21}
\def\PMversion{1.21}
\def\filedate{2016/04/27}
\def\PMdate{2016/04/27}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{rabat}[%
  \filedate\space v\fileversion\space
  rabat package. Jean-Come Charpentier for prepamath%
]
\pagestyle{empty}
\@namedef{PM@cropx1}{1cm}
\@namedef{PM@cropx2}{14.5cm}
\@namedef{PM@cropx3}{15.5cm}
\@namedef{PM@cropx4}{31.5cm}
\@namedef{PM@cropx5}{33.5cm}
\@namedef{PM@cropx6}{49.5cm}
\@namedef{PM@cropx7}{50.5cm}
\@namedef{PM@cropx8}{64cm}
\@namedef{PM@cropy1}{1cm}
\@namedef{PM@cropy2}{25cm}
\@namedef{PM@col2xl}{1.8cm}
\@namedef{PM@col2w}{12.2cm}
\@namedef{PM@col3xl}{16cm}
\@namedef{PM@col3w}{14cm}
\@namedef{PM@col4xl}{35cm}
\@namedef{PM@col4w}{14cm}
\@namedef{PM@col5xl}{51cm}
\@namedef{PM@col5w}{12.2cm}
\def\@nameedef#1{\expandafter\edef\csname #1\endcsname}
\@nameedef{PM@col0xl}{\@nameuse{PM@col2xl}}
\@nameedef{PM@col0w}{\@nameuse{PM@col2w}}
\@nameedef{PM@col1xl}{\@nameuse{PM@col5xl}}
\@nameedef{PM@col1w}{\@nameuse{PM@col5w}}
\@nameedef{PM@col0xr}{\the\numexpr\@nameuse{PM@col0xl}+\@nameuse{PM@col0w}}
\@nameedef{PM@col1xr}{\the\numexpr\@nameuse{PM@col1xl}+\@nameuse{PM@col1w}}
\@nameedef{PM@col2xr}{\the\numexpr\@nameuse{PM@col2xl}+\@nameuse{PM@col2w}}
\@nameedef{PM@col3xr}{\the\numexpr\@nameuse{PM@col3xl}+\@nameuse{PM@col3w}}
\@nameedef{PM@col4xr}{\the\numexpr\@nameuse{PM@col4xl}+\@nameuse{PM@col4w}}
\@nameedef{PM@col5xr}{\the\numexpr\@nameuse{PM@col5xl}+\@nameuse{PM@col5w}}
\colorlet{ColorBack}{PM@rabatbkg@color}
\newlength{\OffsetColonne}
\setlength{\OffsetColonne}{0.5cm}
\newcount\curcolonne
\newcount\lastcolonne
\newif\ifPM@error
\newenvironment{colonne}[1][1]{%
  \ifnum\curcolonne<2
    \lastcolonne=\numexpr\curcolonne+#1-1\relax
    \ifnum\lastcolonne>1
      \PackageError{rabat}
                   {On compose la colonne \the\numexpr\curcolonne+1.\MessageBreak
                   Il n'est pas possible de fusionner #1 colonnes}%
    \fi
  \else
    \lastcolonne=\numexpr\curcolonne+#1-1\relax
    \ifnum\lastcolonne>5
      \PackageError{rabat}
                   {On compose la colonne \the\numexpr\curcolonne+1.\MessageBreak
                   Il n'est pas possible de fusionner #1 colonnes}%
    \fi
  \fi
  \ifnum\curcolonne=0
    \newpage
    \rput(0,\topskip){%
      \psframe[linestyle=none, fillstyle=solid, fillcolor=ColorBack]
              (\@nameuse{PM@cropx1},-\@nameuse{PM@cropy1})(
              \@nameuse{PM@cropx3},-\@nameuse{PM@cropy2})
      \psframe[linestyle=none, fillstyle=solid, fillcolor=ColorBack]
              (\@nameuse{PM@cropx6},-\@nameuse{PM@cropy1})
              (\@nameuse{PM@cropx8},-\@nameuse{PM@cropy2})
      \PM@R@crop
      \pnode(\@nameuse{PM@col0xl},-\dimexpr\@nameuse{PM@cropy1}+\OffsetColonne)
            {PM@Col0}
      \pnode(\@nameuse{PM@col1xl},-\dimexpr\@nameuse{PM@cropy1}+\OffsetColonne)
            {PM@Col1}
    }
  \else\ifnum\curcolonne=2
    \newpage
    \rput(0,\topskip){%
      \psframe[linestyle=none, fillstyle=solid, fillcolor=ColorBack]
              (\@nameuse{PM@cropx1},-\@nameuse{PM@cropy1})
              (\@nameuse{PM@cropx8},-\@nameuse{PM@cropy2})
      \PM@R@crop
      \pnode(\@nameuse{PM@col2xl},-\dimexpr\@nameuse{PM@cropy1}+\OffsetColonne)
            {PM@Col2}
      \pnode(\@nameuse{PM@col3xl},-\dimexpr\@nameuse{PM@cropy1}+\OffsetColonne)
            {PM@Col3}
      \pnode(\@nameuse{PM@col4xl},-\dimexpr\@nameuse{PM@cropy1}+\OffsetColonne)
            {PM@Col4}
      \pnode(\@nameuse{PM@col5xl},-\dimexpr\@nameuse{PM@cropy1}+\OffsetColonne)
            {PM@Col5}
    }
  \fi\fi
  \begin{lrbox}{\PM@box}
    \minipage[t][\dimexpr\@nameuse{PM@cropy2}%
                        -\@nameuse{PM@cropy2}%
                        -2\OffsetColonne%
                ][s]{\dimexpr\@nameuse{PM@col\the\lastcolonne xr}%
                            -\@nameuse{PM@col\the\curcolonne xl}%
                    }
}
{%
     \endminipage
   \end{lrbox}
  \edef\node{PM@Col\the\curcolonne}
  \rput[tl](\node){\usebox{\PM@box}}
  \global\curcolonne=\numexpr\lastcolonne+1
}
\newcommand*\PM@R@crop{%
  \ifPM@crop
    \begingroup
      \psset{linecolor=black, linewidth=0.4pt}
      \psline(1mm,-\@nameuse{PM@cropy1})
             (\dimexpr\@nameuse{PM@cropx1}-1mm,-\@nameuse{PM@cropy1})
      \psline(\dimexpr\@nameuse{PM@cropx8}+1mm,-\@nameuse{PM@cropy1})
             (\dimexpr\PM@pagewidth-1mm,-\@nameuse{PM@cropy1})
      \psline(1mm,-\@nameuse{PM@cropy2})
             (\dimexpr\@nameuse{PM@cropx1}-1mm,-\@nameuse{PM@cropy2})
      \psline(\dimexpr\@nameuse{PM@cropx8}+1mm,-\@nameuse{PM@cropy2})
             (\dimexpr\PM@pagewidth-1mm,-\@nameuse{PM@cropy2})
      \psline(\@nameuse{PM@cropx1},-1mm)
             (\@nameuse{PM@cropx1},-\dimexpr\@nameuse{PM@cropy1}-1mm)
      \psline(\@nameuse{PM@cropx1},-\dimexpr\PM@pageheight-1mm)
             (\@nameuse{PM@cropx1},-\dimexpr\@nameuse{PM@cropy2}+1mm)
      \psline(\@nameuse{PM@cropx8},-1mm)
             (\@nameuse{PM@cropx8},-\dimexpr\@nameuse{PM@cropy1}-1mm)
      \psline(\@nameuse{PM@cropx8},-\dimexpr\PM@pageheight-1mm)
             (\@nameuse{PM@cropx8},-\dimexpr\@nameuse{PM@cropy2}+1mm)
      \psset{linestyle=dotted}
      \psline(\@nameuse{PM@cropx2},-1mm)
             (\@nameuse{PM@cropx2},-\dimexpr\@nameuse{PM@cropy1}-1mm)
      \psline(\@nameuse{PM@cropx3},-1mm)
             (\@nameuse{PM@cropx3},-\dimexpr\@nameuse{PM@cropy1}-1mm)
      \psline(\@nameuse{PM@cropx4},-1mm)
             (\@nameuse{PM@cropx4},-\dimexpr\@nameuse{PM@cropy1}-1mm)
      \psline(\@nameuse{PM@cropx5},-1mm)
             (\@nameuse{PM@cropx5},-\dimexpr\@nameuse{PM@cropy1}-1mm)
      \psline(\@nameuse{PM@cropx6},-1mm)
             (\@nameuse{PM@cropx6},-\dimexpr\@nameuse{PM@cropy1}-1mm)
      \psline(\@nameuse{PM@cropx7},-1mm)
             (\@nameuse{PM@cropx7},-\dimexpr\@nameuse{PM@cropy1}-1mm)
      \psline(\@nameuse{PM@cropx2},-\dimexpr\PM@pageheight-1mm)
             (\@nameuse{PM@cropx2},-\dimexpr\@nameuse{PM@cropy2}+1mm)
      \psline(\@nameuse{PM@cropx3},-\dimexpr\PM@pageheight-1mm)
             (\@nameuse{PM@cropx3},-\dimexpr\@nameuse{PM@cropy2}+1mm)
      \psline(\@nameuse{PM@cropx4},-\dimexpr\PM@pageheight-1mm)
             (\@nameuse{PM@cropx4},-\dimexpr\@nameuse{PM@cropy2}+1mm)
      \psline(\@nameuse{PM@cropx5},-\dimexpr\PM@pageheight-1mm)
             (\@nameuse{PM@cropx5},-\dimexpr\@nameuse{PM@cropy2}+1mm)
      \psline(\@nameuse{PM@cropx6},-\dimexpr\PM@pageheight-1mm)
             (\@nameuse{PM@cropx6},-\dimexpr\@nameuse{PM@cropy2}+1mm)
      \psline(\@nameuse{PM@cropx7},-\dimexpr\PM@pageheight-1mm)
             (\@nameuse{PM@cropx7},-\dimexpr\@nameuse{PM@cropy2}+1mm)
    \endgroup
  \fi
}
\newbox\PM@cadrebox
\colorlet{PM@cadre@color}{DB}
\ifPM@realfonts
  \def\PM@CadreFont{\normalsize\rmfamily}
  \def\PM@TitreCadreFont{\PM@DCB\fontsize{14}{17}\selectfont}
  \def\PM@PointFont{\PM@DM\fontsize{10}{12}\selectfont}
\else
  \def\PM@CadreFont{\normalsize\rmfamily}
  \def\PM@TitreCadreFont{\sffamily\bfseries\boldmath\fontsize{14}{17}\selectfont}
  \def\PM@PointFont{\sffamily\bfseries\boldmath\fontsize{10}{12}\selectfont}
\fi
\newenvironment{cadre}[1]{%
  \parskip 1mm plus\z@
  \par
  \psframebox[linestyle=none, fillstyle=solid,
             fillcolor=PM@cadre@color]{%
  \color{white}%
  \PM@TitreCadreFont \strut \hspace*{2mm}#1%
  }
  \kern-3pt
  \pspolygon[linestyle=none, linewidth=0pt,
    fillstyle=solid, fillcolor=PM@cadre@color]
  (0,-0.30)(0.835,-0.30)(0,0.535)
  \par\nobreak\vspace{-4.6pt}
  \begin{lrbox}{\PM@cadrebox}%
    \minipage[b]{\linewidth-13.6pt}%
      \PM@CadreFont
      \strut
      \ignorespaces
}
{%
      \strut
    \endminipage
  \end{lrbox}%
  \setlength{\PM@vertical@shift}{-0.5\dp\PM@cadrebox+0.5\ht\PM@cadrebox}%
  \resetcolorseries[10]{PM@ombre@color}%
  \multido{\dx=0pt+0.25\pslinewidth}{10}{%
    \rput(7pt,-0.4pt){%
      \rput(0.5\wd\PM@cadrebox,\PM@vertical@shift){%
        \rput(\dx,-\dx){%
          \psframebox[fillstyle=none,
                      linestyle=solid, framesep=6pt,
                      linecolor=PM@ombre@color!!+]
            {\phantom{\usebox{\PM@cadrebox}}}%
        }
      }
    }
  }%
  \psframebox[linestyle=none, fillstyle=solid,
              fillcolor=white,framesep=6pt]{%
      \usebox{\PM@cadrebox}%
  }%
  \par
}%
\newif\ifPM@novspace
\newcommand*\novspace{\global\PM@novspacetrue}
\newcommand*\point[1]{%
  \ifPM@novspace
  \else
    \par\addvspace{18pt}
  \fi
  \global\PM@novspacefalse
  \textcolor{DO}{\PM@PointFont $\bullet$~~#1}
  \par\addvspace{12pt}
}
\endinput
%%
%% End of file `rabat.sty'.
