%%
%% This is file `prepamath.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% prepamath.dtx  (with options: `class')
%% 
%% prepamath.dtx
%% Copyright 2009-2020 Prepamath, J.-C. Charpentier.
%%
%% Class `prepamath' to use with LaTeX 2e
%% Copyright (C) 2009-2020 Prepamath, Jean-C\^ome Charpentier.
%%
\def\fileversion{2.26}
\def\PMversion{2.26}
\def\filedate{2020/03/04}
\def\PMdate{2020/03/04}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{prepamath}[%
  \filedate\space v\fileversion\space
  prepamath document class. Jean-Come Charpentier for prepamath%
]
\newcommand*\PM@DeclareEncoding[1]{%
  \DeclareOption{#1}{\def\PM@enc{#1}}%
}
\PM@DeclareEncoding{ansinew}
\PM@DeclareEncoding{applemac}
\PM@DeclareEncoding{ascii}
\PM@DeclareEncoding{latin1}
\PM@DeclareEncoding{latin9}
\PM@DeclareEncoding{utf8}
\newif\ifPM@crop
\DeclareOption{crop}{\PM@croptrue}
\DeclareOption{nocrop}{\PM@cropfalse}
\newif\ifPM@pstricks \PM@pstrickstrue
\DeclareOption{nopstricks}{\PM@pstricksfalse}
\DeclareOption{pstricks}{\PM@pstrickstrue}
\newif\ifPM@oldexample
\DeclareOption{newexample}{\PM@oldexamplefalse}
\DeclareOption{oldexample}{\PM@oldexampletrue}
\newif\ifPM@rabat
\DeclareOption{rabat}{\PM@rabattrue}
\DeclareOption{norabat}{\PM@rabatfalse}
\newif\ifPM@realfonts
\def\PM@BookTitleFont{\Huge\sffamily\bfseries\boldmath}
\def\PM@HeadFrontChapterFont{\chaptersize\sffamily\bfseries\boldmath}
\def\PM@HeadFirstChapterFont{\LARGE\sffamily\bfseries\boldmath}
\def\PM@HeadFirstChapterNumberFont{\numchaptersize\sffamily\bfseries\boldmath}
\def\PM@HeadNextChapterFont{\normalsize\sffamily\bfseries\boldmath}
\def\PM@HeadNextChapterNumberFont{\Large\sffamily\bfseries\boldmath}
\def\PM@HeadSpecialChapterFont{\specialchaptersize\sffamily\bfseries\boldmath}
\def\PM@TocPartHeadFont{\sffamily\bfseries\boldmath}
\def\PM@TocPartTitleFont{\sffamily\bfseries\boldmath}
\def\PM@TocChapterFont{\small\sffamily}
\def\PM@TocChapterTitleFont{\sffamily\bfseries\boldmath}
\def\PM@TocChapterNumberFont{\Huge\sffamily\bfseries\boldmath}
\def\PM@FootPageFont{\small\sffamily\bfseries\boldmath}
\def\PM@TocTitleThumbFont{\sffamily}
\def\PM@TocTitleThemaFont{\sffamily}
\def\PM@DisplayThumbFont{\Huge\sffamily\bfseries\boldmath}
\def\PM@DisplaySubThumbFont{\large\sffamily\bfseries\boldmath}
\def\PM@MiniTocFont{\normalsize\sffamily\mdseries}
\def\PM@MiniTocNumberFont{\normalsize\sffamily\bfseries\boldmath}
\def\PM@MiniTocTitleFont{\normalsize\sffamily\bfseries\boldmath}
\def\PM@PartHeadFont{\LARGE\sffamily\bfseries\boldmath}
\def\PM@PartTitleFont{\huge\sffamily\bfseries\boldmath}
\def\PM@ChapterFont{\huge\sffamily\bfseries\boldmath}
\def\PM@SpecialChapterFont{\LARGE\sffamily\bfseries\boldmath}
\def\PM@ThemaFont{\Large\sffamily\bfseries\boldmath}
\def\PM@ThumbFont{\large\sffamily\bfseries\boldmath}
\def\PM@ThumbEvenFont{\large\sffamily\bfseries\boldmath}
\def\PM@FrontSectionFont{\large\sffamily\bfseries\boldmath}
\def\PM@SectionFont{\Large\sffamily\bfseries\boldmath}
\def\PM@SectionNumberFont{\large\sffamily\bfseries\boldmath}
\def\PM@SubSectionFont{\large\sffamily\bfseries\boldmath}
\def\PM@SubSectionNumberFont{\large\sffamily\bfseries\boldmath}
\def\PM@SubSubSectionFont{\large\sffamily\bfseries\boldmath}
\def\PM@SubSubSectionNumberFont{\large\sffamily\bfseries\boldmath}
\def\PM@ParagraphFont{\normalsize\sffamily\bfseries\boldmath}
\def\PM@ParagraphNumberFont{\normalsize\sffamily\bfseries\boldmath}
\def\PM@SubParagraphFont{\small\sffamily}
\def\PM@SubParagraphNumberFont{\small\sffamily}
\def\PM@ItemNumberFont{\sffamily}
\def\PM@TheoremFont{\normalsize\sffamily}
\def\PM@ExampleFont{\normalsize\rmfamily\itshape\bfseries\boldmath}
\def\PM@WarningFont{\normalsize\sffamily\bfseries\boldmath}
\def\PM@WarningStarFont{\normalsize\sffamily\bfseries\boldmath}
\def\PM@CaptionFont{\normalsize\rmfamily}
\def\PM@CaptionTitleFont{\normalsize\rmfamily\itshape}
\def\PM@WhiteCartoucheFont{\footnotesize\sffamily\bfseries\boldmath}
\def\PM@BlackCartoucheFont{\normalsize\sffamily\bfseries\boldmath}
\def\PM@ChoiceFont{\normalsize\sffamily}
\def\PM@QCMFont{\footnotesize\sffamily\bfseries\boldmath}
\def\PM@ExoNumberFont{\normalsize\sffamily\bfseries\boldmath}
\def\PM@ExoTitleFont{\large\sffamily\bfseries\boldmath}
\def\PM@ExoSchoolFont{\small\sffamily}
\def\PM@ExoRefFont{\small\sffamily}
\def\PM@ExoTimeFont{\small\sffamily\itshape\bfseries\boldmath}
\def\PM@ExoCorrEnFont{\small\sffamily\itshape\bfseries\boldmath}
\def\PM@ToucheTxt{\footnotesize\sffamily}
\def\PM@ToucheMath{\footnotesize}
\def\PM@ScreenFont{\sffamily}
\def\PM@AlgoFont{\ttfamily\boldmath}
\newcommand*\widearc{%
  \mathpalette\PM@widearc
}
\newcommand*\PM@widearc[2]{%
  \setbox1=\hbox{$#1#2$}%
  \pnode(0.25ex,\ht1){PM@L}\copy1\pnode(0,\ht1){PM@R}%
  \ncarc[linewidth=0.3pt,arcangle=60]{PM@L}{PM@R}%
}
\def\PM@D{\fontfamily{FF-DIN}\fontseries{m}\selectfont}
\def\PM@DM{\fontfamily{FF-DIN}\fontseries{sb}\selectfont\boldmath}
\def\PM@DB{\fontfamily{FF-DIN}\fontseries{eb}\selectfont\boldmath}
\def\PM@DC{\fontfamily{FF-DIN-cond}\fontseries{m}\selectfont}
\def\PM@DCM{\fontfamily{FF-DIN-cond}\fontseries{sb}\selectfont\boldmath}
\def\PM@DCB{\fontfamily{FF-DIN-cond}\fontseries{eb}\selectfont\boldmath}
\def\PM@BC{\fontfamily{pb6}\fontseries{mc}\selectfont\boldmath}
\def\PM@B{\fontfamily{pb6}\selectfont\boldmath}
\def\PM@BH{\fontfamily{pb6}\fontseries{eb}\selectfont\boldmath}
\def\PM@H{\fontfamily{phr}\selectfont}
\def\PM@HC{\fontfamily{phrc}\selectfont}
\def\PM@DejaVu{\fontfamily{DejaVuSans-TLF}\fontseries{m}\selectfont}
\def\PM@DejaVuB{\fontfamily{DejaVuSans-TLF}\fontseries{b}\selectfont\boldmath}
\DeclareOption{realfonts}{%
  \PM@realfontstrue
  \def\PM@BookTitleFont{\PM@DCB\fontsize{30}{36}\selectfont}
  \def\PM@HeadFrontChapterFont{\PM@DCB\fontsize{20}{24}\selectfont}
  \def\PM@HeadFirstChapterFont{\PM@DCB\fontsize{20}{24}\selectfont}
  \def\PM@HeadFirstChapterNumberFont{\PM@B\fontsize{65}{65}\selectfont}
  \def\PM@HeadNextChapterFont{\PM@BC\fontsize{14}{18}\selectfont}
  \def\PM@TocPartHeadFont{\PM@DCM\fontsize{11}{13}\selectfont}
  \def\PM@TocPartTitleFont{\PM@DCM\fontsize{14}{18}\selectfont}
  \def\PM@TocChapterFont{\PM@DCM\fontsize{10}{12}\selectfont}
  \def\PM@TocChapterTitleFont{\PM@DCM\fontsize{14}{18}\selectfont}
  \def\PM@TocChapterNumberFont{\PM@B\fontsize{28}{33}\selectfont}
  \def\PM@FootPageFont{\PM@DCB\fontsize{9}{11}\selectfont}
  \def\PM@TocTitleThumbFont{\PM@DCM\fontsize{11}{13}\selectfont}
  \def\PM@TocTitleThemaFont{\PM@DCM\fontsize{11}{13}\selectfont}
  \def\PM@DisplayThumbFont{\PM@DCM\fontsize{25}{30}\selectfont}
  \def\PM@DisplaySubThumbFont{\PM@DCM\fontsize{14}{18}\selectfont}
  \def\PM@MiniTocFont{\PM@DCM\fontsize{11}{13}\selectfont}
  \def\PM@MiniTocNumberFont{\PM@DCB\fontsize{11}{13}\selectfont}
  \def\PM@MiniTocTitleFont{\PM@DCB\fontsize{11}{13}\selectfont}
  \def\PM@PartHeadFont{\PM@DCB\fontsize{19}{23}\selectfont}
  \def\PM@PartTitleFont{\PM@DCB\fontsize{28}{33}\selectfont}
  \def\PM@ChapterFont{\PM@DCB\fontsize{28}{33}\selectfont}
  \def\PM@SpecialChapterFont{\PM@DCB\fontsize{25}{30}\selectfont}
  \def\PM@ThemaFont{\PM@DCM\fontsize{18}{22}\selectfont}
  \def\PM@ThumbFont{\PM@DCB\fontsize{14}{18}\selectfont}
  \def\PM@ThumbEvenFont{\PM@BC\fontsize{16}{19}\selectfont}
  \def\PM@FrontSectionFont{\PM@DCM\fontsize{14}{18}\selectfont}
  \def\PM@SectionFont{\PM@DCB\fontsize{18}{22}\selectfont}
  \def\PM@SectionNumberFont{\PM@BH\fontsize{12}{14}\selectfont}
  \def\PM@SubSectionFont{\PM@DCB\fontsize{14}{18}\selectfont}
  \def\PM@SubSectionNumberFont{\PM@BH\fontsize{9}{11}\selectfont}
  \def\PM@SubSubSectionFont{\PM@DCB\fontsize{12}{14}\selectfont}
  \def\PM@SubSubSectionNumberFont{\PM@B\fontsize{10}{12}\selectfont}
  \def\PM@ParagraphFont{\PM@DCM\fontsize{12}{14}\selectfont}
  \def\PM@ParagraphNumberFont{\PM@B\fontsize{10}{12}\selectfont}
  \def\PM@SubParagraphFont{\PM@DC\fontsize{12}{14}\selectfont}
  \def\PM@SubParagraphNumberFont{\PM@B\fontsize{9}{11}\selectfont}
  \def\PM@ItemNumberFont{\PM@B\fontsize{8}{9.5}\selectfont}
  \def\PM@TheoremFont{\PM@DCM\fontsize{12}{14}\selectfont}
  \def\PM@ExampleFont{\rmfamily\itshape\fontsize{10}{12}\selectfont}
  \def\PM@WarningFont{\PM@DCB\fontsize{10}{12}\selectfont}
  \def\PM@WarningStarFont{\PM@B\fontsize{10}{12}\selectfont}
  \def\PM@CaptionFont{\rmfamily\fontsize{10}{12}\selectfont}
  \def\PM@CaptionTitleFont{\rmfamily\itshape\fontsize{10}{12}\selectfont}
  \def\PM@WhiteCartoucheFont{\PM@DCB\fontsize{9}{11}\selectfont}
  \def\PM@BlackCartoucheFont{\PM@DCB\fontsize{11}{13}\selectfont}
  \def\PM@ChoiceFont{\PM@DCB\fontsize{10}{12}\selectfont}
  \def\PM@QCMFont{\PM@BH\fontsize{9}{11}\selectfont}
  \def\PM@ExoNumberFont{\PM@BH\fontsize{11}{13}\selectfont}
  \def\PM@ExoTitleFont{\PM@DCB\fontsize{14}{18}\selectfont}
  \def\PM@ExoSubTitleFont{\PM@DCB\fontsize{9}{11}\selectfont}
  \def\PM@ExoSchoolFont{\PM@DCB\fontsize{10}{12}\selectfont}
  \def\PM@ExoRefFont{\PM@DC\fontsize{8.5}{10}\selectfont}
  \def\PM@ExoTimeFont{\PM@DCB\fontsize{9}{11}\selectfont}
  \def\PM@ExoCorrEnFont{\PM@DCB\fontsize{8}{9.5}\selectfont}
  \def\PM@ToucheTxt{\PM@DejaVuB\fontsize{6.5}{8}\selectfont}
  \def\PM@ToucheMath{\footnotesize\boldmath}
  \def\PM@ScreenFont{\PM@H\fontsize{9}{11}\selectfont}
  \def\PM@AlgoFont{\ttfamily\boldmath}
}
\def\PM@enc{utf8}
\ProcessOptions
\RequirePackage[column=Z]{cellspace}
\setlength{\cellspacetoplimit}{3pt}
\setlength{\cellspacebottomlimit}{3pt}
\renewcommand*{\@endpbox}{%
  \unless \ifcellspace@
    \@finalstrut \@arstrutbox
  \fi
  \par
  \global \cellspace@lastdp = \prevdepth
  \expandafter
  \color@endgroup
  \expandafter
  \egroup
  \ifcellspace@
    \global \cellspace@firstht = \ht\@tempboxa
    \setbox \@tempboxa = \vbox {%
      \setlength{\@tempdima}{\ht\@arstrutbox - \cellspace@firstht}%
      \ifthenelse{\lengthtest{\@tempdima<\cellspacetoplimit}}{%
        \setlength{\@tempdima}{\cellspace@firstht + \cellspacetoplimit}%
      }{%
        \setlength{\@tempdima}{\ht\@arstrutbox}%
      }%
      \hbox{\vrule height \@tempdima width 0pt depth 0pt }%
      \nointerlineskip
      \vskip-\cellspace@firstht
      \unvbox \@tempboxa
      \setlength{\@tempdima}{\dp\@arstrutbox - \cellspace@lastdp}%
      \ifthenelse{\lengthtest{\@tempdima<\cellspacebottomlimit}}{%
        \setlength{\@tempdima}{\cellspace@lastdp + \cellspacebottomlimit}%
      }{%
        \setlength{\@tempdima}{\dp\@arstrutbox}%
      }%
      \vskip-\cellspace@lastdp
      \nointerlineskip
      \hbox{\vrule height 0pt depth \@tempdima width 0pt }%
    }%
  \fi
  \unvbox \@tempboxa
  \egroup
  \hfil
}
\RequirePackage{calc}
\RequirePackage[cmyk,table]{xcolor}
\RequirePackage{pst-all}
\SpecialCoor
\ifPM@pstricks\else
  \PSTricksOff
  \def\c@lor@to@ps#1{}
  \def\@@{}
\fi
\RequirePackage{multicol}
\@twosidetrue
\RequirePackage{fancyhdr}
\ifPM@rabat
  \newcommand*\PM@pagewidth{650mm}
  \newcommand*\PM@pageheight{260mm}
  \RequirePackage[paperwidth=650mm, paperheight=260mm,
                  noheadfoot]{geometry}
\else
  \RequirePackage[paperwidth=160mm, paperheight=240mm,
                  headheight=12pt]{geometry}
\fi
\RequirePackage[T1]{fontenc}
\RequirePackage[\PM@enc]{inputenc}
\ifPM@realfonts
  \RequirePackage[mtbold]{mathtime}
  \renewcommand*\ttdefault{lmtt}
\else
  \RequirePackage{mathptmx}
  \RequirePackage{helvet}
  \renewcommand*\ttdefault{lmtt}
  \def\jmath{j}
\fi
\newcommand*\euro{{\usefont{U}{zpeus}{m}{n} E}\xspace}
\RequirePackage{textcomp}
\renewcommand*\textcompsubstdefault{lmr}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{array}
\RequirePackage{tabularx}
\RequirePackage{ccaption}
\RequirePackage{graphicx}
\RequirePackage{listingsutf8}
\let\abovecaptionskip\relax
\let\belowcaptionskip\relax
\lstset{inputencoding=utf8,
  showstringspaces=false,
  basicstyle=\ttfamily,
  keywordstyle=\color{DO},
  language=python,
  columns=flexible,
  keepspaces=true,
  aboveskip=0pt,
  belowskip=0pt,
  literate=
    {^^c3^^a0}{{\`a}}{1}%
    {^^c3^^a2}{{\^a}}{1}%%%
    {^^c3^^a4}{{\"a}}{1}%%%
    {^^c3^^80}{{\`A}}{1}%
    {^^c3^^82}{{\^A}}{1}%
    {^^c3^^84}{{\"A}}{1}%
    {^^c3^^a7}{{\c{c}}}{1}%
    {^^c3^^87}{{\c{C}}}{1}%
    {^^c3^^a9}{{\'e}}{1}%
    {^^c3^^a8}{{\`e}}{1}%
    {^^c3^^aa}{{\^e}}{1}%
    {^^c3^^ab}{{\"e}}{1}%
    {^^c3^^89}{{\'E}}{1}%
    {^^c3^^88}{{\`E}}{1}%
    {^^c3^^8a}{{\^E}}{1}%
    {^^c3^^8b}{{\"E}}{1}%
    {^^c3^^ae}{{\^i}}{1}%
    {^^c3^^af}{{\"i}}{1}%
    {^^c3^^8e}{{\^I}}{1}%
    {^^c3^^8f}{{\"I}}{1}%
    {^^c3^^b4}{{\^o}}{1}%
    {^^c3^^b6}{{\"o}}{1}%
    {^^c3^^94}{{\^O}}{1}%
    {^^c3^^96}{{\"O}}{1}%
    {^^c5^^93}{{\oe}}{1}%
    {^^c5^^92}{{\OE}}{1}%
    {^^c3^^b9}{{\`u}}{1}%
    {^^c3^^bb}{{\^u}}{1}%
    {^^c3^^bc}{{\"u}}{1}%
    {^^c3^^99}{{\`U}}{1}%
    {^^c3^^9b}{{\^U}}{1}%
    {^^c3^^9c}{{\"U}}{1}%
    {^^c3^^bf}{{\"y}}{1}%
    {^^c5^^b8}{{\"Y}}{1}%
  ,
  breaklines=true
}
\lstdefinestyle{numeros}{numbers=left, numberstyle=\ttfamily,
  numbersep=10pt, xleftmargin=5mm}
\RequirePackage{fancyvrb}
\newcommand\@makefntext[1]{%
  \parindent 1em
  \noindent
  \hb@xt@1.8em{\hss\@makefnmark}#1%
}
\RequirePackage[frenchb]{babel}
\RequirePackage[autolanguage]{numprint}
\def\itemizeFB{%
    \ifnum \@itemdepth >\thr@@\@toodeep\else
      \advance\@itemdepth\@ne
      \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
      \expandafter
      \listORI
      \csname\@itemitem\endcsname
      {\settowidth{\labelwidth}{\csname\@itemitem\endcsname}%
       \setlength{\leftmargin}{\labelwidth}%
       \addtolength{\leftmargin}{\labelsep}%
       \ifnum\@listdepth=0
         \setlength{\itemindent}{\parindent}%
       \else
         \addtolength{\leftmargin}{\parindent}%
       \fi
       \setlength{\itemsep}{4\p@ \@plus2\p@ \@minus\p@}%
       \setlength{\parsep}{\z@}%
       \setlength{\topsep}{4\p@ \@plus2\p@ \@minus\p@}%
       \setlength{\partopsep}{\z@}%
       \@tempdima=\parskip
       \addtolength{\topsep}{-\@tempdima}%
       \addtolength{\partopsep}{\@tempdima}}%
    \fi}
\RequirePackage{xspace}
\renewcommand\normalsize{%
   \@setfontsize\normalsize{10}{12}%
   \abovedisplayskip 4\p@ \@plus2\p@ \@minus1\p@
   \abovedisplayshortskip \z@ \@plus3\p@
   \belowdisplayshortskip 3\p@ \@plus3\p@
   \belowdisplayskip \abovedisplayskip
   \let\@listi\@listI}
\normalsize
\newcommand\small{%
   \@setfontsize\small{9}{11}%
   \abovedisplayskip 3\p@ \@plus3\p@ \@minus1\p@
   \abovedisplayshortskip \z@ \@plus2\p@
   \belowdisplayshortskip 2\p@ \@plus2\p@ \@minus1\p@
   \def\@listi{\leftmargin\leftmargini
               \topsep 4\p@ \@plus2\p@ \@minus2\p@
               \parsep 2\p@ \@plus\p@ \@minus\p@
               \itemsep \parsep}%
   \belowdisplayskip \abovedisplayskip
}
\newcommand\footnotesize{%
   \@setfontsize\footnotesize{8}{9.5}%
   \abovedisplayskip 2\p@ \@plus2\p@ \@minus0.5\p@
   \abovedisplayshortskip \z@ \@plus\p@
   \belowdisplayshortskip 1.5\p@ \@plus\p@ \@minus0.5\p@
   \def\@listi{\leftmargin\leftmargini
               \topsep 3\p@ \@plus\p@ \@minus\p@
               \parsep 2\p@ \@plus\p@ \@minus\p@
               \itemsep \parsep}%
   \belowdisplayskip \abovedisplayskip
}
\newcommand\scriptsize{\@setfontsize\scriptsize{7}{8}}
\newcommand\tiny{\@setfontsize\tiny{5}{6}}
\newcommand\large{\@setfontsize\large{12}{14}}
\newcommand\Large{\@setfontsize\Large{14}{18}}
\newcommand\LARGE{\@setfontsize\LARGE{18}{22}}
\newcommand\huge{\@setfontsize\huge{19}{24}}
\newcommand\Huge{\@setfontsize\Huge{25}{30}}
\def\@listi{\leftmargin\leftmargini
            \parsep 4\p@ \@plus2\p@ \@minus\p@
            \topsep 8\p@ \@plus2\p@ \@minus4\p@
            \itemsep4\p@ \@plus2\p@ \@minus\p@}
\let\@listI\@listi
\renewcommand\FrenchLabelItem{%
  \pscircle*[linecolor=PM@item@color](0,0.75ex){0.5mm}
  \hspace*{1.5mm}%
}
\renewcommand\theenumi{\colorbox{\PM@thumb@dcolor}{\@arabic\c@enumi}}
\renewcommand\theenumii{(\@alph\c@enumii)}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\newcommand\labelenumi{\theenumi}
\newcommand\labelenumii{\theenumii}
\newcommand\labelenumiii{\theenumiii}
\newcommand\labelenumiv{\theenumiv}
\renewcommand\p@enumii{\theenumi.}
\renewcommand\p@enumiii{\theenumi.\theenumii}
\renewcommand\p@enumiv{\p@enumiii.\theenumiii}
\def\enumerate{%
  \ifnum \@enumdepth >\thr@@\@toodeep\else
    \advance\@enumdepth\@ne
    \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
    \expandafter\list
    \csname label\@enumctr\endcsname
    {%
      \usecounter\@enumctr
      \ifnum\@enumdepth>1
        \def\makelabel##1{{\bfseries\boldmath(##1)}\hss}%
      \else
        \def\makelabel##1{%
          \psframebox[linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@dcolor]{\textcolor{white}{\PM@ItemNumberFont
              ##1}}%
          \hss
        }%
      \fi
      \setlength{\itemindent}{0pt}%
      \setlength{\labelwidth}{18pt}%
      \setlength{\labelsep}{2pt}%
      \setlength{\leftmargin}{20pt}%
    }%
  \fi
}
\let\endenumerate\endlist
\let\questions\enumerate
\let\endquestions\endenumerate
\setlength{\labelsep}{.5em}
\setlength{\labelwidth}{\leftmargini}
\addtolength{\labelwidth}{-\labelsep}
\newenvironment{description}
  {\list{}
        {%
          \labelwidth\z@
          \itemindent-\leftmargin
          \let\makelabel\descriptionlabel
        }%
  }
  {\endlist}
\newcommand*\descriptionlabel[1]{%
  \hspace\labelsep
  \normalfont\bfseries\boldmath #1%
}
\RequirePackage{microtype}
\setlength{\smallskipamount}{3\p@ \@plus 1\p@ \@minus 1\p@}
\setlength{\medskipamount}{6\p@ \@plus 2\p@ \@minus 2\p@}
\setlength{\bigskipamount}{12\p@ \@plus 4\p@ \@minus 4\p@}
\setlength{\lineskip}{1\p@}
\setlength{\normallineskip}{1\p@}
\newcommand\chaptersize{\@setfontsize\chaptersize{18}{22}}
\newcommand\bigchaptersize{\@setfontsize\bigchaptersize{19}{24}}
\newcommand\numchaptersize{\@setfontsize\numchaptersize{60}{60}}
\definecolor{DR}{cmyk}{0.00,0.88,0.77,0.00}
\definecolor{MR}{cmyk}{0.00,0.26,0.23,0.00}
\definecolor{LR}{cmyk}{0.00,0.13,0.12,0.00}
\definecolor{DB}{cmyk}{0.85,0.00,0.17,0.00}
\definecolor{MB}{cmyk}{0.26,0.00,0.05,0.00}
\definecolor{LB}{cmyk}{0.13,0.00,0.03,0.00}
\definecolor{DY}{cmyk}{0.00,0.10,1.00,0.00}
\definecolor{MY}{cmyk}{0.00,0.05,0.45,0.00}
\definecolor{LY}{cmyk}{0.00,0.02,0.15,0.00}
\definecolor{DO}{cmyk}{0.00,0.75,1.00,0.00}
\definecolor{MO}{cmyk}{0.00,0.22,0.30,0.00}
\definecolor{LO}{cmyk}{0.00,0.08,0.10,0.00}
\definecolor{DG}{cmyk}{0.76,0.00,1.00,0.00}
\definecolor{MG}{cmyk}{0.23,0.00,0.30,0.00}
\definecolor{LG}{cmyk}{0.06,0.00,0.08,0.00}
\definecolor{DGray}{cmyk}{0.00,0.00,0.00,0.90}
\definecolor{MGray}{cmyk}{0.00,0.00,0.00,0.60}
\definecolor{LGray}{cmyk}{0.00,0.00,0.00,0.30}
\ifPM@rabat
  \definecolor{PM@rabatbkg@color}{cmyk}{0.00,0.08,0.25,0.00}
\fi
\colorlet{PM@headnomain@color}{DR}
\colorlet{PM@sectionnomain@color}{DR}
\colorlet{PM@item@color}{DR}
\colorlet{PM@parttoc@color}{DB}
\colorlet{PM@parthead@color}{MGray}
\colorlet{PM@parttitle@color}{DR}
\colorlet{PM@chaptertoc@color}{DR}
\colorlet{PM@theorem@color}{DR}
\def\PM@thematoc@color{DR}
\colorlet{PM@arrayrule@color}{black}
\colorlet{PM@touche@color}{black}
\colorlet{PM@warning@color}{DR}
\definecolor{PM@blueitem@color}{cmyk}   {1.00,0.00,0.00,0.00}
\definecolor{PM@head@color}{cmyk}       {1.00,0.00,0.00,0.30}
\definecolor{PM@section@color}{cmyk}    {1.00,0.00,0.00,0.00}
\definecolor{PM@thumbtext@color}{cmyk}  {0.00,0.00,0.00,0.40}
\definecolor{PM@example@color}{cmyk}    {0.00,0.00,0.00,1.00}
\definecolor{PM@grayitem@color}{cmyk}   {0.00,0.00,0.00,0.60}
\ifPM@rabat
  \definecolorseries{PM@ombre@color}{cmyk}{step}
                    [cmyk]{0.00,0.00,0.00,0.00}{0.00,0.00,0.00,0.00}
\else
  \definecolorseries{PM@ombre@color}{cmyk}{step}
                    [cmyk]{0.00,0.00,0.00,0.35}{0.00,0.00,0.00,0.97}
\fi
\colorlet{PM@screenframe@color1}{DG!100!LG}
\colorlet{PM@screenframe@color2}{DG!90!LG}
\colorlet{PM@screenframe@color3}{DG!80!LG}
\colorlet{PM@screenframe@color4}{DG!70!LG}
\colorlet{PM@screenframe@color5}{DG!60!LG}
\colorlet{PM@screenframe@color6}{DG!50!LG}
\colorlet{PM@screenframe@color7}{DG!40!LG}
\colorlet{PM@screenframe@color8}{DG!30!LG}
\colorlet{PM@screenframe@color9}{DG!20!LG}
\colorlet{PM@screenframe@color10}{DG!10!LG}
\colorlet{PM@screenbkg@color}{LG}
\colorlet{TabularColor}{LY}
\ifPM@rabat
  \geometry{%
    left=0mm, right=0mm,
    top= 0mm, bottom=0mm,
    marginparsep=0mm, marginparwidth=0mm,
    hoffset=0mm, voffset=0mm
  }
\else
  \geometry{%
    left=23mm, right=23mm,
    top= 30mm, bottom=20mm,
    marginparsep=0mm, marginparwidth=0mm,
    hoffset=2.5cm, voffset=1.85cm
  }
\fi
\newif\ifmainmatter
\newif\iffrontmatter
\newif\ifbackmatter
\newif\ifPM@intro
\newif\ifPM@special
\newif\ifPM@break
\newcount\PM@shiftpage
\newcount\PM@nbappendix
\newcommand*\thepage{}
\newcommand*\frontmatter{%
  \clearpage
  \renewcommand*\thepage{\@roman\c@page}%
  \global\PM@shiftpage \c@page
  \global\advance\PM@shiftpage -\@ne
  \frontmattertrue
  \mainmatterfalse
  \backmatterfalse
}
\newcommand*\mainmatter{%
  \cleardoublepage
  \renewcommand*\thepage{\@arabic\c@page}%
  \global\PM@shiftpage \c@page
  \global\advance\PM@shiftpage \m@ne
  \global\c@page \@ne
  \frontmatterfalse
  \mainmattertrue
  \backmatterfalse
}
\newcommand*\backmatter{%
  \frontmatterfalse
  \mainmatterfalse
  \backmattertrue
}
\newcommand\PM@chapapp{Chapitre}
\newcommand\PM@shortchapapp{Chap}
\newcommand\PM@planchapapp{du chapitre}
\newif\ifappendix
\appendixfalse
\newcommand\appendix{%
  \clearpage
  \appendixtrue
  \setcounter{chapter}{0}%
  \renewcommand\thechapter{\Alph{chapter}}%
  \renewcommand\PM@chapapp{Annexe}%
  \renewcommand\PM@shortchapapp{Annexe}
  \renewcommand\PM@planchapapp{de l'annexe}%
  \setthumb{R/Cours,O/Interros,G/Corrig\'es*}
}
\newcommand*\tableofcontents{%
  \chapter{Table des\\mati\`eres}
  \@starttoc{toc}%
  \clearpage
}
\newcommand*\chaptertocintro[3]{%
  \par\addvspace{\bigskipamount}
  \setbox1=\hbox{\textcolor{PM@section@color}{%
      \PM@TocChapterNumberFont #1
    }%
  }%
    \setbox2=\hbox{\textcolor{PM@section@color}{%
        \PM@TocChapterFont Introduction\
      }%
    }%
    \@tempdima=\ht1
    \advance\@tempdima -\ht2
    \rput(0,0.1){\box2\raisebox{-\@tempdima}{\box1}}
  \hspace*{10mm}%
  \begin{minipage}[t]{\linewidth-32mm}%
  \textcolor{PM@section@color}{\PM@TocChapterTitleFont #2}%
  \hfill
  \hbox to0pt{\hspace*{10.5mm}%
    \llap{\textcolor{PM@section@color}{\PM@TocChapterTitleFont #3}}%
    \hss
  }%
  \end{minipage}
  \par
}
\newcommand\PM@Letter[1]{%
  \ifcase#1
  \or Premi\`ere%
  \or Deuxi\`eme%
  \or Troisi\`eme%
  \or Quatri\`eme%
  \or Cinqui\`eme
  \or Sixi\`eme%
  \or Septi\`eme%
  \or Huiti\`eme
  \or Neuvi\`eme%
  \or Dixi\`eme%
  \or Onzi\`eme
  \or Douzi\`eme%
  \or Treizi\`eme
  \or Quatorzi\`eme%
  \or Quinzi\`eme%
  \or Seizi\`eme%
  \or Dix-septi\`eme%
  \or Dix-huiti\`eme%
  \or Dix-neuvi\`eme%
  \or Vingti\`eme%
  \else
    \ClassError{Prepamath}{Il y a trop de parties dans l'ouvrage}
    {La classe Prepamath ne permet que 20 parties.}
  \fi
}%
\newcommand*\parttoc[3]{%
  \par\addvspace{\bigskipamount}
  \hspace*{10mm}%
  \begin{minipage}[t]{\linewidth-20mm}%
    \textcolor{PM@parttoc@color}
              {\PM@TocPartHeadFont \PM@Letter{#1} partie}
    \par
    \textcolor{PM@parttoc@color}
              {\PM@TocPartTitleFont \MakeUppercase{#2}}
  \end{minipage}%
  \par
}
\newcommand*\appendixtoc[3]{%
  \ifnum#1=1
    \par\addvspace{\bigskipamount}
    \rput[B](0,0){%
      \ifnum\PM@nbappendix=1
        \textcolor{PM@chaptertoc@color}{%
          \PM@TocChapterTitleFont Annexe
        }%
      \else
        \textcolor{PM@chaptertoc@color}{%
          \PM@TocChapterTitleFont Annexes
        }%
      \fi
    }%
  \else
  \fi
  \hspace*{10mm}%
  {\PM@TocTitleThumbFont \PM@tocbulletcolor{black}#2}
  \hfill
  {\PM@TocTitleThumbFont #3}%
  \par\vspace{-2pt}
}
\newcommand*\chaptertoc[3]{%
  \par\addvspace{\bigskipamount}
  \setbox1=\hbox{\textcolor{PM@chaptertoc@color}{%
      \PM@TocChapterNumberFont #1
    }%
  }%
  \ifx\relax#1\relax\else
    \setbox2=\hbox{\textcolor{PM@chaptertoc@color}{%
        \PM@TocChapterFont \PM@shortchapapp\
      }%
    }%
    \@tempdima=\ht1
    \advance\@tempdima -\ht2
    \rput(0,0){\box2\raisebox{-\@tempdima}{\box1}}
  \fi
  \hspace*{10mm}%
  \begin{minipage}[t]{\linewidth-20mm}%
    \textcolor{PM@chaptertoc@color}{\PM@TocChapterTitleFont #2}%
    \hfill
    \hbox to0pt{\hspace*{10.5mm}%
      \llap{\textcolor{PM@chaptertoc@color}{\PM@TocChapterTitleFont #3}}%
      \hss
    }%
  \end{minipage}
  \par
}
\newcommand\PM@tocbulletcolor[1]{%
  \textcolor{#1}{\Large$\cdot$}%
  \hspace{1.5mm}%
}
\newcommand*\thumbtoc[2]{%
  \hspace*{10mm}%
  {\PM@TocTitleThumbFont \PM@tocbulletcolor#1}%
  \hfill
  {\PM@TocTitleThumbFont #2}%
  \par\vspace{-2pt}
}
\newcommand\PM@tocemptycolor[1]{%
  \textcolor{#1}{\hphantom{$\bullet$}}%
  \hspace{1.5mm}%
}
\newcommand*\thematoc[2]{%
  \hspace*{10mm}%
  {\PM@thematoc@format#1\@nil}%
  \par\vspace{4pt}
}
\def\PM@thematoc@format#1#2\@nil{%
  \textcolor{#1}{\PM@TocTitleThemaFont(#2\unskip)}%
}
\renewcommand*\cleardoublepage{%
  \clearpage
  \ifodd\c@page\else
    \thispagestyle{empty}%
    \hbox{}\newpage
  \fi
}
\newcommand*\clearevendoublepage{%
  \clearpage
  \ifodd\c@page
    \thispagestyle{empty}%
    \hbox{}\newpage
  \fi
}
\newcommand*\setthumb[1]{%
  \def\PM@thumbdefault{#1}%
}
\setthumb{B/Cours,O/Interros,G/Corrig\'es*}
\newcommand*\setspecialthumb[1]{%
  \def\PM@specialthumbdefault{#1}%
}
\setspecialthumb{O/Sujet,G/Corrig\'e*}
\newcount\PM@thumbmax
\newcount\PM@thumbcurr
\newcommand*\PM@getthumb{%
  \PM@thumbmax \z@
  \PM@@getthumb
}
\def\PM@@getthumb#1,{%
  \ifnot@nil{#1}{%
    \advance\PM@thumbmax \@ne
    \PM@@@getthumb#1*\nil
  }%
}
\def\PM@@@getthumb#1/#2*#3\nil{%
  \@namedef{PM@thumbcolor\the\PM@thumbmax}{#1}%
  \@namedef{PM@thumb\the\PM@thumbmax}{#2}%
  \ifx\relax#3\relax
    \@namedef{PM@@thumb\the\PM@thumbmax}{o}%
  \else
    \@namedef{PM@@thumb\the\PM@thumbmax}{*}%
  \fi
  \PM@@getthumb
}
\newcounter{part}
\renewcommand*\thepart{\@arabic\c@part}
\newcounter{chapter}
\renewcommand*\thechapter{\@arabic\c@chapter}
\newcounter{section}[chapter]
\renewcommand*\thesection{\@arabic\c@section}
\newcounter{subsection}[section]
\renewcommand*\thesubsection{\thesection.\@arabic\c@subsection}
\newcounter{subsubsection}[subsection]
\renewcommand*\thesubsubsection{\thesubsection.\@arabic\c@subsubsection}
\newcounter{paragraph}[subsubsection]
\renewcommand*\theparagraph{\thesubsubsection.\@arabic\c@paragraph}
\newcounter{subparagraph}[paragraph]
\renewcommand*\thesubparagraph{\theparagraph.\@arabic\c@subparagraph}
\newlength{\PM@SkipAboveThema}
\setlength{\PM@SkipAboveThema}{0mm plus1\p@}
\newlength{\PM@SkipBelowThema}
\setlength{\PM@SkipBelowThema}{-2mm plus1\p@}
\newlength{\PM@SkipAboveSection}
\setlength{\PM@SkipAboveSection}{8mm plus1\p@}
\newlength{\PM@SkipBelowSection}
\setlength{\PM@SkipBelowSection}{2mm plus1\p@}
\newlength{\PM@SkipAboveSubSection}
\setlength{\PM@SkipAboveSubSection}{4mm plus1\p@}
\newlength{\PM@SkipBelowSubSection}
\setlength{\PM@SkipBelowSubSection}{2mm plus1\p@}
\newlength{\PM@SkipAboveSubSubSection}
\setlength{\PM@SkipAboveSubSubSection}{3mm plus1\p@}
\newlength{\PM@SkipBelowSubSubSection}
\setlength{\PM@SkipBelowSubSubSection}{2mm plus1\p@}
\newlength{\PM@SkipAboveParagraph}
\setlength{\PM@SkipAboveParagraph}{2mm plus1\p@}
\newlength{\PM@SkipBelowParagraph}
\setlength{\PM@SkipBelowParagraph}{1mm plus1\p@}
\newlength{\PM@SkipAboveSubParagraph}
\setlength{\PM@SkipAboveSubParagraph}{2mm plus1\p@}
\newlength{\PM@SkipBelowSubParagraph}
\setlength{\PM@SkipBelowSubParagraph}{1mm plus1\p@}
\newcommand*\PM@part{}
\newcommand*\part[2][]{%
  \ifmainmatter
    \cleardoublepage
    \renewcommand*\PM@part{#2}%
    \pagestyle{partmain}%
    \thispagestyle{firstpartmain}%
    \refstepcounter{part}%
    \begingroup
      \let\\\space
      \addtocontents{toc}{%
        \protect\parttoc{\the\c@part}
        {#2}
        {\the\c@page}%
      }%
    \endgroup
    \vspace*{5mm}
    \textcolor{PM@parthead@color}{\PM@PartHeadFont\PM@Letter{\c@part} partie}
    \par\vspace{5mm}
    {%
      \PM@PartTitleFont
      \textcolor{PM@parttitle@color}{\MakeUppercase{#2}}
      \par
    }%
    \cleardoublepage
  \else
    \ClassError{Prepamath}{Les parties ne peuvent se trouver que dans
      la partie mainmatter}{}
  \fi
}
\gdef\PM@chapter{}
\newwrite\tf@chaptertoc
\def\@startchaptertoc#1{%
  \begingroup
    \makeatletter
    \immediate\closeout \tf@chaptertoc
    \@input{\jobname.toc#1}%
    \immediate\openout \tf@chaptertoc \jobname.toc#1\relax
    \@nobreakfalse
  \endgroup
}
\newcommand*\chapter[2][\PM@thumbdefault]{%
  \global\PM@specialfalse
  \ifmainmatter
    \cleardoublepage
    \global\PM@introfalse
    \gdef\PM@chapter{#2}%
    \pagestyle{chaptermain}%
    \thispagestyle{firstchaptermain}%
    \refstepcounter{chapter}%
    \PM@thumbcurr \@ne
    \expandafter\PM@getthumb#1,\@nil,%
    \edef\PM@tmp{\csname PM@thumbcolor\the\PM@thumbcurr\endcsname}%
    \edef\PM@thumb@dcolor{D\PM@tmp}%
    \edef\PM@thumb@mcolor{M\PM@tmp}%
    \edef\PM@thumb@lcolor{L\PM@tmp}%
    \PM@SetWarningLike
    \begingroup
      \let\\\space
      \ifappendix
        \write\@auxout{\global\advance\PM@nbappendix 1}%
        \addtocontents{toc}{%
          \protect\appendixtoc{\the\c@chapter}
          {#2}
          {\the\c@page}%
        }
      \else
        \addtocontents{toc}{%
          \protect\chaptertoc{\the\c@chapter}
          {#2}
          {\the\c@page}%
        }
      \fi
    \endgroup
    \savebox{\PM@box}{%
      \PM@ChapterFont
      \parbox[b]{8.5cm}{\raggedright #2}%
    }%
    \psframe[linewidth=0.5pt, linecolor=\PM@thumb@dcolor,
      fillstyle=solid, fillcolor=\PM@thumb@dcolor]
      (0,0)(4.5mm,\ht\PM@box)%
    \kern4.5mm
    {{\color{\PM@thumb@dcolor}\vrule width1pt}}
    \kern2mm
    \minipage[t]{9cm}%
      \usebox{\PM@box}\par\vspace{4mm}
      \psframebox[cornersize=absolute, linearc=1mm,
          linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@dcolor]
        {%
          \PM@MiniTocTitleFont
          \textcolor{white}{Plan \PM@planchapapp}%
        }\par\vspace{3mm}
      \@startchaptertoc{\thechapter}%
      \vspace*{-12pt}
    \endminipage
    \par\addvspace{\bigskipamount}
  \else
    \clearpage
    \global\PM@introfalse
    \gdef\PM@chapter{#2}%
    \pagestyle{chapternomain}%
    \thispagestyle{firstchapternomain}%
    \vspace*{1cm}
  \fi
  \@ifnextchar\thema{\PM@ThemaAfterChaptertrue}{\PM@chaptertocthumb}%
}
\newif\ifPM@ThemaAfterChapter
\newcommand\PM@chaptertocthumb{%
  \begingroup
    \let\\\space
    \ifmainmatter
      \addtocontents{toc}{%
        \protect\thumbtoc{%
          {\PM@thumb@dcolor}\csname PM@thumb1\endcsname
        }{\the\c@page}%
      }%
    \fi
  \endgroup
}
\newcommand*\chapintro[2][\PM@thumbdefault]{%
  \ifmainmatter
    \cleardoublepage
    \global\PM@introtrue
    \gdef\PM@chapter{#2}%
    \pagestyle{introchapter}%
    \thispagestyle{firstintrochapter}%
    \PM@thumbcurr \@ne
    \expandafter\PM@getthumb#1,\@nil,%
    \edef\PM@tmp{\csname PM@thumbcolor\the\PM@thumbcurr\endcsname}%
    \edef\PM@thumb@dcolor{D\PM@tmp}%
    \edef\PM@thumb@mcolor{M\PM@tmp}%
    \edef\PM@thumb@lcolor{L\PM@tmp}%
    \PM@SetWarningLike
    \begingroup
      \let\\\space
      \addtocontents{toc}{%
        \protect\chaptertocintro{}
                               {#2}
                               {\the\c@page}%
      }
    \endgroup
    \savebox{\PM@box}{%
      \PM@ChapterFont
      \parbox[b]{8.5cm}{\raggedright #2}%
    }%
    \psframe[linewidth=0.5pt, linecolor=\PM@thumb@dcolor,
      fillstyle=solid, fillcolor=\PM@thumb@dcolor]
      (0,0)(4.5mm,\ht\PM@box)%
    \kern4.5mm
    {{\color{\PM@thumb@dcolor}\vrule width1pt}}
    \kern2mm
    \minipage[t]{9cm}%
      \usebox{\PM@box}\par\vspace{4mm}
      \psframebox[cornersize=absolute, linearc=1mm,
          linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@dcolor]
        {%
          \PM@MiniTocTitleFont
          \textcolor{white}{Plan \PM@planchapapp}%
        }\par\vspace{3mm}
      \@startchaptertoc{\thechapter}%
      \vspace*{-12pt}
    \endminipage
    \par\addvspace{\bigskipamount}
  \else
    \par
  \fi
  \@ifnextchar\thema{\PM@ThemaAfterChaptertrue}{\PM@chaptertocthumb}%
}
\newcommand*\simplechapter[2][R]{%
  \global\PM@specialfalse
  \global\PM@thumbcurr\@ne
  \edef\PM@thumb@dcolor{D#1}%
  \edef\PM@thumb@mcolor{M#1}%
  \edef\PM@thumb@lcolor{L#1}%
  \ifmainmatter
    \cleardoublepage
    \global\PM@introfalse
    \gdef\PM@chapter{#2}%
    \pagestyle{simplechaptermain}%
    \thispagestyle{firstsimplechaptermain}%
    \refstepcounter{chapter}%
    \PM@SetWarningLike
    \begingroup
      \let\\\space
      \ifappendix
        \write\@auxout{\global\advance\PM@nbappendix 1}%
        \addtocontents{toc}{%
          \protect\appendixtoc{\the\c@chapter}
                              {#2}
                              {\the\c@page}%
        }
      \else
        \addtocontents{toc}{%
          \protect\chaptertoc{\the\c@chapter}
                             {#2}
                             {\the\c@page}%
        }
      \fi
    \endgroup
    \savebox{\PM@box}{%
      \PM@ChapterFont
      \parbox[b]{8.5cm}{\raggedright #2}%
    }%
    \psframe[linewidth=0.5pt, linecolor=\PM@thumb@dcolor,
      fillstyle=solid, fillcolor=\PM@thumb@dcolor]
      (0,0)(4.55mm,\ht\PM@box)%
    \kern6.5mm
    \usebox{\PM@box}
    \par\addvspace{1cm}
  \else
    \clearpage
    \global\PM@introfalse
    \gdef\PM@chapter{#2}%
    \pagestyle{simplechapternomain}%
    \thispagestyle{firstsimplechapternomain}%
    \vspace*{1cm}
  \fi
}
\newcommand*\devoirsynthese[3][\PM@specialthumbdefault]{%
  \ifmainmatter
    \cleardoublepage
    \gdef\PM@chapter{#3}%
    \ifx\PM@chapter\empty
      \gdef\PM@chapter{#2}%
    \fi
    \global\PM@specialtrue
    \pagestyle{specialchapter}%
    \gdef\PM@SpecialTitle{#2}%
    \thispagestyle{firstspecialchapter}%
    \refstepcounter{chapter}%
    \PM@thumbcurr \@ne
    \expandafter\PM@getthumb#1,\@nil,%
    \edef\PM@tmp{\csname PM@thumbcolor\the\PM@thumbcurr\endcsname}%
    \edef\PM@thumb@dcolor{D\PM@tmp}%
    \edef\PM@thumb@mcolor{M\PM@tmp}%
    \edef\PM@thumb@lcolor{L\PM@tmp}%
    \begingroup
      \let\\\space
      \ifappendix
        \write\@auxout{\global\advance\PM@nbappendix 1}%
        \addtocontents{toc}{%
          \protect\appendixtoc{\the\c@chapter}
                             {#2}
                             {\the\c@page}%
        }
      \else
        \addtocontents{toc}{%
          \protect\chaptertoc{\the\c@chapter}
                             {#2}
                             {\the\c@page}%
        }
      \fi
    \endgroup
    \savebox{\PM@box}{%
      \PM@SpecialChapterFont
      \parbox[b]{8.5cm}{\raggedright #3}%
    }%
    \par\vspace{10mm}
    \ifdim\ht\PM@box=\z@
      \kern6.9mm~
    \else
      \psframe[linewidth=0.5pt, linecolor=\PM@thumb@dcolor,
        fillstyle=solid, fillcolor=\PM@thumb@dcolor]
        (0,0)(4.5mm,\ht\PM@box)%
      \kern6.5mm
      \minipage[t]{9cm}%
        \usebox{\PM@box}\par\vspace{4mm}
      \endminipage
    \fi
    \PM@SetWarningLike
    \par\addvspace{48pt}
  \else
    \ClassError{prepamath}{La commande \string\devoirsynthese doit ^^c3^^aatre
      appelee dans la partie \string\mainmatter}{Vous avez oublie de
      specifier \string\mainmatter ou la commande \string\devoirsynthese
      suit un \string\frontmatter ou un \string\backmatter ce qui est
      interdit.}%
  \fi
  \@ifnextchar\thema{\PM@ThemaAfterChaptertrue}{\PM@chaptertocthumb}%
}
\newcommand*\thumb{%
  \ifmainmatter
    \clearpage
    \advance\PM@thumbcurr \@ne
    \ifnum\PM@thumbcurr > \PM@thumbmax
      \ClassError{prepamath}{Il n'y a que \the\PM@thumbmax\space onglets
        dans le chapitre courant}{La commande \string\thumb est appelee
        trop de fois dans ce chapitre.}%
    \else
      \edef\PM@tmp{\csname PM@thumbcolor\the\PM@thumbcurr\endcsname}%
      \edef\PM@thumb@dcolor{D\PM@tmp}%
      \edef\PM@thumb@mcolor{M\PM@tmp}%
      \edef\PM@thumb@lcolor{L\PM@tmp}%
      \PM@SetWarningLike
      \begingroup
      \let\\\space
      \ifPM@special
        \addtocontents{toc}{%
          \protect\thumbtoc{%
            {\PM@thumb@dcolor}%
            \csname PM@thumb\the\PM@thumbcurr\endcsname
          }
          {\the\c@page}%
        }%
      \else
        \addtocontents{toc}{%
          \protect\thumbtoc{%
            {\PM@thumb@dcolor}%
            \csname PM@thumb\the\PM@thumbcurr\endcsname
          }
          {\the\c@page}%
        }%
      \fi
      \endgroup
    \fi
  \else
    \ClassWarning{prepamath}{La commande \string\thumb\space n'a
      aucune action en dehors de la partie mainmatter.}
  \fi
}
\newcommand*\PM@displaythumb{%
  \textcolor{PM@section@color}
            {\PM@DisplayThumbFont\csname PM@thumb\the\PM@thumbcurr\endcsname}
  \par\vspace{\medskipamount}
}
\newcommand*\subthumb[1]{%
  \par
  \textcolor{PM@section@color}
            {\PM@DisplaySubThumbFont #1}
  \par\vspace{\medskipamount}
}
\newcommand*\thema[1]{%
  \PM@ManyThema#1,\@nil
  \par\addvspace{\PM@SkipAboveThema}\goodbreak
  {\PM@ThemaFont \PM@ThemaTitle #1}%
  \begingroup
    \let\\\space
    \addtocontents{toc}{%
      \protect\thematoc{%
        {\PM@thematoc@color}#1
      }%
      {\the\c@page}%
    }%
  \endgroup
  \ifPM@ThemaAfterChapter
    \begingroup
      \let\\\space
      \ifmainmatter
        \addtocontents{toc}{%
          \protect\thumbtoc{%
            {\PM@thumb@dcolor}\csname PM@thumb1\endcsname
          }{\the\c@page}%
        }%
      \fi
    \endgroup
  \fi
  \PM@ThemaAfterChapterfalse
  \par\nobreak\addvspace{\PM@SkipBelowThema}
}
\def\PM@ManyThema#1,#2\@nil{%
  \ifx\relax#2\relax
    \def\PM@ThemaTitle{Th\`eme : }%
  \else
    \def\PM@ThemaTitle{Th\`emes : }%
  \fi
}
\newlength{\PM@NumberSectionWidth}
\setlength{\PM@NumberSectionWidth}{5mm}
\newcommand*\PM@StrutSection{%
  \vrule width\z@ height 9\p@ depth\z@\relax
}
\newcommand*\section[1]{%
  \par\addvspace{\PM@SkipAboveSection}\goodbreak
  \ifmainmatter
    \refstepcounter{section}%
    \begin{lrbox}{\PM@box}%
      \psframebox[cornersize=absolute,
        linearc=1mm, linestyle=none,
        fillstyle=solid, framesep=2pt,
        fillcolor=\PM@thumb@dcolor]{%
          \hbox to \PM@NumberSectionWidth{%
            \hss
            \PM@StrutSection
            \PM@SectionNumberFont
            \textcolor{white}{\thesection}%
            \hss
          }%
        }%
        \hspace*{0.5em}%
    \end{lrbox}%
    \hangindent=\wd\PM@box
    \raisebox{1.5\p@}{\usebox{\PM@box}}%
    {\PM@SectionFont#1}%
    \protected@write\tf@chaptertoc
      {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble\let\\\space}%
      {%
        \protect\PM@MiniTocNumberFont
        \thesection.
        \protect\PM@MiniTocFont #1\protect\\[1mm]
      }%
  \else
    {\textcolor{PM@sectionnomain@color}{%
        \PM@FrontSectionFont #1}%
    }%
  \fi
  \par\nobreak\addvspace{\PM@SkipBelowSection}
}
\newcommand*\subsection[1]{%
  \ifmainmatter
    \par\addvspace{\PM@SkipAboveSubSection}\goodbreak
    \refstepcounter{subsection}
    \begin{lrbox}{\PM@box}%
       \psframebox[cornersize=absolute,
        linearc=1mm, linestyle=none, framesep=2pt,
        fillstyle=solid, fillcolor=\PM@thumb@dcolor]{%
          \hbox to\PM@NumberSectionWidth{\hss
            \PM@StrutSection
            \PM@SubSectionNumberFont
            \textcolor{white}{\thesubsection}%
            \hss
          }%
        }%
      \hspace*{0.3em}%
    \end{lrbox}%
    \hangindent \wd\PM@box
    \raisebox{1.5\p@}{\usebox{\PM@box}}%
    {\PM@SubSectionFont\textcolor{\PM@thumb@dcolor}{#1}}%
    \par\nobreak\addvspace{\PM@SkipBelowSubSection}
  \else
    \ClassError{prepamath}{la commande \string\subsection\space
      n'est permise que dans la partie mainmatter}{}%
  \fi
}
\newcommand*\subsubsection[1]{%
  \ifmainmatter
    \par\addvspace{\PM@SkipAboveSubSubSection}\goodbreak
    \refstepcounter{subsubsection}
    \begin{lrbox}{\PM@box}%
      \PM@SubSubSectionNumberFont
      \textcolor{\PM@thumb@dcolor}{\thesubsubsection~-~}%
    \end{lrbox}%
    \hangindent \wd\PM@box
    \usebox{\PM@box}%
    {\PM@SubSubSectionFont\textcolor{\PM@thumb@dcolor}{#1}}
    \par\nobreak\addvspace{\PM@SkipBelowSubSubSection}
  \else
    \ClassError{prepamath}{la commande \string\subsubsection\space
      n'est permise que dans la partie mainmatter}{}%
  \fi
}
\newcommand*\paragraph[1]{%
  \ifmainmatter
    \par\addvspace{\PM@SkipAboveParagraph}\goodbreak
    \refstepcounter{paragraph}
    \begin{lrbox}{\PM@box}%
      \PM@ParagraphNumberFont
      \textcolor{\PM@thumb@dcolor}{\theparagraph~-~}%
    \end{lrbox}%
    \hangindent \wd\PM@box
    \usebox{\PM@box}%
    {\PM@ParagraphFont\textcolor{\PM@thumb@dcolor}{#1}}
    \par\nobreak\addvspace{\PM@SkipBelowParagraph}
  \else
    \ClassError{prepamath}{La commande \string\paragraph\space
      n'est permise que dans la partie mainmatter}{}%
  \fi
}
\newcommand*\subparagraph[1]{%
  \ifmainmatter
    \refstepcounter{subparagraph}
    \par\addvspace{\PM@SkipAboveSubParagraph}\goodbreak
    \begin{lrbox}{\PM@box}%
      \PM@SubParagraphNumberFont
      \textcolor{\PM@thumb@dcolor}{\thesubparagraph~-~}%
    \end{lrbox}%
    \hangindent \wd\PM@box
    \usebox{\PM@box}%
    {\PM@SubParagraphFont\textcolor{\PM@thumb@dcolor}{#1}}
    \par\nobreak\addvspace{\PM@SkipBelowSubParagraph}
  \else
    \ClassError{prepamath}{la commande \string\subparagraph\space
      n'est permise que dans la partie mainmatter}{}%
  \fi
}
\newcommand*\sectionnn[1]{%
  \par\addvspace{\PM@SkipAboveSection}%
  \ifmainmatter
    {\PM@SectionFont#1}%
  \else
    {\textcolor{PM@section@color}{%
        \PM@FrontSectionFont #1}%
    }%
  \fi
  \par\nobreak\addvspace{\PM@SkipBelowSection}%
}
\newcommand*\subsectionnn[1]{%
  \ifmainmatter
    \par\addvspace{\PM@SkipAboveSubSection}
    {\PM@SubSectionFont #1}%
    \par\nobreak\addvspace{\PM@SkipBelowSubSection}
  \else
    \ClassError{prepamath}{la commande \string\subsectionnn\space
      n'est permise que dans la partie mainmatter}{}%
  \fi
}
\newcommand*\subsubsectionnn[1]{%
  \ifmainmatter
    \par\addvspace{\PM@SkipAboveSubSubSection}
    {\PM@SubSubSectionFont #1}%
    \par\nobreak\addvspace{\PM@SkipBelowSubSubSection}
  \else
    \ClassError{prepamath}{la commande \string\subsubsectionnn\space
      n'est permise que dans la partie mainmatter}{}%
  \fi
}
\newcommand*\paragraphnn[1]{%
  \ifmainmatter
    \par\addvspace{\PM@SkipAboveParagraph}
    {\PM@ParagraphFont #1}%
    \par\nobreak\addvspace{\PM@SkipBelowParagraph}
  \else
    \ClassError{prepamath}{La commande \string\paragraphnn\space
      n'est permise que dans la partie mainmatter}{}%
  \fi
}
\newcommand*\subparagraphnn[1]{%
  \ifmainmatter
    \par\addvspace{\PM@SkipAboveSubParagraph}
    {\PM@SubParagraphFont #1}%
    \par\nobreak\addvspace{\PM@SkipBelowSubParagraph}
  \else
    \ClassError{prepamath}{la commande \string\subparagraphnn\space
      n'est permise que dans la partie mainmatter}{}%
  \fi
}
\newcommand*\see[2]{\emph{\seename} #1}
\providecommand*\seealso[2]{\emph{\alsoname} #1}
\newcommand\printindex{\@input@{\jobname.ind}}
\providecommand\seename{voir}
\providecommand*\alsoname{voir \'egalement}
\newenvironment{theindex}
{%
  \ifappendix
  \else
  \appendix
  \fi
  \let\item\@idxitem
  \newgeometry{%
    twoside=false,
    left=13mm, right=13mm,
    top= 30mm, bottom=20mm,
    marginparsep=0mm, marginparwidth=0mm,
    hoffset=2.5cm, voffset=1.85cm
  }
  \renewcommand*\PM@shiftoddpage{%
    \setlength{\@tempdima}{-13mm}%
    \setlength{\@tempdimb}{1in+\topmargin+\headheight+\headsep-4.5pt}%
  }
  \renewcommand*\PM@shiftevenpage{%
    \setlength{\@tempdima}{-13mm}%
    \setlength{\@tempdimb}{1in+\topmargin+\headheight+\headsep-4.5pt}%
  }
  \simplechapter{Index}
  \setlength{\columnsep}{18pt}%
  \begin{multicols}{2}
}
{%
  \end{multicols}
  \restoregeometry
}
\newcommand\@idxitem{\par\hangindent 40\p@}
\newcommand\subitem{\@idxitem \hspace*{20\p@}}
\newcommand\subsubitem{\@idxitem \hspace*{30\p@}}
\newcommand\indexspace{}
\newcommand\pfill{%
  \unskip~\dotfill\penalty500
  \strut\nobreak
  \dotfil~\ignorespaces\raggedleft
}
\newcommand\efill{\hfill\nopagebreak}
\newcommand*\dotfil{%
  \leaders\hbox to.6em{\hss .\hss}\hfil
}
\newif\ifscan@allowed
\makeindex
\newcommand\PM@singleline{%
  \psline(0.2,0)(1.2,0)
  \psline(1,0.2)(1,-0.2)
  \pscircle(1,0){0.2}
}
\newcommand\PM@realpage{%
  \count@ \c@page
  \advance\count@ \PM@shiftpage
  \the\count@
}
\newcommand\PM@crop[2]{%
  \if#1l%
    \if#2t%
      \rput{180}(\@tempdima,\@tempdimb){%
        \PM@singleline
      }%
      \rput{90}(\@tempdima,\@tempdimb){%
        \PM@singleline
      }%
      \normalfont \normalcolor
      \rput(0.5\linewidth,\@tempdimb){%
        \rput(0,1.1){\small\PM@title
          \quad---\quad v. \PM@version}
        \rput(0,0.7){\small \PM@date
          \quad---\quad
          \ifmainmatter
            \ifnum\c@chapter>\z@
              \ifPM@special
                \PM@chapapp\space\thechapter\space
              \else
                \PM@chapapp\space\thechapter\space
              \fi
            \fi
          \fi
          page \the\c@page
          \quad---\quad \#\PM@realpage}
      }
    \else
      \rput{180}(\@tempdima,\@tempdimb){%
        \PM@singleline
      }%
      \rput{270}(\@tempdima,\@tempdimb){%
        \PM@singleline
      }%
    \fi
  \else
    \if#2t%
      \rput{0}(\@tempdima,\@tempdimb){%
        \PM@singleline
      }%
      \rput{90}(\@tempdima,\@tempdimb){%
        \PM@singleline
      }%
    \else
      \rput{0}(\@tempdima,\@tempdimb){%
        \PM@singleline
      }%
      \rput{270}(\@tempdima,\@tempdimb){%
        \PM@singleline
      }%
    \fi
  \fi
}
\newcommand*\PM@testcrop{%
  \ifPM@crop
    \begin{pspicture}(0,0)
      \psset{linewidth=0.2pt}
      \PM@crop lt%
      \addtolength{\@tempdima}{\paperwidth}\PM@crop rt%
      \addtolength{\@tempdimb}{-\paperheight}\PM@crop rb%
      \addtolength{\@tempdima}{-\paperwidth}\PM@crop lb%
    \end{pspicture}%
  \fi
}
\newcommand*\PM@shiftoddpage{%
    \setlength{\@tempdima}{-23mm}%
    \setlength{\@tempdimb}{1in+\topmargin+\headheight+\headsep-4.5pt}%
}
\newcommand*\PM@shiftevenpage{%
    \setlength{\@tempdima}{-23mm}%
    \setlength{\@tempdimb}{1in+\topmargin+\headheight+\headsep-4.5pt}%
}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\ifPM@rabat
  \fancypagestyle{empty}{\fancyhf{}}
\else
  \fancypagestyle{empty}{%
    \fancyhf{}%
    \fancyhead[LO]{%
      \PM@shiftoddpage
      \PM@testcrop
    }%
    \fancyhead[LE]{%
      \PM@shiftevenpage
      \PM@testcrop
    }%
  }
\fi
\fancypagestyle{firstpartmain}{%
  \fancyhf{}%
  \fancyhead[LO]{%
    \PM@shiftoddpage
    \PM@testcrop
  }%
  \fancyhead[LE]{%
    \PM@shiftevenpage
    \PM@testcrop
  }%
}
\fancypagestyle{partmain}{%
  \fancyhf{}%
  \fancyhead[LO]{%
    \PM@shiftoddpage
    \PM@testcrop
  }%
  \fancyhead[LE]{%
    \PM@shiftevenpage
    \PM@testcrop
  }%
}
\fancypagestyle{firstchapternomain}{%
  \fancyhf{}%
  \fancyhead[LO]{%
    \PM@shiftoddpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
      \rput(\paperwidth,0){%
        \pspolygon[linestyle=none, fillstyle=solid,
          fillcolor=PM@headnomain@color, linearc=5mm]
            (-60mm,5mm)(5mm,5mm)
            (5mm,-30mm)(-61mm,-25mm)
        \rput(-33mm,-15mm){%
          \color{white}%
          \parbox{42mm}{%
            \raggedleft
            \PM@HeadFrontChapterFont \PM@chapter
          }%
        }%
      }%
    }%
  }%
  \fancyhead[LE]{%
    \PM@shiftevenpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
      \pspolygon[linestyle=none, fillstyle=solid,
        fillcolor=PM@headnomain@color, linearc=5mm]
        (-0.035\paperwidth,5mm)(60mm,5mm)
        (61mm,-25mm)(-0.035\paperwidth,-30mm)
      \rput(33mm,-15mm){%
        \color{white}%
        \PM@HeadFrontChapterFont
        \parbox{42mm}{\hspace*{0pt}\PM@chapter}%
      }%
    }%
  }%
}
\fancypagestyle{chapternomain}{%
  \fancyhf{}%
  \fancyhead[LO]{%
    \PM@shiftoddpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
    }
  }%
  \fancyhead[LE]{%
    \PM@shiftevenpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
    }%
  }%
}
\fancypagestyle{firstchaptermain}{%
  \fancyhf{}%
  \fancyhead[LO]{%
    \PM@shiftoddpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
      \rput(\paperwidth,0){%
        \pspolygon[linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@dcolor, linearc=5mm]
            (-38mm,5mm)(5mm,5mm)
            (5mm,-40mm)(-40mm,-35mm)
        \rput(-20mm,-17mm){%
          \color{white}%
          \parbox{42mm}{%
            \centering
            \ifPM@special
%%%              \PM@HeadFrontChapterFont \PM@SpecialTitle
      \ifPM@intro
\PM@HeadFrontChapterFont Introduction
      \else
                \PM@HeadFirstChapterFont \PM@chapapp
                \ifappendix
                  \ifnum\PM@nbappendix>1
                    \ \PM@HeadFirstChapterFont \thechapter
                    \rput(0mm,-\paperheight){%
                      \psframe[linestyle=none, fillstyle=solid,
                      fillcolor=\PM@thumb@dcolor,framearc=0.2]
                      (13.5mm,25.5mm)(-2.5mm,31.5mm)
                      \rput(0mm,28.5mm){%
                        \PM@FootPageFont
                        \textcolor{white}{\the\c@page}}%
                    }%
                  \fi
                \else
                  \\[-6pt]%
                  \PM@HeadFirstChapterNumberFont \thechapter
                \fi
      \fi
            \else
      \ifPM@intro
\PM@HeadFrontChapterFont Introduction
      \else
                \PM@HeadFirstChapterFont \PM@chapapp
                \ifappendix
                  \ifnum\PM@nbappendix>1
                    \ \PM@HeadFirstChapterFont \thechapter
                    \rput(0mm,-\paperheight){%
                      \psframe[linestyle=none, fillstyle=solid,
                      fillcolor=\PM@thumb@dcolor,framearc=0.2]
                      (13.5mm,25.5mm)(-2.5mm,31.5mm)
                      \rput(0mm,28.5mm){%
                        \PM@FootPageFont
                        \textcolor{white}{\the\c@page}}%
                    }%
                  \fi
                \else
                  \\[-6pt]%
                  \PM@HeadFirstChapterNumberFont \thechapter
                \fi
      \fi
            \fi
          }%
        }%
      }%
    }%
  }%
  \fancyhead[LE]{%
    \PM@shiftevenpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
    }%
  }%
}
\fancypagestyle{chaptermain}{%
  \fancyhf{}%
  \fancyhead[LO]{%
    \PM@shiftevenpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
      \expandafter\if\csname PM@@thumb\the\PM@thumbcurr\endcsname*\relax
       \psframe[linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@lcolor]
          (-0.035\paperwidth,5mm)(1.035\paperwidth,-1.025\paperheight)
        \def\PM@fillcolor{\PM@thumb@dcolor}%
        \def\PM@textcolor{white}%
        \def\PM@linestyle{none}%
        \def\PM@linecolor{white}%
      \else
        \def\PM@fillcolor{\PM@thumb@dcolor}%
        \def\PM@textcolor{white}%
        \def\PM@linestyle{none}%
        \def\PM@linecolor{white}%
      \fi
      \ifnum\PM@thumbcurr>0
        \pspolygon[linestyle=\PM@linestyle, linecolor=\PM@linecolor,
          fillstyle=solid, fillcolor=\PM@fillcolor]
            (-0.035\paperwidth,5mm)
            (1.035\paperwidth,5mm)
            (1.035\paperwidth,-11mm)
            (-0.035\paperwidth,-11mm)
        \rput[Br](148mm,-7mm){%
          \PM@HeadNextChapterFont
          \ifappendix
            \textcolor{\PM@textcolor}{\MakeUppercase{\PM@shortchapapp}}
            \ifnum\PM@nbappendix>1
              \textcolor{\PM@textcolor}{\thechapter{}}
            \fi
            \textcolor{\PM@textcolor}{:}
            {\let\\\space
              \textcolor{\PM@textcolor}{\MakeUppercase{\PM@chapter}}%
            }
          \else
            \ifPM@special
%%%              \textcolor{\PM@textcolor}{\PM@chapter}%
              {\let\\\space
                \textcolor{\PM@textcolor}{\MakeUppercase{\PM@chapter}\ \
                  \pscircle*[linecolor=\PM@linecolor](0,0.5ex){2pt}\ \
                  \MakeUppercase{\PM@shortchapapp}. \thechapter
                }%
              }%
            \else
         \ifPM@intro
                {\let\\\space
           \textcolor{\PM@textcolor}{\MakeUppercase{\PM@chapter}}%
                }%
      \else
                {\let\\\space
                  \textcolor{\PM@textcolor}{\MakeUppercase{\PM@chapter}\ \
                    \pscircle*[linecolor=\PM@linecolor](0,0.5ex){2pt}\ \
                    \MakeUppercase{\PM@shortchapapp}. \thechapter
                  }%
                }%
              \fi
    \fi
          \fi
        }
      \else
        \ifPM@special
          \pspolygon[linestyle=\PM@linestyle, linecolor=\PM@linecolor,
            fillstyle=solid, fillcolor=\PM@fillcolor]
              (-0.035\paperwidth,5mm)
              (1.035\paperwidth,5mm)
              (1.035\paperwidth,-11mm)
              (-0.035\paperwidth,-11mm)
          \rput[Br](148mm,-7mm){%
            \PM@HeadNextChapterFont
            \textcolor{\PM@textcolor}{\PM@chapter}%
          }
        \else
          \ifPM@intro
            \rput[Br](148mm,-7mm){%
              \PM@HeadNextChapterFont
              \ifappendix
                \textcolor{\PM@textcolor}{\MakeUppercase{\PM@shortchapapp}}
                \ifnum\PM@nbappendix>1
                  \textcolor{\PM@textcolor}{\thechapter}
                \fi
                \textcolor{\PM@textcolor}{:}
                {\let\\\space
                  \textcolor{\PM@textcolor}{\MakeUppercase{\PM@chapter}}%
                }%
              \else
                {\let\\\space
                  \textcolor{PM@head@color}{\MakeUppercase{\PM@chapter}}%
                }%
              \fi
            }
          \else
            \rput[Br](148mm,-7mm){%
              \PM@HeadNextChapterFont
              \ifappendix
                \textcolor{\PM@textcolor}{\MakeUppercase{\PM@shortchapapp}}
                \ifnum\PM@nbappendix>1
                  \textcolor{\PM@textcolor}{\thechapter}
                \fi
                \textcolor{\PM@textcolor}{:}
                {\let\\\space
                  \textcolor{\PM@textcolor}{\MakeUppercase{\PM@chapter}}%
                }%
              \else
                {%
                  \let\\\space
                  \textcolor{PM@head@color}{\MakeUppercase{\PM@chapter}\ \
                    \pscircle*[linecolor=PM@head@color](0,0.5ex){2pt}\ \
                    \MakeUppercase{\PM@shortchapapp}. \thechapter
                  }%
                }%
              \fi
            }
          \fi
        \fi
      \fi
      \rput(\paperwidth,-\paperheight){%
        \psframe[linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@dcolor, framearc=0.2]
            (-11mm, 6mm)(5mm,12mm)
        \rput(-8.5mm,9mm){%
          \PM@FootPageFont
          \textcolor{white}{\the\c@page}}%
      }%
      \ifPM@special\else
        \count@=\PM@thumbmax
        \@tempcnta=\count@
        \advance\@tempcnta \@ne
        \loop
          \ifnum\count@=\PM@thumbcurr
            \def\PM@fillcolor{\PM@thumb@dcolor}%
            \def\PM@textcolor{white}%
            \def\PM@linestyle{none}%
          \else
            \def\PM@fillcolor{white}%
            \def\PM@textcolor{PM@thumbtext@color}%
            \def\PM@linestyle{solid}%
          \fi
          \dimen0=-3.6cm
          \multiply\dimen0 \count@
          \advance\dimen0 -4cm
          \rput(\paperwidth,\dimen0){%
            \resetcolorseries[10]{PM@ombre@color}
            \multido{\dx=0pt+0.25\pslinewidth,\dy=0pt+0.075\pslinewidth}{10}{%
              \ifnum\@tempcnta=\PM@thumbcurr
                \rput(-\dx,\dy){%
                  \pspolygon[linearc=0.35, linestyle=solid,
                             linecolor=PM@ombre@color!!+, fillstyle=none]
                    (-1,0.4)(0.5,0)(0.5,4.3)(-1,4.7)
                }
              \else
                \rput(-\dx,-\dx){%
                  \pspolygon[linearc=0.35, linestyle=solid,
                             linecolor=PM@ombre@color!!+, fillstyle=none]
                    (-1,0.4)(0.5,0)(0.5,4.3)(-1,4.7)
                }
              \fi
            }
            \pspolygon[linearc=0.35, linestyle=\PM@linestyle,
            linecolor=\PM@textcolor, fillstyle=solid,
            fillcolor=\PM@fillcolor]
              (-1,0.4)(0.5,0)(0.5,4.3)(-1,4.7)
            \rput{90}(-0.6,2.0){\textcolor{\PM@textcolor}{%
              \PM@ThumbFont
              \MakeUppercase{\@nameuse{PM@thumb\the\count@}}}}%
          }%
          \advance\count@ \m@ne
          \advance\@tempcnta \m@ne
        \ifnum\count@>\z@
        \repeat
      \fi
    }%
  }%
  \fancyhead[LE]{%
    \PM@shiftoddpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
      \expandafter\if\csname PM@@thumb\the\PM@thumbcurr\endcsname*\relax
        \psframe[linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@lcolor]
          (-0.035\paperwidth,5mm)(1.035\paperwidth,-1.025\paperheight)
        \def\PM@fillcolor{\PM@thumb@dcolor}%
        \def\PM@textcolor{white}%
        \def\PM@linestyle{none}%
        \def\PM@linecolor{white}%
      \else
        \def\PM@fillcolor{\PM@thumb@dcolor}%
        \def\PM@textcolor{white}%
        \def\PM@linestyle{none}%
        \def\PM@linecolor{white}%
      \fi
      \ifnum\PM@thumbcurr>0
        \ifPM@special
          \pspolygon[linestyle=\PM@linestyle, fillstyle=solid,
            fillcolor=\PM@fillcolor, linecolor= \PM@linecolor]
              (-0.035\paperwidth,5mm)
              (1.035\paperwidth,5mm)
              (1.035\paperwidth,-11mm)
              (-0.035\paperwidth,-11mm)
          \pspolygon[linestyle=\PM@linestyle, fillstyle=solid,
            fillcolor=\PM@fillcolor, linecolor= \PM@linecolor,
            linearc=5mm]
              (-0.035\paperwidth,5mm)
              (1.035\paperwidth,5mm)
              (1.035\paperwidth,-11mm)
              (14mm,-11mm)
              (14mm,-39mm)
              (-0.035\paperwidth,-42.42mm)
          \rput[B]{90}(10mm,-25mm){%
            \PM@ThumbEvenFont
              \textcolor{\PM@textcolor}{%
              \MakeUppercase{\@nameuse{PM@thumb\the\PM@thumbcurr}}%
            }%
          }%
        \else
          \pspolygon[linestyle=\PM@linestyle, fillstyle=solid,
            fillcolor=\PM@fillcolor, linecolor= \PM@linecolor,
            linearc=5mm]
              (-0.035\paperwidth,5mm)
              (1.035\paperwidth,5mm)
              (1.035\paperwidth,-11mm)
              (14mm,-11mm)
              (14mm,-39mm)
              (-0.035\paperwidth,-42.42mm)
          \rput[B]{90}(10mm,-25mm){%
            \PM@ThumbEvenFont
              \textcolor{\PM@textcolor}{%
              \MakeUppercase{\@nameuse{PM@thumb\the\PM@thumbcurr}}%
            }%
          }%
        \fi
      \else
        \ifPM@special
          \def\PM@fillcolor{PM@head@color}%
          \def\PM@textcolor{white}%
          \def\PM@linestyle{none}%
          \def\PM@linecolor{white}%
          \pspolygon[linestyle=\PM@linestyle, fillstyle=solid,
            fillcolor=\PM@fillcolor, linecolor= \PM@linecolor,
            linearc=5mm]
              (-0.035\paperwidth,5mm)
              (1.035\paperwidth,5mm)
              (1.035\paperwidth,-11mm)
              (14mm,-11mm)
              (14mm,-39mm)
              (-0.035\paperwidth,-42.42mm)
          \rput[B]{90}(10mm,-25mm){%
            \PM@ThumbEvenFont
              \textcolor{\PM@textcolor}{%
              \MakeUppercase{\@nameuse{PM@thumb\the\PM@thumbcurr}}%
            }%
          }%
        \fi
      \fi
      \rput(0mm,-\paperheight){%
        \psframe[linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@dcolor,framearc=0.2]
            (11mm,6mm)(-5mm,12mm)
        \rput(8.5mm,9mm){%
          \PM@FootPageFont
          \textcolor{white}{\the\c@page}}%
      }%
    }%
  }%
}
\fancypagestyle{firstsimplechapternomain}{%
  \fancyhf{}%
  \fancyhead[LO]{%
    \PM@shiftoddpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
      \rput(\paperwidth,0){%
        \pspolygon[linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@dcolor, linearc=5mm]
            (-60mm,5mm)(5mm,5mm)
            (5mm,-30mm)(-61mm,-25mm)
        \rput(-33mm,-15mm){%
          \color{white}%
          \parbox{42mm}{%
            \raggedleft
            \PM@HeadFrontChapterFont \PM@chapter
          }%
        }%
      }%
      \ifappendix
        \rput(0mm,-\paperheight){%
          \psframe[linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@dcolor,framearc=0.2]
          (13.5mm,25.5mm)(-2.5mm,31.5mm)
          \rput(0mm,28.5mm){%
            \PM@FootPageFont
            \textcolor{white}{\the\c@page}}%
        }%
      \fi
    }%
  }%
  \fancyhead[LE]{%
    \PM@shiftevenpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
      \pspolygon[linestyle=none, fillstyle=solid,
        fillcolor=\PM@thumb@dcolor, linearc=5mm]
        (-0.035\paperwidth,5mm)(60mm,5mm)
        (61mm,-25mm)(-0.035\paperwidth,-30mm)
      \rput(33mm,-15mm){%
        \color{white}%
        \PM@HeadFrontChapterFont
        \parbox{42mm}{\hspace*{0pt}\PM@chapter}%
      }%
    }%
  }%
}
\fancypagestyle{simplechapternomain}{%
  \fancyhf{}%
  \fancyhead[LO]{%
    \PM@shiftoddpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
    }
  }%
  \fancyhead[LE]{%
    \PM@shiftevenpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
    }%
  }%
}
\fancypagestyle{firstsimplechaptermain}{%
  \fancyhf{}%
  \fancyhead[LO]{%
    \PM@shiftoddpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
      \rput(\paperwidth,0){%
        \pspolygon[linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@dcolor, linearc=5mm]
            (-38mm,5mm)(5mm,5mm)
            (5mm,-40mm)(-40mm,-35mm)
        \rput(-20mm,-17mm){%
          \color{white}%
          \parbox{42mm}{%
            \centering
            \ifPM@special
              \PM@HeadFrontChapterFont \PM@SpecialTitle
            \else
      \ifPM@intro
\PM@HeadFrontChapterFont Introduction
      \else
                \PM@HeadFirstChapterFont \PM@chapapp
                \ifappendix
                  \ifnum\PM@nbappendix>1
                    \ \PM@HeadFirstChapterFont \thechapter
                  \fi
                  \rput(0mm,-\paperheight){%
                    \psframe[linestyle=none, fillstyle=solid,
                    fillcolor=\PM@thumb@dcolor,framearc=0.2]
                    (13.5mm,25.5mm)(-2.5mm,31.5mm)
                    \rput(0mm,28.5mm){%
                      \PM@FootPageFont
                      \textcolor{white}{\the\c@page}}%
                  }%
                \else
                  \\[-6pt]
                  \PM@HeadFirstChapterNumberFont \thechapter
                \fi
      \fi
            \fi
          }%
        }%
      }%
    }%
  }%
  \fancyhead[LE]{%
    \PM@shiftevenpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
    }%
  }%
}
\fancypagestyle{simplechaptermain}{%
  \fancyhf{}%
  \fancyhead[LO]{%
    \PM@shiftevenpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
      \def\PM@fillcolor{\PM@thumb@dcolor}%
      \def\PM@textcolor{white}%
      \def\PM@linestyle{none}%
      \def\PM@linecolor{white}%
      \iffalse
      \ifPM@special
        \pspolygon[linestyle=\PM@linestyle, linecolor=\PM@linecolor,
          fillstyle=solid, fillcolor=\PM@fillcolor]
            (-0.035\paperwidth,5mm)
            (1.035\paperwidth,5mm)
            (1.035\paperwidth,-11mm)
            (-0.035\paperwidth,-11mm)
        \rput[Br](148mm,-7mm){%
          \PM@HeadNextChapterFont
          \textcolor{\PM@textcolor}{\PM@chapter}%
        }
      \else
\ifPM@intro
  \rput[Br](148mm,-7mm){%
            \PM@HeadNextChapterFont
            {\let\\\space
              \textcolor{PM@head@color}{\MakeUppercase{\PM@chapter}}%
            }%
          }
\else
          \rput[Br](148mm,-7mm){%
            \PM@HeadNextChapterFont
            \ifappendix
              \textcolor{\PM@textcolor}{\MakeUppercase{\PM@shortchapapp}}
                \ifnum\PM@nbappendix>1
                  \textcolor{\PM@textcolor}{\thechapter}
                \fi
                \textcolor{\PM@textcolor}{:}
              {\let\\\space
                \textcolor{PM@head@color}{\MakeUppercase{\PM@chapter}}%
              }%
            \else
              {\let\\\space
                \textcolor{PM@head@color}{\MakeUppercase{\PM@chapter}\ \
                  \pscircle*[linecolor=PM@head@color](0,0.5ex){2pt}\ \
                  \MakeUppercase{\PM@shortchapapp}. \thechapter
                }%
              }%
            \fi
          }
\fi
      \fi
      \fi
      \ifodd\c@page
        \rput(\paperwidth,-\paperheight){%
          \psframe[linestyle=none, fillstyle=solid,
            fillcolor=\PM@thumb@dcolor,framearc=0.2]
              (-11mm, 6mm)(5mm,12mm)
          \rput(-8.5mm,9mm){%
            \PM@FootPageFont
            \textcolor{white}{\the\c@page}}%
        }%
      \else
        \rput(0mm,-\paperheight){%
          \psframe[linestyle=none, fillstyle=solid,
            fillcolor=\PM@thumb@dcolor,framearc=0.2]
              (11mm,6mm)(-5mm,12mm)
          \rput(8.5mm,9mm){%
            \PM@FootPageFont
            \textcolor{white}{\the\c@page}}%
        }%
      \fi
    }%
  }%
  \fancyhead[LE]{%
    \PM@shiftoddpage
    \PM@testcrop
    \rput(\@tempdima,\@tempdimb){%
      \def\PM@fillcolor{\PM@thumb@dcolor}%
      \def\PM@textcolor{white}%
      \def\PM@linestyle{none}%
      \def\PM@linecolor{white}%
      \rput(0mm,-\paperheight){%
        \psframe[linestyle=none, fillstyle=solid,
          fillcolor=\PM@thumb@dcolor,framearc=0.2]
            (11mm,6mm)(-5mm,12mm)
        \rput(8.5mm,9mm){%
          \PM@FootPageFont
          \textcolor{white}{\the\c@page}}%
      }%
    }%
  }%
}
\let\ps@firstspecialchapter\ps@firstchaptermain
\let\ps@specialchapter\ps@chaptermain
\let\ps@firstintrochapter\ps@firstchaptermain
\let\ps@introchapter\ps@chaptermain
\pagestyle{empty}
\parindent=0\p@
\parskip=1mm plus1\p@
\AtBeginDocument{%
  \flushbottom
  \ifPM@rabat
  \else
    \vspace*{\stretch{1}}
    {\centering\PM@BookTitleFont \PM@title\par}
    \vspace*{\stretch{1}}
    \thispagestyle{empty}
  \fi
}
\newenvironment{figure}{\par\minipage{\linewidth}}
                       {\endminipage\par}
\newenvironment{table}{\par\minipage{\linewidth}}
                      {\endminipage\par}
\newfixedcaption{\figcaption}{figure}
\newfixedcaption{\tabcaption}{table}
\arrayrulecolor{PM@arrayrule@color}
\arrayrulewidth=0.7\p@
\arraycolsep=5\p@
\tabcolsep=6\p@
\newcounter{figure}[chapter]
\renewcommand*\thefigure{\thechapter.\the\c@figure}
\newcounter{table}[chapter]
\renewcommand*\thetable{\thechapter.\the\c@table}
\newlength{\abovecaptionskip}
\newlength{\belowcaptionskip}
\setlength{\abovecaptionskip}{10\p@ plus1\p@}
\setlength{\belowcaptionskip}{0\p@ plus1\p@}
\newcommand*\ext@table{lot}
\newcommand*\ext@figure{lof}
\captionnamefont{\PM@CaptionFont}
\captiontitlefont{\PM@CaptionTitleFont}
\captiondelim{\@nameuse{\@captype name} \@nameuse{the\@captype} -- }
\addto\captionsfrench{%
  \def\figurename{Figure}%
  \def\tablename{Tableau}%
}
\newcommand*\tabulartitle{\rowcolor{TabularColor}}
\newcolumntype{L}{>{\columncolor{TabularColor}}l}
\newcolumntype{R}{>{\columncolor{TabularColor}}r}
\newcolumntype{C}{>{\columncolor{TabularColor}}c}
\newcolumntype{P}[1]{>{\columncolor{TabularColor}}p{#1}}
\newcolumntype{M}[1]{>{\columncolor{TabularColor}}m{#1}}
\newcolumntype{B}[1]{>{\columncolor{TabularColor}}b{#1}}
\newcolumntype{x}{>{\columncolor{TabularColor}}X}
\newbox{\PM@algobox}
\newenvironment{algorithme}[1]{%
  \parskip 1mm plus\z@
  \gdef\PM@titre{#1}%
  \def\Break{%
        \PM@BeforeBreak{lrbox}%
        \pnode(\dimexpr\linewidth-3mm,-0.9\baselineskip){PM@NodeCorr}%
      \endminipage
    \end{lrbox}%
    \setlength{\PM@vertical@shift}{-0.5\dp\PM@algobox+0.5\ht\PM@algobox}%
    \resetcolorseries[10]{PM@ombre@color}%
    \multido{\dx=0pt+0.25\pslinewidth}{10}{%
      \rput(7pt,-0.4pt){%
        \rput(0.5\wd\PM@algobox,\PM@vertical@shift){%
          \rput(\dx,-\dx){%
            \psframebox[fillstyle=none,
                        linestyle=solid, framesep=6pt,
                        linecolor=PM@ombre@color!!+]
            {\phantom{\usebox{\PM@algobox}}}%
          }
        }
      }
    }%
    \psframebox[linestyle=none, fillstyle=solid,
                fillcolor=LO,framesep=6pt]{%
      \usebox{\PM@algobox}%
    }%
    \rput[br](PM@NodeCorr){%
      \psframebox[linecolor=DO,linewidth=1.5\fboxrule,
        fillstyle=solid, cornersize=absolute, linearc=1.5mm,
        fillcolor=white]{\textbf{\ldots}}%
    }
    \clearpage
    \ifx\relax#1\relax
    \else
      \psframebox[linestyle=none, linewidth=0pt,
                  fillstyle=solid, fillcolor=DO]{%
        \color{white}%
        \LogoComputer{4mm}{white}{DO}\space
        {\PM@WarningStarFont \rule{0pt}{9pt}\PM@titre}%
      }
      \kern-3pt
      \pspolygon[linestyle=none, linewidth=0pt,
                 fillstyle=solid, fillcolor=DO]
      (0,-0.13)(0.57,-0.13)(0,0.44)
      \par\nobreak\vspace{-4.6pt}
    \fi
    \begin{lrbox}{\PM@algobox}
      \minipage{\dimexpr\linewidth-\fboxsep*2-\fboxrule*2}
        \parskip 0pt plus0pt
        \PM@AlgoFont
        \fontdimen2\the\font=0.5em
        \hyphenchar\font\m@ne
        \frenchspacing
        \catcode`\:=12
        \catcode`\;=12
        \catcode`\?=12
        \catcode`\!=12
        \@vobeyspaces
        \obeylines
  }%
  \let\BreakWithoutItem\Break
  \setlength{\fboxsep}{6pt}%
  \par\nobreak\addvspace{\PM@SkipAboveWarning}
  \ifx\relax#1\relax
  \else
    \psframebox[linestyle=none, linewidth=0pt,
                fillstyle=solid, fillcolor=DO]{%
      \color{white}%
      \LogoComputer{4mm}{white}{DO}\space
      {\PM@WarningStarFont \rule{0pt}{9pt}\PM@titre}%
    }
    \xdef\PM@titre{\PM@titre\space \PM@smashlp suite\PM@smashrp}%
    \kern-3pt
    \pspolygon[linestyle=none, linewidth=0pt,
               fillstyle=solid, fillcolor=DO]
    (0,-0.13)(0.57,-0.13)(0,0.44)
    \par\nobreak\vspace{-4.6pt}
  \fi
  \begin{lrbox}{\PM@algobox}
    \minipage{\dimexpr\linewidth-\fboxsep*2-\fboxrule*2}
      \parskip 0pt plus0pt
      \PM@AlgoFont
      \fontdimen2\the\font=0.5em
      \hyphenchar\font\m@ne
      \frenchspacing
      \catcode`\:=12
      \catcode`\;=12
      \catcode`\?=12
      \catcode`\!=12
      \@vobeyspaces
      \obeylines
}
{%
    \endminipage
  \end{lrbox}%
  \par
  \setlength{\PM@vertical@shift}{-0.5\dp\PM@algobox+0.5\ht\PM@algobox}%
  \resetcolorseries[10]{PM@ombre@color}%
  \multido{\dx=0pt+0.25\pslinewidth}{10}{%
    \rput(7pt,-0.4pt){%
      \rput(0.5\wd\PM@algobox,\PM@vertical@shift){%
        \rput(\dx,-\dx){%
          \psframebox[fillstyle=none,
                      linestyle=solid, framesep=6pt,
                      linecolor=PM@ombre@color!!+]
          {\phantom{\usebox{\PM@algobox}}}%
        }
      }
    }
  }%
  \psframebox[linestyle=none, fillstyle=solid,
              fillcolor=LO,framesep=6pt]{%
    \usebox{\PM@algobox}%
  }%
  \par
}
\newcommand\DirListing{}
\newenvironment{listing}[3][]{%
  \parskip 1mm plus\z@
  \gdef\PM@titre{#1}%
  \setlength{\fboxsep}{6pt}%
  \par\nobreak\addvspace{\PM@SkipAboveWarning}
  \ifx\relax#2\relax
  \else
    \psframebox[linestyle=none, linewidth=0pt,
                fillstyle=solid, fillcolor=DO]{%
      \color{white}%
      \LogoComputer{4mm}{white}{DO}\space
      \PM@WarningStarFont \rule{0pt}{9pt}#2%
    }
    \kern-3pt
    \pspolygon[linestyle=none, linewidth=0pt,
               fillstyle=solid, fillcolor=DO]
    (0,-0.13)(0.57,-0.13)(0,0.44)
    \par\nobreak\vspace{-4.6pt}
  \fi
  \begin{lrbox}{\PM@algobox}
    \minipage{\dimexpr\linewidth-\fboxsep*2-\fboxrule*2}
      \parskip 0pt plus0pt
      \PM@AlgoFont
      \fontdimen2\the\font=0.5em
      \def\PM@Option@Listing{[#1]}%
      \def\PM@File@Listing{\DirListing #3}%
}
{%
      \expandafter\lstinputlisting\PM@Option@Listing{\PM@File@Listing}%
    \endminipage
  \end{lrbox}%
  \par
  \setlength{\PM@vertical@shift}{-0.5\dp\PM@algobox+0.5\ht\PM@algobox}%
  \resetcolorseries[10]{PM@ombre@color}%
  \multido{\dx=0pt+0.25\pslinewidth}{10}{%
    \rput(7pt,-0.4pt){%
      \rput(0.5\wd\PM@algobox,\PM@vertical@shift){%
        \rput(\dx,-\dx){%
          \psframebox[fillstyle=none,
                      linestyle=solid, framesep=6pt,
                      linecolor=PM@ombre@color!!+]
          {\phantom{\usebox{\PM@algobox}}}%
        }
      }
    }
  }%
  \psframebox[linestyle=none, fillstyle=solid,
              fillcolor=LO,framesep=6pt]{%
    \usebox{\PM@algobox}%
  }%
  \par
}
\newlength{\PM@SkipAboveWarning}
\setlength{\PM@SkipAboveWarning}{2mm plus1\p@}
\newlength{\PM@SkipBelowWarning}
\setlength{\PM@SkipBelowWarning}{2mm plus1\p@}
\newlength{\PM@SkipAboveTheorem}
\setlength{\PM@SkipAboveTheorem}{4mm plus1\p@}
\newlength{\PM@SkipBelowTheorem}
\setlength{\PM@SkipBelowTheorem}{2mm plus1\p@}
\newcommand\BreakWithoutItem{%
  \Break
  \let\makelabelori\makelabel
  \def\makelabel##1{\addtocounter{enum\romannumeral\the\@enumdepth}{-1}}%
  \item
  \let\makelabel\makelabelori
}
\newcommand*\DefineTheoremLike[3][]{%
  \ifx\relax#1\relax
    \unless\ifcsname the#2\endcsname
      \newcounter{#2}[chapter]
    \fi
    \@DefineTheoremLike{#2}{#3}{#2}%
  \else
    \unless\ifcsname the#1\endcsname
      \newcounter{#1}[chapter]
    \fi
    \@DefineTheoremLike{#2}{#3}{#1}%
  \fi
}
\newcommand\@DefineTheoremLike[3]{%
  \newenvironment{#1}[1][]
    {%
      \parskip 1mm plus\z@
      \PM@breakfalse
      \def\Break{%
        \global\PM@breaktrue
        \PM@BeforeBreak{lrbox}%
        \par\nobreak
        \pnode(\dimexpr\linewidth-3mm,-0.9\baselineskip){PM@NodeCorr}
        \endminipage
        \end{lrbox}%
        \hspace*{3mm}\usebox{\PM@box}\\
        \dimen0=\dp\PM@box
        \advance\dimen0 \ht\PM@box
        \ifPM@break
          \advance\dimen0 3.5pt
        \else
          \advance\dimen0 8.5pt
        \fi
        \rput(A){%
          \psline[linewidth=0.4pt, linecolor=PM@theorem@color]
                 (0.5\pslinewidth,-\dimen0)(0.5\pslinewidth,0pt)
        }%
        \endminipage
        \clearpage
        \pnode(0,10pt){A}
        \minipage[t]{\linewidth}%
        \begin{lrbox}{\PM@box}%
          \minipage[t]{\linewidth-3mm}%
          \PM@AfterBreak
      }%
      \par\addvspace{\PM@SkipAboveTheorem}
      \refstepcounter{#3}%
      \ifx\relax##1\relax
        \savebox{\PM@box}{%
          \textcolor{PM@theorem@color}{\PM@TheoremFont #2 \arabic{#3}}%
        }%
      \else
        \savebox{\PM@box}{%
          \textcolor{PM@theorem@color}{\PM@TheoremFont #2 \arabic{#3}
            : ##1}%
        }%
      \fi
      \minipage[t]{\linewidth}%
      \usebox{\PM@box}\\
      \pnode(0,8.5pt){A}
      \psline[linewidth=0.4pt, linecolor=PM@theorem@color]
             (0,8.5pt)(\wd\PM@box,8.5pt)
      \begin{lrbox}{\PM@box}%
        \minipage[t]{\linewidth-3mm}%
        \vspace{-3pt}%
    }
    {%
        \endminipage
      \end{lrbox}%
      \hspace*{3mm}\usebox{\PM@box}\\
      \dimen0=\dp\PM@box
      \advance\dimen0 \ht\PM@box
      \ifPM@break
        \advance\dimen0 3.5pt
      \else
        \advance\dimen0 8.5pt
      \fi
      \rput(A){%
        \psline[linewidth=0.4pt, linecolor=PM@theorem@color]
               (0.5\pslinewidth,-\dimen0)(0.5\pslinewidth,0pt)
      }%
      \endminipage
      \par\addvspace{\PM@SkipBelowTheorem}
    }%
}
\DefineTheoremLike{coro}{Corollaire}
\DefineTheoremLike[coro]{coros}{Corollaires}
\DefineTheoremLike{defin}{D\'efinition}
\DefineTheoremLike[defin]{defins}{D\'efinitions}
\DefineTheoremLike{prop}{Propri\'et\'e}
\DefineTheoremLike[prop]{props}{Propri\'et\'es}
\DefineTheoremLike{thm}{Th\'eor\`eme}
\DefineTheoremLike[thm]{thms}{Th\'eor\`emes}
\newcommand*\DefineExampleLikeWithPar[2]{%
  \newenvironment{#1}[1][]
    {%
      \parskip 1mm plus\z@
      \gdef\PM@suite{}%
      \def\Break{%
        \PM@BeforeBreak{lrbox}%
        \par\nobreak
        \pnode(\dimexpr\linewidth-3mm,-0.9\baselineskip){PM@NodeCorr}
        \endminipage
        \end{lrbox}%
        \usebox{\PM@box}
        \clearpage
        \ifx\relax##1\relax
          \textcolor{PM@example@color}{\PM@ExampleFont #2\PM@suite}
        \else
          \textcolor{PM@example@color}{\PM@ExampleFont #2 (##1)}
        \fi
        \par\nobreak\addvspace{\smallskipamount}
        \gdef\PM@suite{ \PM@smashlp suite\PM@smashrp}%
        \begin{lrbox}{\PM@box}%
          \minipage{\linewidth}%
          \PM@AfterBreak
      }%
      \par\addvspace{\PM@SkipAboveTheorem}
      \ifx\relax##1\relax
        \textcolor{PM@example@color}{\PM@ExampleFont #2\PM@suite}
      \else
        \textcolor{PM@example@color}{\PM@ExampleFont #2 (##1)}
      \fi
      \par\nobreak\addvspace{\smallskipamount}
      \begin{lrbox}{\PM@box}%
        \minipage{\linewidth}%
    }
    {%
        \endminipage%
      \end{lrbox}%
      \usebox{\PM@box}
      \par\addvspace{\PM@SkipBelowTheorem}
    }%
}
\newbox\PM@smashlpbox
\setbox\PM@smashlpbox=\hbox{\PM@BlackCartoucheFont (}%)
\ht\PM@smashlpbox \z@
\dp\PM@smashlpbox \z@
\newcommand*\PM@smashlp{%
  \copy\PM@smashlpbox
}
\newbox\PM@smashrpbox %(
\setbox\PM@smashrpbox=\hbox{\PM@BlackCartoucheFont )}
\ht\PM@smashrpbox \z@
\dp\PM@smashrpbox \z@
\newcommand*\PM@smashrp{%
  \copy\PM@smashrpbox
}
\ifPM@oldexample
\newcommand*\DefineExampleLike[2]{%
  \newenvironment{#1}[1][]
    {%
      \parskip 1mm plus\z@
      \gdef\PM@suite{}%
      \def\Break{%
        \PM@BeforeBreak{lrbox}%
        \par\nobreak
        \pnode(\dimexpr\linewidth-3mm,-0.9\baselineskip){PM@NodeCorr}
        \endminipage
        \end{lrbox}%
        \usebox{\PM@box}
        \clearpage
        \ifx\relax##1\relax
          \setbox1=\hbox{%
            \textcolor{PM@example@color}{\PM@ExampleFont #2\PM@suite}~:~
          }%
        \else
          \setbox1=\hbox{%
            \textcolor{PM@example@color}{\PM@ExampleFont #2 (##1)}~:~
          }%
        \fi
        \gdef\PM@suite{ \PM@smashlp suite\PM@smashrp}%
        \begin{lrbox}{\PM@box}%
          \minipage[t]{\linewidth-\wd1}%
          \PM@AfterBreak
      }%
      \par\addvspace{\PM@SkipAboveTheorem}
      \ifx\relax##1\relax
        \setbox1=\hbox{%
          \textcolor{PM@example@color}{\PM@ExampleFont #2\PM@suite}~:~
        }%
      \else
        \setbox1=\hbox{%
          \textcolor{PM@example@color}{\PM@ExampleFont #2 (##1)}~:~
        }%
      \fi
      \leavevmode\copy1
      \begin{lrbox}{\PM@box}%
        \minipage[t]{\linewidth-\wd1}%
    }
    {%
        \endminipage%
      \end{lrbox}%
      \usebox{\PM@box}
      \par\addvspace{\PM@SkipBelowTheorem}
    }%
}
\else
\newcommand*\DefineExampleLike[2]{%
  \newenvironment{#1}[1][]
    {%
      \parskip 1mm plus\z@
      \gdef\PM@suite{}%
      \def\Break{%
        \PM@BeforeBreak{lrbox}%
        \par\nobreak
        \pnode(\dimexpr\linewidth-3mm,-0.9\baselineskip){PM@NodeCorr}
        \endminipage
        \end{lrbox}%
        \usebox{\PM@box}
        \clearpage
        \begin{lrbox}{\PM@box}%
          \minipage[t]{\linewidth}%
          \ifx\relax##1\relax
            \setbox1=\hbox{%
              \textcolor{PM@example@color}{\PM@ExampleFont #2\PM@suite}~:~
            }%
          \else
            \setbox1=\hbox{%
              \textcolor{PM@example@color}{\PM@ExampleFont #2 (##1)}~:~
            }%
          \fi
          \PM@AfterBreak
        \gdef\PM@suite{ \PM@smashlp suite\PM@smashrp}%
      }%
      \par\addvspace{\PM@SkipAboveTheorem}
      \ifx\relax##1\relax
        \setbox1=\hbox{%
          \textcolor{PM@example@color}{\PM@ExampleFont #2\PM@suite}~:~
        }%
      \else
        \setbox1=\hbox{%
          \textcolor{PM@example@color}{\PM@ExampleFont #2 (##1)}~:~
        }%
      \fi
      \begin{lrbox}{\PM@box}%
        \minipage[t]{\linewidth}%
        \leavevmode\copy1
    }
    {%
        \endminipage%
      \end{lrbox}%
      \usebox{\PM@box}
      \par\addvspace{\PM@SkipBelowTheorem}
    }%
}
\fi
\DefineExampleLike{Remarque}{Remarque}
\DefineExampleLikeWithPar{Remarques}{Remarques}
\DefineExampleLike{Exemple}{Exemple}
\DefineExampleLikeWithPar{Exemples}{Exemples}
\newcommand\LogoExclamation[3]{%
  \begingroup
  \psset{unit=#1}
  \begin{pspicture}(0,0.1)(1,0.1)
    \psset{linestyle=none, linewidth=0pt,
           fillstyle=solid, fillcolor=#2}
    \pspolygon[cornersize=absolute, linearc=0.05](0,0)(1,0)(0.5,0.866)
    \rput(0.5,0.333){\psscaleboxto(0,0.5){\textcolor{#3}{\PM@H\string!}}}
  \end{pspicture}%
  \endgroup
}
\newcommand\LogoQuestion[3]{%
  \begingroup
  \psset{unit=#1}
  \begin{pspicture}(0,0.15)(1,0.15)
    \psset{linestyle=none, linewidth=0pt,
           fillstyle=solid, fillcolor=#2}
    \pscircle(0.5,0.5){0.5}
    \rput(0.5,0.5){\psscaleboxto(0,0.75){\textcolor{#3}{\PM@H\string?}}}
  \end{pspicture}%
  \endgroup
}
\newcommand\LogoRightArrow[3]{%
  \begingroup
  \psset{unit=#1}
  \begin{pspicture}(0,0.15)(1,0.15)
    \psset{linestyle=none, linewidth=0pt,
           fillstyle=solid, fillcolor=#2}
    \pscircle(0.5,0.5){0.5}
    \psset{linestyle=solid, linecolor=#3, linewidth=0.15,
           arrows=cc-cc, fillstyle=none}
    \psline(0.15,0.5)(0.85,0.5)
    \psline(0.55,0.7)(0.8,0.5)(0.55,0.3)
  \end{pspicture}%
  \endgroup
}
\newcommand\LogoBulb[3]{%
  \begingroup
  \psset{unit=#1}
  \begin{pspicture}(0,0.15)(1,0.15)
    \psset{linestyle=none, linewidth=0pt,
           fillstyle=solid, fillcolor=#2}
    \pscircle(0.5,0.5){0.5}
    \psset{linestyle=solid, linewidth=0.1, linecolor=#3, arrows=cc-cc}
    \rput(0.5,0.5){
      \psline(0.2;000)(0.35;000)
      \psline(0.2;045)(0.35;045)
      \psline(0.2;090)(0.35;090)
      \psline(0.2;135)(0.35;135)
      \psline(0.2;180)(0.35;180)
    }
    \psset{linestyle=none, linewidth=0pt, arrows=-,
           fillstyle=solid, fillcolor=#3}
    \pscustom{%
      \psarc(0.5,0.5){0.15}{0}{180}
      \pscurve(0.35,0.5)(0.36,0.45)(0.39,0.4)(0.4,0.35)
      \psarc(0.5,0.35){0.1}{180}{360}
      \pscurve(0.6,0.35)(0.61,0.4)(0.64,0.45)(0.65,0.5)
    }
    \psccurve(0.5,0.27)(0.4,0.25)(0.4,0.22)(0.45,0.17)
             (0.5,0.15)(0.55,0.17)(0.6,0.22)(0.6,0.25)
  \end{pspicture}
  \endgroup
}
\newcommand\LogoSemiClock[3]{%
  \begingroup
  \psset{unit=#1}
  \begin{pspicture}(0,0.3)(1,0.3)
    \psset{linestyle=none, linewidth=0pt,
           fillstyle=solid, fillcolor=#2}
    \pscircle(0.5,0.5){0.5}
    \psset{linestyle=solid, linecolor=#3, linewidth=0.05,
           arrows=cc-, fillstyle=none}
    \begin{psclip}{\pscircle[linestyle=none,linewidth=0pt](0.5,0.5){0.5}}
      \rput(0.5,0.5){%
        \psline(0.3;90)(0.5;90)
        \psline(0.4;120)(0.5;120)
        \psline(0.4;150)(0.5;150)
        \psline(0.3;180)(0.5;180)
        \psline(0.4;210)(0.5;210)
        \psline(0.4;240)(0.5;240)
        \psline(0.3;270)(0.5;270)
       }
    \end{psclip}
  \end{pspicture}%
  \endgroup
}
\newcommand\LogoAnecdote[3]{%
  \begingroup
  \psset{unit=#1}
  \begin{pspicture}(0,0.1)(1,0.1)
    \psset{linestyle=none, linewidth=0pt,
           fillstyle=solid, fillcolor=#2}
    \psellipse(.5,.5)(.4,.28)
    \pscustom{%
      \psline(.6,.5)(.8,.1)
      \pscurve(.8,.1)(.75,.1)(.65,.15)(.55,.25)(.35,.5)
    }
    \psset{fillcolor=#3}
    \pscircle(.32,.5){.06}
    \pscircle(.5,.5){.06}
    \pscircle(.68,.5){.06}
  \end{pspicture}%
  \endgroup
}
\newcommand\LogoComputerOld[3]{%
  \begingroup
  \psset{unit=#1}
  \begin{pspicture}(0,0.26)(1.35,0.26)
    \psframe[linestyle=none, linewidth=0pt,
             fillstyle=solid, fillcolor=#3](0,0.26)(1.35,0.26)
    \pspolygon[linewidth=0.08, linecolor=#2,
               cornersize=absolute, linearc=0.05]
    (0,0.2)(1.35,0.2)(1.35,1)(0,1)
    \pspolygon[linewidth=0pt, linestyle=none,
               fillstyle=solid, fillcolor=#2]
    (0.405,0)(0.945,0)(0.825,0.12)(0.525,0.12)
    \rput(0.675,0.6){\psscaleboxto(0,0.35){\textcolor{#2}{\PM@H 01011}}}
  \end{pspicture}%
  \endgroup
}
\newcommand\LogoComputer[3]{%
  \begingroup
  \psset{unit=#1}
  \begin{pspicture}(0,0.26)(1.2,0.26)
    \psframe[linestyle=none, linewidth=0pt,
             fillstyle=solid, fillcolor=#3](0,0.26)(1.2,0.26)
    \pspolygon[linewidth=0.08, linecolor=#2,
               cornersize=absolute, linearc=0.05]
    (0,0.2)(1.2,0.2)(1.2,1)(0,1)
    \pspolygon[linewidth=0pt, linestyle=none,
               fillstyle=solid, fillcolor=#2]
    (0.33,0)(0.87,0)(0.75,0.12)(0.45,0.12)
  \end{pspicture}%
  \endgroup
}
\newcommand\LogoForward[3]{%
  \begingroup
  \psset{unit=#1}
  \begin{pspicture}(0,0.15)(1,0.15)
    \psset{linestyle=none, linewidth=0pt,
           fillstyle=solid, fillcolor=#2}
    \pscircle(0.5,0.5){0.5}
    \psset{linestyle=none, fillstyle=solid, fillcolor=#3}
    \def\R{0.22}% Rayon triangles
    \rput(0.28,0.5){\pspolygon(\R;0)(\R;120)(\R;240)}
    \rput(0.67,0.5){\pspolygon(\R;0)(\R;120)(\R;240)}
  \end{pspicture}%
  \endgroup
}
\newcommand*\PM@WarningLikeBlueBKGList{}
\newlength{\PM@vertical@shift}
\newcommand\PM@WarningLikeCommon[4]{%
  \newenvironment{#1}[1][]
    {%
      \parskip 1mm plus\z@
      \gdef\PM@suite{}%
      \def\Break{%
        \PM@BeforeBreak{lrbox}%
        \par\nobreak
        \pnode(\dimexpr\linewidth-3mm,-0.9\baselineskip){PM@NodeCorr}
        \endminipage
        \end{lrbox}%
        \setlength{\PM@vertical@shift}{-0.5\dp\PM@box+0.5\ht\PM@box}%
        \resetcolorseries[10]{PM@ombre@color}%
        \multido{\dx=0pt+0.25\pslinewidth}{10}{%
          \rput(7pt,-0.4pt){%
            \rput(0.5\wd\PM@box,\PM@vertical@shift){%
              \rput(\dx,-\dx){%
                \psframebox[fillstyle=none,
                            linestyle=solid, framesep=6pt,
                            linecolor=PM@ombre@color!!+]
                  {\phantom{\usebox{\PM@box}}}%
              }
            }
          }
        }%
        \psframebox[linestyle=none, fillstyle=solid,
                    fillcolor=#4,framesep=6pt]{%
            \usebox{\PM@box}%
        }%
        \rput[br](PM@NodeCorr){%
          \psframebox[linecolor=\PM@thumb@dcolor,
            fillstyle=solid, cornersize=absolute, linearc=1.5mm,
            fillcolor=white]{\textbf{\ldots}}
        }
        \clearpage
        \psframebox[linestyle=none, fillstyle=solid,
                    fillcolor=PM@warning@color]{%
          \color{white}%
          #2\space
          \ifx\relax##1\relax
            {\PM@WarningStarFont \rule{0pt}{9pt}#3\PM@suite}%
          \else
            {\PM@WarningStarFont \rule{0pt}{9pt}#3\PM@suite}%
          \fi
        }
        \gdef\PM@suite{ \PM@smashlp suite\PM@smashrp}%
        \kern-3pt
        \pspolygon[linestyle=none, linewidth=0pt,
          fillstyle=solid, fillcolor=PM@warning@color]
        (0,-0.13)(0.57,-0.13)(0,0.44)
        \par\nobreak\vspace{-4.6pt}
        \begin{lrbox}{\PM@box}%
          \minipage[b]{\linewidth-13.6pt}%
          \PM@AfterBreak
      }%
      \par\nobreak\addvspace{\PM@SkipAboveWarning}
      \psframebox[linestyle=none, fillstyle=solid,
                 fillcolor=PM@warning@color]{%
      \color{white}%
      #2\space
      \ifx\relax##1\relax
        {\PM@WarningStarFont \rule{0pt}{9pt}#3\PM@suite}%
      \else
        {\PM@WarningStarFont \rule{0pt}{9pt}#3 : ##1\PM@suite}%
      \fi
    }
    \kern-3pt
    \pspolygon[linestyle=none, linewidth=0pt,
      fillstyle=solid, fillcolor=PM@warning@color]
    (0,-0.13)(0.57,-0.13)(0,0.44)
    \par\nobreak\vspace{-4.6pt}
    \begin{lrbox}{\PM@box}%
      \minipage[b]{\linewidth-13.6pt}%
  }
  {%
      \endminipage
    \end{lrbox}%
    \setlength{\PM@vertical@shift}{-0.5\dp\PM@box+0.5\ht\PM@box}%
    \resetcolorseries[10]{PM@ombre@color}%
    \multido{\dx=0pt+0.25\pslinewidth}{10}{%
      \rput(7pt,-0.4pt){%
        \rput(0.5\wd\PM@box,\PM@vertical@shift){%
          \rput(\dx,-\dx){%
            \psframebox[fillstyle=none,
                        linestyle=solid, framesep=6pt,
                        linecolor=PM@ombre@color!!+]
              {\phantom{\usebox{\PM@box}}}%
          }
        }
      }
    }%
    \psframebox[linestyle=none, fillstyle=solid,
                fillcolor=#4,framesep=6pt]{%
        \usebox{\PM@box}%
    }%
    \par\addvspace{\PM@SkipBelowWarning}
  }%
}
\newcommand*\DefineWarningLikeBlueBKG[4]{%
  \newenvironment{#1@ns}[1][]
    {%
      \ClassError{prepamath}{L'environnement #1 ne peut exister que
        dans les pages sur fond en couleur}{L'environnement #1 est
        interdit dans les pages sur fond blanc. Contactez une personne
        responsable en cas de discussion.}%
    }
    {%
      \aftergroup\ignorespaces
    }
  \PM@WarningLikeCommon{#1@s}{#2}{#3}{#4}%
  \xdef\PM@WarningLikeBlueBKGList{\PM@WarningLikeBlueBKGList#1,}%
}
\newcommand*\PM@WarningLikeWhiteBKGList{}
\newcommand*\DefineWarningLikeWhiteBKG[3]{%
  \PM@WarningLikeCommon{#1@ns}{#2}{#3}{LR}%
  \newenvironment{#1@s}[1][]
    {%
      \ClassError{prepamath}{L'environnement #1 ne peut exister que
        dans les pages sur fond blanc}{L'environnement #1 est
        interdit dans les pages sur fond bleu. Contactez une personne
        responsable en cas de discussion.}%
    }
    {%
      \aftergroup\ignorespaces
    }
  \xdef\PM@WarningLikeWhiteBKGList{\PM@WarningLikeWhiteBKGList#1,}%
}
\newcommand*\PM@WarningLikeEveryWhereList{}
\newcommand*\DefineWarningLikeEveryWhere[4]{%
  \PM@WarningLikeCommon{#1@ns}{#2}{#3}{LR}%
  \PM@WarningLikeCommon{#1@s}{#2}{#3}{#4}%
  \xdef\PM@WarningLikeEveryWhereList{\PM@WarningLikeEveryWhereList#1,}%
}
\newcommand*\PM@SetWarningLike{%
  \expandafter\if\csname PM@@thumb\the\PM@thumbcurr\endcsname*\relax
    \def\PM@suffix{@s}%
  \else
    \def\PM@suffix{@ns}%
  \fi
  \expandafter\PM@SWL\PM@WarningLikeWhiteBKGList\@nil,
  \expandafter\PM@SWL\PM@WarningLikeBlueBKGList\@nil,
  \expandafter\PM@SWL\PM@WarningLikeEveryWhereList\@nil,
}
\def\PM@SWL#1,{%
  \def\PM@arg{#1}%
  \ifx\PM@arg\@nnil
  \else
    \expandafter\let\expandafter\PM@tmp\csname#1\PM@suffix\endcsname
    \expandafter\let\csname#1\endcsname\PM@tmp
    \expandafter\let\expandafter\PM@tmp\csname end#1\PM@suffix\endcsname
    \expandafter\let\csname end#1\endcsname\PM@tmp
    \expandafter\PM@SWL
  \fi
}
\newcommand*\PM@SetWarningLikeStar{%
  \edef\PM@save@suffix{\PM@suffix}%
  \def\PM@suffix{@s}%
  \expandafter\PM@SWL\PM@WarningLikeBlueBKGList\@nil,
  \expandafter\PM@SWL\PM@WarningLikeWhiteBKGList\@nil,
  \expandafter\PM@SWL\PM@WarningLikeEveryWhereList\@nil,
}
\newcommand*\PM@RestoreWarningLike{%
  \edef\PM@suffix{\PM@save@suffix}%
  \expandafter\PM@SWL\PM@WarningLikeWhiteBKGList\@nil,
  \expandafter\PM@SWL\PM@WarningLikeBlueBKGList\@nil,
  \expandafter\PM@SWL\PM@WarningLikeEveryWhereList\@nil,
}
%%%\DefineWarningLikeWhiteBKG{aretenir}{\LogoRightArrow{4mm}{white}{DR}}
%%%                          {\`A RETENIR}
%%%\DefineWarningLikeBlueBKG{methode}{\LogoBulb{4mm}{white}{DR}}{M\'ETHODE}{white}
%%%\DefineWarningLikeBlueBKG{problematique}{\LogoQuestion{4mm}{white}{DR}}
%%%                         {PROBL\'EMATIQUE}{white}
\DefineWarningLikeEveryWhere{problematique}{\LogoQuestion{4mm}{white}{DR}}
                            {PROBL\'EMATIQUE}{LR}
\DefineWarningLikeEveryWhere{attention}{\LogoExclamation{4mm}{white}{DR}}
                            {ATTENTION}{LR}
\DefineWarningLikeEveryWhere{aretenir}{\LogoRightArrow{4mm}{white}{DR}}
                            {\`A RETENIR}{LR}
\DefineWarningLikeEveryWhere{anecdote}{\LogoAnecdote{4mm}{white}{DR}}
                            {ANECDOTE}{LR}
\DefineWarningLikeEveryWhere{plusloin}{\LogoForward{4mm}{white}{DR}}
                            {POUR ALLER PLUS LOIN}{LR}
\DefineWarningLikeEveryWhere{methode}{\LogoBulb{4mm}{white}{DR}}
                            {M\'ETHODE}{white}
\newlength{\gouttiere}\setlength{\gouttiere}{1cm}
\newlength{\PM@VaVLeft}
\newlength{\PM@VaVRight}
\newcommand*\visavis[1][0.5]{%
  \setlength{\PM@VaVLeft}{(\linewidth-\gouttiere)*\real{#1}}%
  \setlength{\PM@VaVRight}{\linewidth-\PM@VaVLeft-\gouttiere}%
  \PM@VaV
}
\newcommand\PM@VaV[3][c]{%
  \par\addvspace{\medskipamount}
  \begin{minipage}[#1]{\PM@VaVLeft}%
    #2
  \end{minipage}\hfill
  \begin{minipage}[#1]{\PM@VaVRight}%
    #3
  \end{minipage}%
  \par\addvspace{\medskipamount}
}
\newlength{\PM@SkipAboveExo}
\setlength{\PM@SkipAboveExo}{8mm}
\newlength{\PM@SkipBelowExo}
\setlength{\PM@SkipBelowExo}{4mm}
\newenvironment{PM@leftnarrow}
{%
  \nobreak\list{}{%
    \setlength{\topsep}{0pt}%
    \setlength{\leftmargin}{18pt}%
    \setlength{\rightmargin}{0pt}%
    \setlength{\listparindent}{\parindent}%
    \setlength{\itemindent}{\parindent}%
    \setlength{\parsep}{\parskip}%
    \renewcommand*\makelabel[1]{\kern-10pt\hss}%
  }%
  \item\relax\ignorespaces
}
{\endlist}
\def\PM@Break{%
  \ClassError{prepamath}{La commande \string\Break\space ne peut
    pas apparaitre ici}
  {La commande \string\Break\space n'est valide que dans les environnements
    exointro, solintro, les blocs de type 'attention', 'theoreme' et
    'aretenir' et l'environnement algorithme.}%
}
\let\Break\PM@Break
\def\PM@string@enumerate{enumerate}
\def\PM@string@questions{questions}
\def\PM@ResumeCounter{%
  \csname c@\@enumctr\endcsname=\the\csname  c@\@enumctr\endcsname}
\def\PM@noitem{\let\@noitemerr\relax}
\def\PM@BeforeBreak#1{%
  \gdef\PM@stop{#1}%
  \gdef\PM@AfterBreak{}%
  \PM@BeforeBreak@
}
\def\PM@BeforeBreak@{%
  \ifx\@currenvir\PM@stop
    \let\next\relax
  \else
    \ifx\@currenvir\PM@string@enumerate
      \let\PM@AfterEnv\PM@ResumeCounter
    \else\ifx\@currenvir\PM@string@questions
      \let\PM@AfterEnv\PM@ResumeCounter
    \else
      \def\PM@AfterEnv{}%
    \fi\fi
    \protected@xdef\PM@AfterBreak{%
      \protect\begin{\@currenvir}%
      \protect\PM@noitem
      \PM@AfterEnv
      \PM@AfterBreak
    }%
    \def\next{%
      \expandafter\end\expandafter{\@currenvir}%
      \PM@BeforeBreak@
    }%
  \fi
  \next
}
\newcounter{exointro}[chapter]
\newsavebox{\PM@box}
\newenvironment{exointro}[1]
  {%
    \parskip 1mm plus\z@
    \PM@SetWarningLikeStar
    \par\addvspace{\PM@SkipAboveExo}
    \refstepcounter{exointro}%
    \label{exointro\thechapter-\the\c@exointro}%
    \write\@mainaux{%
      \string\expandafter
      \string\gdef
      \string\csname\space
        nbexointro\thechapter
      \string\endcsname{\the\c@exointro}%
    }%
    \gdef\PM@suiteIntro{}%
    \gdef\PM@lycee{#1}%
    \pnode(0.75mm,14.4pt){PM@NodeET}%
    \pnode(115mm,14.4pt){PM@NodeLy}%
    \def\Break{%
      \PM@BeforeBreak{lrbox}%
      \par\nobreak
      \pnode(\dimexpr\linewidth-3mm,-0.9\baselineskip){PM@NodeCorr}
      \endminipage
      \end{lrbox}%
      \resetcolorseries[10]{PM@ombre@color}
      \multido{\dx=0pt+0.25\pslinewidth}{10}{%
        \rput(10pt,0pt){%
          \rput(0.5\wd\PM@box,-0.5\dp\PM@box){%
            \rput(\dx,-\dx){%
              \psframebox[fillstyle=none,
              linestyle=solid, framesep=9pt, linecolor=PM@ombre@color!!+]
              {\phantom{\usebox{\PM@box}}}%
            }
          }
        }
      }
      \psframebox[fillstyle=solid,
        fillcolor=\PM@thumb@lcolor, linestyle=none, framesep=9pt]
        {\usebox{\PM@box}}%
      \rput[Br](PM@NodeCorr){%
        \psframebox[linecolor=\PM@thumb@dcolor,
          fillstyle=solid, cornersize=absolute, linearc=1.5mm,
          fillcolor=white]{\textbf{\ldots}}}%
      \rput(-0.5pt,\dimexpr-\dp\PM@box-9.5pt){%
        \pspolygon[linestyle=none, linewidth=0pt,
                   fillstyle=solid, fillcolor=LGray]
          (-9pt,0)(-9pt,9pt)(0,9pt)
        \resetcolorseries[10]{PM@ombre@color}%
        \multido{\dx=0.25pt+0.25\pslinewidth,
                 \dy=-0.25pt+-0.25\pslinewidth}{10}{%
          \psline[linestyle=solid, linecolor=PM@ombre@color!!+]
            (-8.75pt,\dy)(\dx,8.75pt)
        }%
        \pspolygon[linestyle=none, linewidth=0pt,
                   fillstyle=solid, fillcolor=white]
          (-8.6pt,-2.5pt)(2.5pt,8.6pt)(2.5pt,-2.5pt)
      }
      \count@=0\csname nbexointro\thechapter\endcsname\relax
      \ifnum\count@<2
        \def\PM@tmp{}%
        \else
        \def\PM@tmp{\space\the\c@exointro}%
      \fi
      \setbox2=\hbox{%
        \PM@BlackCartoucheFont
        Exercice type\PM@tmp\PM@suiteIntro
      }%
      \rput[Bl](PM@NodeET){%
        \psframebox[linestyle=none, linewidth=0pt,
          fillstyle=solid, fillcolor=\PM@thumb@dcolor]
        {%
          \textcolor{white}{%
            \PM@BlackCartoucheFont
            Exercice type\PM@tmp\PM@suiteIntro
          }%
        }%
        \kern-0.1pt
        \pspolygon[linestyle=none, linewidth=0pt,
          fillstyle=solid, fillcolor=\PM@thumb@dcolor]
        (0,-0.17)(0.55,-0.17)(0,0.39)
      }%
      \gdef\PM@suiteIntro{ \PM@smashlp suite\PM@smashrp}%
      \setbox1=\hbox{\PM@WhiteCartoucheFont \PM@lycee}%
      \ifdim\wd1<\dimexpr\linewidth-\wd2-30pt
        \rput[Br](PM@NodeLy){%
          \PM@WhiteCartoucheFont
          \psline[linewidth=1.3ex,linecolor=DY](0,0.65ex)(\wd1,0.65ex)
          \PM@lycee
        }
      \fi
      \clearpage
      \pnode(0.75mm,14.4pt){PM@NodeET}%
      \pnode(115mm,14.4pt){PM@NodeLy}%
      \begin{lrbox}{\PM@box}%
        \minipage[t]{0pt+\linewidth-6\psframesep-2\pslinewidth}%
        \vspace*{0\medskipamount}%
        \PM@AfterBreak
    }%
    \begin{lrbox}{\PM@box}%
      \minipage[t]{0pt+\linewidth-6\psframesep-2\pslinewidth}%
      \vspace*{0\medskipamount}%
  }%
  {%
      \par\nobreak
      \pnode(\dimexpr\linewidth-3mm,-0.9\baselineskip){PM@NodeCorr}
    \endminipage
    \end{lrbox}%
    \resetcolorseries[10]{PM@ombre@color}
    \multido{\dx=0pt+0.25\pslinewidth}{10}{%
      \rput(10pt,0pt){%
        \rput(0.5\wd\PM@box,-0.5\dp\PM@box){%
          \rput(\dx,-\dx){%
            \psframebox[fillstyle=none,
            linestyle=solid, framesep=9pt, linecolor=PM@ombre@color!!+]
            {\phantom{\usebox{\PM@box}}}%
          }
        }
      }
    }
    \psframebox[fillstyle=solid,
      fillcolor=\PM@thumb@lcolor, linestyle=none, framesep=9pt]
      {\usebox{\PM@box}}%
    \rput(-0.5pt,\dimexpr-\dp\PM@box-9.5pt){%
      \pspolygon[linestyle=none, linewidth=0pt,
                 fillstyle=solid, fillcolor=LGray]
        (-9pt,0)(-9pt,9pt)(0,9pt)
      \resetcolorseries[10]{PM@ombre@color}%
      \multido{\dx=0.25pt+0.25\pslinewidth,
               \dy=-0.25pt+-0.25\pslinewidth}{10}{%
        \psline[linestyle=solid, linecolor=PM@ombre@color!!+]
          (-8.75pt,\dy)(\dx,8.75pt)
      }%
      \pspolygon[linestyle=none, linewidth=0pt,
                 fillstyle=solid, fillcolor=white]
        (-8.6pt,-2.5pt)(2.5pt,8.6pt)(2.5pt,-2.5pt)
    }
    \count@=0\csname nbexointro\thechapter\endcsname\relax
    \ifnum\count@<2
      \def\PM@tmp{}%
    \else
      \def\PM@tmp{\space\the\c@exointro}%
    \fi
    \setbox2=\hbox{%
      \PM@BlackCartoucheFont
      Exercice type\PM@tmp\PM@suiteIntro
    }%
    \rput[Bl](PM@NodeET){%
      \psframebox[linestyle=none, linewidth=0pt,
        fillstyle=solid, fillcolor=\PM@thumb@dcolor]
      {%
        \textcolor{white}{%
          \PM@BlackCartoucheFont
          Exercice type\PM@tmp\PM@suiteIntro
        }%
      }%
      \kern-0.1pt
      \pspolygon[linestyle=none, linewidth=0pt,
        fillstyle=solid, fillcolor=\PM@thumb@dcolor]
      (0,-0.17)(0.55,-0.17)(0,0.39)
    }%
    \setbox1=\hbox{\PM@WhiteCartoucheFont \PM@lycee}%
    \ifdim\wd1<\dimexpr\linewidth-\wd2-30pt
      \rput[Br](PM@NodeLy){%
        \PM@WhiteCartoucheFont
        \psline[linewidth=1.3ex,linecolor=DY](0,0.65ex)(\wd1,0.65ex)
        \PM@lycee
      }
    \fi
      \rput[Br](PM@NodeCorr){%
        \psframebox[linecolor=\PM@thumb@dcolor,
          fillstyle=solid, cornersize=absolute, linearc=1.5mm,
          fillcolor=white]{\PM@WhiteCartoucheFont Voir corrig\'e page
            \pageref{corrintro\thechapter-\the\c@exointro}}}%
    \PM@RestoreWarningLike
    \par\nobreak\vspace{\medskipamount}
  }
\newcounter{corrintro}[chapter]
\newenvironment{solintro}
  {%
    \parskip 1mm plus\z@
    \PM@SetWarningLikeStar
    \PM@breakfalse
    \par\addvspace{\PM@SkipAboveExo}
    \pnode(0.75mm,14.4pt){PM@NodeET}%
    \pnode(115mm,14.4pt){PM@NodeLy}%
    \gdef\PM@suiteIntro{}%
    \def\Break{%
      \PM@BeforeBreak{lrbox}%
      \par\nobreak
      \pnode(\dimexpr\linewidth-3mm,-0.9\baselineskip){PM@NodeCorr}
      \endminipage
      \end{lrbox}%
      \resetcolorseries[10]{PM@ombre@color}
      \multido{\dx=0pt+0.25\pslinewidth}{10}{%
        \rput(10pt,0pt){%
          \rput(0.5\wd\PM@box,-0.5\dp\PM@box){%
            \rput(\dx,-\dx){%
              \psframebox[fillstyle=none,
              linestyle=solid, framesep=9pt, linecolor=PM@ombre@color!!+]
              {\phantom{\usebox{\PM@box}}}%
            }
          }
        }
      }
      \psframebox[fillstyle=solid,
        fillcolor=\PM@thumb@lcolor, linestyle=none, framesep=9pt]
        {\usebox{\PM@box}}%
      \rput[Br](PM@NodeCorr){%
        \psframebox[linecolor=\PM@thumb@dcolor,
          fillstyle=solid, cornersize=absolute, linearc=1.5mm,
          fillcolor=white]{\textbf{\ldots}}}%
      \rput(-0.5pt,\dimexpr-\dp\PM@box-9.5pt){%
        \pspolygon[linestyle=none, linewidth=0pt,
                   fillstyle=solid, fillcolor=LGray]
          (-9pt,0)(-9pt,9pt)(0,9pt)
        \resetcolorseries[10]{PM@ombre@color}%
        \multido{\dx=0.25pt+0.25\pslinewidth,
                 \dy=-0.25pt+-0.25\pslinewidth}{10}{%
          \psline[linestyle=solid, linecolor=PM@ombre@color!!+]
            (-8.75pt,\dy)(\dx,8.75pt)
        }%
        \pspolygon[linestyle=none, linewidth=0pt,
                   fillstyle=solid, fillcolor=white]
          (-8.6pt,-2.5pt)(2.5pt,8.6pt)(2.5pt,-2.5pt)
      }
      \count@=0\csname nbexointro\thechapter\endcsname\relax
      \ifPM@break\else
        \refstepcounter{corrintro}%
        \label{corrintro\thechapter-\the\c@corrintro}%
        \PM@breaktrue
      \fi
      \ifnum\count@<2
        \def\PM@tmp{}%
        \else
        \def\PM@tmp{\space\the\c@corrintro}%
      \fi
      \setbox2=\hbox{%
        \PM@BlackCartoucheFont
        Solution de l'exercice type\PM@tmp
      }%
      \rput[Bl](PM@NodeET){%
        \psframebox[linestyle=none, linewidth=0pt,
        fillstyle=solid, fillcolor=\PM@thumb@dcolor]
        {%
          \textcolor{white}{%
            \PM@BlackCartoucheFont
            \LogoRightArrow{4mm}{white}{\PM@thumb@dcolor}
            Solution de l'exercice type\PM@tmp
          }%
        }%
        \kern-0.1pt
        \pspolygon[linestyle=none, linewidth=0pt,
          fillstyle=solid, fillcolor=\PM@thumb@dcolor]
        (0,-0.17)(0.55,-0.17)(0,0.385)
      }%
      \gdef\PM@suiteIntro{ \PM@smashlp suite\PM@smashrp}%
      \setbox1=\hbox{\PM@WhiteCartoucheFont \PM@lycee}%
      \ifdim\wd1<\dimexpr\linewidth-\wd2-30pt
        \rput[Br](PM@NodeLy){%
          \PM@WhiteCartoucheFont
          \psline[linewidth=1.3ex,linecolor=DY](0,0.65ex)(\wd1,0.65ex)
          \PM@lycee%
        }
      \fi
      \clearpage
      \pnode(0.75mm,14.4pt){PM@NodeET}%
      \pnode(115mm,14.4pt){PM@NodeLy}%
      \begin{lrbox}{\PM@box}%
        \minipage[t]{0pt+\linewidth-6\psframesep-2\pslinewidth}%
        \vspace*{0\medskipamount}%
        \PM@AfterBreak
    }%
    \begin{lrbox}{\PM@box}%
      \minipage[t]{0pt+\linewidth-6\psframesep-2\pslinewidth}%
        \vspace*{0\medskipamount}%
  }%
  {%
      \par\nobreak
      \pnode(\dimexpr\linewidth-3mm,-0.9\baselineskip){PM@NodeCorr}
      \endminipage
    \end{lrbox}%
    \resetcolorseries[10]{PM@ombre@color}
    \multido{\dx=0pt+0.25\pslinewidth}{10}{%
      \rput(10pt,0pt){%
        \rput(0.5\wd\PM@box,-0.5\dp\PM@box){%
          \rput(\dx,-\dx){%
            \psframebox[fillstyle=none,
            linestyle=solid, framesep=9pt, linecolor=PM@ombre@color!!+]
            {\phantom{\usebox{\PM@box}}}%
          }
        }
      }
    }
    \psframebox[fillstyle=solid,
      fillcolor=\PM@thumb@lcolor, linestyle=none, framesep=9pt]
      {\usebox{\PM@box}}%
    \rput(-0.5pt,\dimexpr-\dp\PM@box-9.5pt){%
      \pspolygon[linestyle=none, linewidth=0pt,
                 fillstyle=solid, fillcolor=LGray]
        (-9pt,0)(-9pt,9pt)(0,9pt)
      \resetcolorseries[10]{PM@ombre@color}%
      \multido{\dx=0.25pt+0.25\pslinewidth,
               \dy=-0.25pt+-0.25\pslinewidth}{10}{%
        \psline[linestyle=solid, linecolor=PM@ombre@color!!+]
          (-8.75pt,\dy)(\dx,8.75pt)
      }%
      \pspolygon[linestyle=none, linewidth=0pt,
                 fillstyle=solid, fillcolor=white]
        (-8.6pt,-2.5pt)(2.5pt,8.6pt)(2.5pt,-2.5pt)
    }
    \count@=0\csname nbexointro\thechapter\endcsname\relax
    \ifPM@break\else
      \refstepcounter{corrintro}%
      \label{corrintro\thechapter-\the\c@corrintro}%
    \fi
    \ifnum\count@<2
      \def\PM@tmp{}%
      \else
      \def\PM@tmp{\space\the\c@corrintro}%
    \fi
    \setbox2=\hbox{%
      \PM@BlackCartoucheFont
      Solution de l'exercice type\PM@tmp\PM@suiteIntro
    }%
    \rput[Bl](PM@NodeET){%
      \psframebox[linestyle=none, linewidth=0pt,
      fillstyle=solid, fillcolor=\PM@thumb@dcolor]
      {%
        \textcolor{white}{%
          \PM@BlackCartoucheFont
          \LogoRightArrow{4mm}{white}{\PM@thumb@dcolor}
          Solution de l'exercice type\PM@tmp\PM@suiteIntro
        }%
      }%
      \kern-0.1pt
      \pspolygon[linestyle=none, linewidth=0pt,
        fillstyle=solid, fillcolor=\PM@thumb@dcolor]
      (0,-0.17)(0.55,-0.17)(0,0.385)
    }%
    \setbox1=\hbox{\PM@WhiteCartoucheFont \PM@lycee}%
    \ifdim\wd1<\dimexpr\linewidth-\wd2-30pt
      \rput[Br](PM@NodeLy){%
        \PM@WhiteCartoucheFont
        \psline[linewidth=1.3ex,linecolor=DY](0,0.65ex)(\wd1,0.65ex)
        \PM@lycee
      }
    \fi
    \count@=0\csname nbexointro\the\c@chapter\endcsname\relax
    \ifnum\count@<2
      \def\PM@tmp{}%
      \else
      \def\PM@tmp{\space\the\c@corrintro}%
    \fi
    \rput[Br](PM@NodeCorr){%
      \psframebox[linecolor=\PM@thumb@dcolor,
        fillstyle=solid, cornersize=absolute, linearc=1.5mm,
        fillcolor=white]
      {%
        \PM@WhiteCartoucheFont Voir \'enonc\'e page
        \pageref{exointro\thechapter-\the\c@corrintro}
      }
    }
    \PM@RestoreWarningLike
  }
\newcounter{exo}[chapter]
\newcounter{correxo}[chapter]
\newcounter{choix}[exo]
\@addtoreset{choix}{correxo}
\renewcommand\thechoix{\alph{choix}}
\newcommand*\choix{%
  \@ifnextchar[{\@choix}{\@@choix}%]
}
\def\@choix[#1]{%
  {%
    \setlength{\fboxsep}{1pt}%
    \setlength{\fboxrule}{0pt}%
    \framebox{%
      \setlength{\fboxsep}{0pt}%
      \setlength{\fboxrule}{0.4pt}%
      \framebox{%
        \vrule width0pt height7pt depth2pt
        {\PM@ChoiceFont \hbox to 9pt{\hss#1\hss}}%
      }%
    }%
  }%
}
\def\@@choix{%
  \stepcounter{choix}%
  {%
    \setlength{\fboxsep}{1pt}%
    \setlength{\fboxrule}{0pt}%
    \framebox{%
      \setlength{\fboxsep}{0pt}%
      \setlength{\fboxrule}{0.4pt}%
      \framebox{%
        \vrule width0pt height7pt depth2pt
        {\PM@ChoiceFont \hbox to 9pt{\hss\thechoix\hss}}%
      }%
    }%
  }~%
}

\newcommand*\resetchoix{\setcounter{choix}{0}}
\newcommand*\PM@type{}
\newcommand*\PM@type@vf{V/F}
\newcommand*\PM@type@qcm{QCM}
\newcommand*\PM@type@exo{exo}
\newcommand*\PM@label{exo}
\newcommand*\PM@ref{corr}
\newcommand*\PM@corr@enonce{Corrig\'e}
\newenvironment{qcm}[2]
  {\begin{qcmvf}{#1}{#2}{QCM}}
  {\end{qcmvf}}
\newenvironment{vf}[2]
  {\begin{qcmvf}{#1}{#2}{V/F}}
  {\end{qcmvf}}
\newenvironment{qcmvf}[3]
  {%
    \par\addvspace{\PM@SkipAboveExo}
    \refstepcounter{exo}%
    \label{\PM@label\thechapter-\the\c@exo}%
    \gdef\PM@type{#3}%
    \ifx\relax#1\relax
      \ClassError{prepamath}{Il faut donner un titre au #3}{Le
        premier argument de l'environnement qcm ne doit pas etre
        vide.}%
    \fi
    \gdef\PM@qcmvf@title{#1}%
    \ifx\relax#2\relax
      \ClassError{prepamath}{Il faut donner un temps au #3}{Le
        second argument de l'environnement qcm ne doit pas etre
        vide.}%
    \fi
    \gdef\PM@qcm@time{#2}%
    \psframe*[linecolor=\PM@thumb@dcolor](0pt,0pt)(18pt,20pt)
    \rput[B](9pt,5pt){\PM@ExoNumberFont
                     \textcolor{white}{\theexo}}
    \psframe*[linecolor=DY](18pt,0pt)(46pt,20pt)
    \rput(32pt,9pt){\PM@QCMFont \textcolor{\PM@thumb@dcolor}{#3}}
    \rput[Bl](50pt,5pt){\PM@ExoTitleFont
                      \textcolor{\PM@thumb@dcolor}{#1}}
    \psline[linecolor=\PM@thumb@dcolor,linewidth=0.4pt]
           (18pt,0.5\pslinewidth)(\linewidth,0.5\pslinewidth)
    \rput(\linewidth,0){%
      \psline[linecolor=\PM@thumb@dcolor,linewidth=0.4pt](0,0)(0,18pt)
      \psline[linecolor=\PM@thumb@dcolor,linewidth=0.4pt](-40pt,0)(-40pt,18pt)
      \rput[B](-20pt,12pt){%
        \LogoRightArrow{3mm}{DR}{white}
        \PM@ExoCorrEnFont
        \PM@corr@enonce
      }
      \rput[B](-20pt,3pt){%
        \PM@ExoRefFont
        p.~\pageref{\PM@ref\thechapter-\the\c@exo}%
      }
      \ifx\relax#2\relax
      \else
        \ifnum #2 > 0
          \rput[Bl](-70pt,2.5mm){%
            \LogoSemiClock{6mm}{\PM@thumb@lcolor}{\PM@thumb@dcolor}%
            \kern-3.67mm
            \PM@ExoTimeFont #2 min
          }
        \fi
      \fi
    }%
    \par\nobreak
    \PM@leftnarrow\ignorespaces
  }
  {%
    \endPM@leftnarrow
    \par\goodbreak\addvspace{\PM@SkipBelowExo}
  }
\newenvironment{qcmaddmin}[2]
  {\qcm{#1}{#2}}
  {\endqcm}
\newenvironment{exo}[4]
  {%
    \par\addvspace{\PM@SkipAboveExo}
    \refstepcounter{exo}%
    \label{\PM@label\thechapter-\the\c@exo}%
    \gdef\PM@type{exo}%
    \ifx\relax#1\relax
      \ClassError{prepamath}{Il faut donner un titre aux exercice}{Le
        premier argument de l'environnement exo ne doit pas ^^c3^^aatre
        vide.}%
    \fi
    \gdef\PM@exo@title{#1}%
    \ifx\relax#2\relax
      \ClassError{prepamath}{Il faut donner un etablissement aux exercices}{Le
        second argument de l'environnement exo ne doit pas ^^c3^^aatre
        vide.}%
    \fi
    \gdef\PM@exo@lycee{#2}%
    \ifx\relax#3\relax
      \ClassError{prepamath}{Il faut donner une difficulte aux exercices}{Le
        troisieme argument de l'environnement exo ne doit pas etre
        vide.}%
    \else\ifnum#3=0
      \ClassError{prepamath}{La difficulte des exercices doit etre
        strictement positive}{La difficulte est comprise entre 1 et 3.}%
    \fi\fi
    \gdef\PM@exo@diff{#3}%
    \ifx\relax#4\relax
      \ClassError{prepamath}{Il faut donner un temps aux exercices}{Le
        quatrieme argument de l'environnement exo ne doit pas etre
        vide.}%
    \fi
    \gdef\PM@exo@time{#4}%
    \psframe*[linecolor=\PM@thumb@dcolor](0pt,0)(18pt,20pt)
    \rput[B](9pt,5pt){\PM@ExoNumberFont
                     \textcolor{white}{\theexo}}
    \rput[Bl](25pt,5pt){\PM@ExoTitleFont
                      \textcolor{\PM@thumb@dcolor}{#1}}
    \psline[linecolor=\PM@thumb@dcolor,linewidth=0.4pt]
           (18pt,0.5\pslinewidth)(\linewidth,0.5\pslinewidth)
    \setbox1=\hbox{\PM@ExoSchoolFont #2}%
    \rput[l](25pt,-7.5pt){%
      \PM@ExoSchoolFont
      \psline[linewidth=1.3ex,linecolor=DY](0,0.65ex)(\wd1,0.65ex)
      #2%
    }
    \rput(\linewidth,0){%
      \psline[linecolor=\PM@thumb@dcolor,linewidth=0.4pt](0,0)(0,18pt)
      \psline[linecolor=\PM@thumb@dcolor,linewidth=0.4pt](-40pt,0)(-40pt,18pt)
      \rput[B](-20pt,12pt){%
        \LogoRightArrow{3mm}{DR}{white}
        \PM@ExoCorrEnFont
        \PM@corr@enonce
      }
      \rput[B](-20pt,3pt){%
        \PM@ExoRefFont
        p.~\pageref{\PM@ref\thechapter-\the\c@exo}%
      }
      \ifx\relax#4\relax
      \else
        \ifnum #4 > 0
          \rput[Bl](-70pt,2.5mm){%
            \LogoSemiClock{6mm}{\PM@thumb@lcolor}{\PM@thumb@dcolor}%
            \kern-3.67mm
            \PM@ExoTimeFont #4 min
          }
        \fi
      \fi
      \ifnum#3>-1
        \psframe*[linecolor=\PM@thumb@lcolor, linewidth=0pt]
                 (-80pt,3pt)(-113pt,15pt)
      \fi
      \ifnum#3>0
        \rput(-106.5pt,9pt){\textcolor{\PM@thumb@dcolor}{\LARGE$\star$}}
      \fi
      \ifnum#3>1
        \rput(-96.5pt,9pt){\textcolor{\PM@thumb@dcolor}{\LARGE$\star$}}
      \fi
      \ifnum#3>2
        \rput(-86.5pt,9pt){\textcolor{\PM@thumb@dcolor}{\LARGE$\star$}}
      \fi
    }%
    \ifx\null#2
      \par\nobreak\kern-6pt
    \else
      \par\nobreak\kern6pt
    \fi
    \PM@leftnarrow
  }
  {%
    \endPM@leftnarrow
    \par\goodbreak\addvspace{\PM@SkipBelowExo}
  }
\newenvironment{exointroalgo}[1]
  {%
    \par\addvspace{\PM@SkipAboveExo}
    \refstepcounter{exo}%
    \label{\PM@label\thechapter-\the\c@exo}%
    \gdef\PM@type{exo}%
    \gdef\PM@exo@lycee{}
    \ifx\relax#1\relax
      \ClassError{prepamath}{Il faut donner un titre aux exercice}{Le
        premier argument de l'environnement exo ne doit pas etre
        vide.}%
    \fi
    \gdef\PM@exo@title{#1}%
    \psframe*[linecolor=PM@grayitem@color](0pt,0)(18pt,20pt)
    \rput[B](9pt,5pt){\PM@ExoNumberFont
                     \textcolor{white}{\theexo}}
    \rput[Bl](25pt,5pt){\PM@ExoTitleFont
                      \textcolor{PM@blueitem@color}{#1}}
    \psline[linecolor=black,linewidth=0.4pt]
           (18pt,0.5\pslinewidth)(\linewidth,0.5\pslinewidth)
    \psline[linecolor=black,linewidth=0.4pt]
           (17.8pt,0)(17.8pt,-15pt)
    \rput(\linewidth,0){%
      \psline[linecolor=black,linewidth=0.4pt](0,0)(0,18pt)
      \psline[linecolor=black,linewidth=0.4pt](-36pt,0)(-36pt,18pt)
      \rput[B](-18pt,12pt){\PM@ExoCorrEnFont
        \PM@corr@enonce}
      \rput[B](-18pt,3pt){\PM@ExoRefFont
        p.~\pageref{\PM@ref\thechapter-\the\c@exo}}
     }
    \par\nobreak\kern6pt
    \PM@leftnarrow
  }
  {%
    \endPM@leftnarrow
    \par\goodbreak\addvspace{\PM@SkipBelowExo}
  }
\newenvironment{exoaddmin}[4]
  {\exo{#1}{#2}{#3}{#4}}
  {\endexo}
\newcommand\killienc{}
\count@128
\@whilenum\count@<\@cclvi\do{%
  \edef\killienc{\killienc\catcode\the\count@=12}%
  \advance\count@\@ne}
\newsavebox{\PM@BoxSubTitle}
\newenvironment{exobb}[4]
  {%
    \par\addvspace{\PM@SkipAboveExo}
    \refstepcounter{exo}%
    \label{\PM@label\thechapter-\the\c@exo}%
    \gdef\PM@exo@title{#1}%
    \gdef\PM@exo@subtitle{#2}%
    \gdef\PM@exo@point{#3}%
    \gdef\PM@exo@time{#4}%
    \psframe*[linecolor=\PM@thumb@dcolor](0pt,0)(18pt,20pt)
    \rput[B](9pt,5pt){\PM@ExoNumberFont
                     \textcolor{white}{\theexo}}
    \rput[Bl](25pt,5pt){%
      \PM@ExoTitleFont
      \textcolor{\PM@thumb@dcolor}{#1}%
    }
    \rput[l](25pt,-7.5pt){\PM@ExoSchoolFont #2}
    \psline[linecolor=\PM@thumb@dcolor,linewidth=0.4pt]
           (18pt,0.5\pslinewidth)(\linewidth,0.5\pslinewidth)
    \setbox\PM@BoxSubTitle=\hbox{#2}%
    \ifdim\wd\PM@BoxSubTitle=0pt
    \else
      \psline[linecolor=\PM@thumb@dcolor,linewidth=0.4pt]
             (17.8pt,0)(17.8pt,-15pt)
    \fi
    \rput(\linewidth,0){%
      \psline[linecolor=\PM@thumb@dcolor,linewidth=0.4pt](0,0)(0,18pt)
      \psline[linecolor=\PM@thumb@dcolor,linewidth=0.4pt](-40pt,0)(-40pt,18pt)
      \rput[B](-20pt,12pt){%
        \LogoRightArrow{3mm}{DR}{white}
        \PM@ExoCorrEnFont>
        \PM@corr@enonce}
      \rput[B](-18pt,3pt){\PM@ExoRefFont
        p.~\pageref{\PM@ref\thechapter-\the\c@exo}}
      \ifnum#3>-1
        \psframe*[linecolor=\PM@thumb@lcolor, linewidth=0pt]
                 (-80pt,3pt)(-113pt,15pt)
      \fi
      \ifnum#3>0
        \rput(-106.5pt,9pt){\textcolor{\PM@thumb@dcolor}{\LARGE$\star$}}
      \fi
      \ifnum#3>1
        \rput(-96.5pt,9pt){\textcolor{\PM@thumb@dcolor}{\LARGE$\star$}}
      \fi
      \ifnum#3>2
        \rput(-86.5pt,9pt){\textcolor{\PM@thumb@dcolor}{\LARGE$\star$}}
      \fi
      \ifx\relax#4\relax
      \else
        \ifnum #4 > 0
          \rput[Bl](-70pt,2.5mm){%
            \LogoSemiClock{6mm}{\PM@thumb@lcolor}{\PM@thumb@dcolor}%
            \kern-3.67mm
            \PM@ExoTimeFont #4 min
          }
        \fi
      \fi
    }%
    \par\nobreak
    \ifdim\wd\PM@BoxSubTitle=0pt
      \kern-6pt
    \else
      \kern6pt
    \fi
    \begingroup
    \PM@leftnarrow\ignorespaces
  }
  {%
    \endPM@leftnarrow
    \endgroup
    \par\addvspace{\PM@SkipBelowExo}
  }
\newenvironment{corrige}
  {%
    \ifx\PM@type\PM@type@exo
      \expandafter\protected@xdef
        \csname PM@head\thechapter-\the\c@exo\endcsname{%
        {E}{\PM@exo@title}{\PM@exo@lycee}{-1}{-1}%
      }%
    \else\ifx\PM@type\PM@type@qcm
      \expandafter\protected@xdef
        \csname PM@head\thechapter-\the\c@exo\endcsname{%
        {Q}{\PM@qcmvf@title}{-1}{-1}{-1}%
      }%
    \else\ifx\PM@type\PM@type@vf
      \expandafter\protected@xdef
        \csname PM@head\thechapter-\the\c@exo\endcsname{%
        {V}{\PM@qcmvf@title}{-1}{-1}{-1}%
      }%
    \else
      \ClassError{prepamath}{Erreur de type d'exo}{Plaignez-vous
        aupres de l'auteur de la classe.}%
    \fi\fi\fi
    \killienc
    \VerbatimEnvironment
    \begin{VerbatimOut}{corr\thechapter-\the\c@exo}}
  {%
    \end{VerbatimOut}
  }
\newcommand\AfficheCorrige{%
  \renewcommand*\PM@label{corr}%
  \renewcommand*\PM@ref{exo}%
  \renewcommand*\PM@corr@enonce{Enonc\'e}%
  \edef\exomax{\the\c@exo}%
  \global\c@exo=\z@
  \multido{\nexo=1+1}{\exomax}{%
    \expandafter\PM@get@param\csname PM@head\thechapter-\nexo\endcsname
    \ifx\PM@type\PM@type@exo
    \begin{exo}{\PM@title}{\PM@lycee}{\PM@diff}{\PM@time}
      \input{corr\thechapter-\nexo}%
    \end{exo}
    \else\ifx\PM@type\PM@type@qcm
    \begin{qcm}{\PM@title}{\PM@time}
      \input{corr\thechapter-\nexo}%
    \end{qcm}
    \else
    \begin{vf}{\PM@title}{\PM@time}
      \input{corr\thechapter-\nexo}%
    \end{vf}
    \fi\fi
  }%
  \renewcommand*\PM@label{exo}%
  \renewcommand*\PM@ref{corr}%
  \renewcommand*\PM@corr@enonce{Corrig\'e}%
}
\newcommand*\PM@get@param[1]{%
  \expandafter\PM@get@@param#1%
}
\newcommand*\PM@get@@param[5]{%
  \if#1E%
    \def\PM@type{exo}%
    \def\PM@title{#2}%
    \def\PM@lycee{#3}%
    \def\PM@diff{#4}%
    \def\PM@time{#5}%
  \else\if#1Q%
    \def\PM@type{QCM}%
    \def\PM@title{#2}%
    \def\PM@time{#3}%
  \else\if#1V%
    \def\PM@type{V/F}%
    \def\PM@title{#2}%
    \def\PM@time{#3}%
  \else
    \ClassError{prepamath}{Erreur de type d'exo}{Plaignez-vous
      aupres de l'auteur de la classe.}%
  \fi\fi\fi
}
\newenvironment{corrigebb}
  {%
    \expandafter\protected@xdef
    \csname PM@headbb-\the\c@exo\endcsname{%
      {\PM@exo@title}{\PM@exo@subtitle}{-1}{-1}%
    }%
    \killienc
    \VerbatimEnvironment
    \begin{VerbatimOut}{corrbb-\the\c@exo}}
  {%
    \end{VerbatimOut}
  }
\newcommand\AfficheCorrigeBB{%
  \renewcommand*\PM@label{corr}%
  \renewcommand*\PM@ref{exo}%
  \renewcommand*\PM@corr@enonce{Enonc\'e}%
  \edef\exomax{\the\c@exo}%
  \global\c@exo=\z@
  \multido{\nexo=1+1}{\exomax}{%
    \expandafter\PM@get@parambb\csname PM@headbb-\nexo\endcsname
    \begin{exobb}{\PM@title}{\PM@subtitle}{\PM@point}{\PM@time}
      \input{corrbb-\nexo}%
    \end{exobb}
  }%
  \renewcommand*\PM@label{exo}%
  \renewcommand*\PM@ref{corr}%
  \renewcommand*\PM@corr@enonce{Corrig\'e}%
}
\newcommand*\PM@get@parambb[1]{%
  \expandafter\PM@get@@parambb#1%
}
\newcommand*\PM@get@@parambb[4]{%
  \def\PM@title{#1}%
  \def\PM@subtitle{#2}%
  \def\PM@point{#3}%
  \def\PM@time{#4}%
}
\renewcommand*\title[1]{%
  \renewcommand*\PM@title{#1}
  \let\title\relax
}
\renewcommand*\author[1]{%
  \renewcommand*\PM@author{#1}
  \let\author\relax
}
\renewcommand*\date[1]{%
  \renewcommand*\PM@date{#1}
  \let\date\relax
}
\newcommand*\version[1]{%
  \renewcommand*\PM@version{#1}
  \let\version\relax
}
\newcommand*\ISBN[1]{%
  \renewcommand*\PM@isbn{#1}
  \let\ISBN\relax
}
\newcommand*\PM@ERROR{ERROR}
\newcommand*\PM@title{ERROR}
\newcommand*\PM@author{ERROR}
\newcommand*\PM@date{\today}
\newcommand*\PM@version{1.0}
\newcommand*\PM@isbn{X-XXXX-XXXX-X}
\AtBeginDocument{%
  \ifx\PM@title\PM@ERROR
    \ClassError{Prepamath}{Donnez un titre avec \string\title}{}%
  \fi
  \ifx\PM@author\PM@ERROR
    \ClassError{Prepamath}{Donner un nom d'auteur avec \string\author}{}%
  \fi
}
\newcommand*{\nep}{\mathrm{e}}
\newcommand*{\im}{\mathrm{i}}
\DeclareMathOperator{\ch}{ch}
\DeclareMathOperator{\sh}{sh}
\let\Re\undefined\DeclareMathOperator{\Re}{Re}
\let\Im\undefined\DeclareMathOperator{\Im}{Im}
\DeclareMathOperator{\Arg}{Arg}
\newcommand*{\dd}{\hspace{0.15em}\mathrm{d}}
\DeclareMathOperator{\card}{card}
\DeclareMathOperator{\PGCD}{pgcd}
\DeclareMathOperator{\PPCM}{ppcm}
\DeclareMathOperator{\esp}{E}
\DeclareMathOperator{\var}{V}
\DeclareMathOperator{\ent}{E}
\newcommand*{\N}{\ensuremath{\mathbb{N}}}
\newcommand*{\Z}{\ensuremath{\mathbb{Z}}}
\newcommand*{\Q}{\ensuremath{\mathbb{Q}}}
\newcommand*{\R}{\ensuremath{\mathbb{R}}}
\newcommand*{\C}{\ensuremath{\mathbb{C}}}
\newcommand*{\Moy}[1]{\overline{#1}}
\newcommand*{\gvec}{\overrightarrow}
\renewcommand*{\theequation}{\arabic{equation}}
\newcommand*\ministrut{\vrule width0pt height6pt depth1pt\relax}
\newcommand*\T[1]{%
  \setbox1=\hbox{{\PM@ToucheTxt\textcolor{PM@touche@color}{#1}}}%
  \PM@Tcommon
}
\newcommand*\Tm[1]{%
  \setbox1=\hbox{{\PM@ToucheMath$\color{PM@touche@color}{\mathsf{#1}}$}}%
  \PM@Tcommon
}
\newcommand\PM@Tcommon{%
  \ifdim\wd1<6.5mm
    \def\PM@width@calc{7mm}%
  \else
    \edef\PM@width@calc{\the\dimexpr\wd1+1mm}%
  \fi
  \begin{pspicture}(0mm,0mm)(\dimexpr\PM@width@calc+0.25mm,2.5mm)
    \psset{linewidth=0pt,linestyle=none, fillstyle=solid, framearc=0.3}
    \psframe[fillcolor=DB](0mm,-1mm)(\dimexpr\PM@width@calc+0.5mm,2.5mm)
    \psframe[fillcolor=MB](0mm,-0.5mm)(\PM@width@calc,2.5mm)
    \rput[B](\dimexpr\PM@width@calc/2,0){\box1}
  \end{pspicture}%
  \xspace
}
\newcommand*\Tpourcent{\T{\%}\xspace}
\newcommand*\Tcarre{\Tm{x\raisebox{0.5ex}{\PM@ToucheMath$\scriptstyle\color{PM@touche@color}{\mathsf{2}}$}}\xspace}
\newcommand*\Tcube{\Tm{x\raisebox{0.5ex}{\PM@ToucheMath$\scriptstyle\color{PM@touche@color}{\mathsf{3}}$}}\xspace}
\newcommand*\Tpuissance{\Tm{x\raisebox{0.5ex}{\PM@ToucheMath$\scriptstyle\color{PM@touche@color}{\mathsf{n}}$}}\xspace}
\newcommand*\Tcalc{\T{CALC}\xspace}
\newcommand*\Tlog{\T{log}\xspace}
\newcommand*\Tln{\T{ln}\xspace}
\newcommand*\Tneg{\Tm{({-})}\xspace}
\newcommand*\Tsin{\T{SIN}\xspace}
\newcommand*\Tcos{\T{COS}\xspace}
\newcommand*\Ttan{\T{TAN}\xspace}
\newcommand*\Tasin{\T{ASIN}\xspace}
\newcommand*\Tacos{\T{ACOS}\xspace}
\newcommand*\Tatan{\T{ATAN}\xspace}
\newcommand*\TAsin{\Tm{\mathsf{SIN\raisebox{0.5ex}{\PM@ToucheMath$\scriptstyle\color{PM@touche@color}{\mathsf{-1}}$}}}\xspace}
\newcommand*\TAcos{\Tm{\mathsf{COS\raisebox{0.5ex}{\PM@ToucheMath$\scriptstyle\color{PM@touche@color}{\mathsf{-1}}$}}}\xspace}
\newcommand*\TAtan{\Tm{\mathsf{TAN\raisebox{0.5ex}{\PM@ToucheMath$\scriptstyle\color{PM@touche@color}{\mathsf{-1}}$}}}\xspace}
\newcommand*\Trcl{\T{RCL}\xspace}
\newcommand*\Tmem{\T{MEM}\xspace}
\newcommand*\Tdel{\T{DEL}\xspace}
\newcommand*\Tac{\T{AC}\xspace}
\newcommand*\Tseconde{\T{SECONDE}\xspace}
\newcommand*\Tshift{\T{SHIFT}\xspace}
\newcommand*\Tmul{\Tm{\times}\xspace}
\newcommand*\Tdiv{\Tm{\div}\xspace}
\newcommand*\Tplus{\Tm{+}\xspace}
\newcommand*\Tmoins{\Tm{-}\xspace}
\newcommand*\Tegal{\Tm{=}\xspace}
\newcommand*\Texe{\T{EXE}\xspace}
\newcommand*\Tenter{\T{ENTER}\xspace}
\newcommand*\Tans{\T{ANS}\xspace}
\newcommand*\TTA{\T{A}\xspace}
\newcommand*\TTB{\T{B}\xspace}
\newcommand*\TTC{\T{C}\xspace}
\newcommand*\TTD{\T{D}\xspace}
\newcommand*\TTE{\T{E}\xspace}
\newcommand*\TTF{\T{F}\xspace}
\newcommand*\TTG{\T{G}\xspace}
\newcommand*\TTH{\T{H}\xspace}
\newcommand*\TTI{\T{I}\xspace}
\newcommand*\TTJ{\T{J}\xspace}
\newcommand*\TTK{\T{K}\xspace}
\newcommand*\TTL{\T{L}\xspace}
\newcommand*\TTM{\T{M}\xspace}
\newcommand*\TTN{\T{N}\xspace}
\newcommand*\TTO{\T{O}\xspace}
\newcommand*\TTP{\T{P}\xspace}
\newcommand*\TTQ{\T{Q}\xspace}
\newcommand*\TTR{\T{R}\xspace}
\newcommand*\TTS{\T{S}\xspace}
\newcommand*\TTT{\T{T}\xspace}
\newcommand*\TTU{\T{U}\xspace}
\newcommand*\TTV{\T{V}\xspace}
\newcommand*\TTW{\T{W}\xspace}
\newcommand*\TTX{\T{X}\xspace}
\newcommand*\TTY{\T{Y}\xspace}
\newcommand*\TTZ{\T{Z}\xspace}
\newcommand\TailleEcran{16x3}
\setbox1=\hbox{\PM@ScreenFont 0}%
\newlength{\PM@widthscreen@unit}
\setlength{\PM@widthscreen@unit}{\wd1}
\newlength{\PM@heightscreen@unit}
\setlength{\PM@heightscreen@unit}{\ht1}
\setbox2=\hbox{\PM@ScreenFont \strut}%
\newlength{\PM@depthscreen}
\setlength{\PM@depthscreen}{\dp2}
\newenvironment{Ecran}[1][\TailleEcran]{%
  \expandafter\PM@parse@screen#1x\@nil
  \begin{lrbox}{\PM@box}%
    \minipage[t][\dimexpr\PM@heightscreen@unit*\PM@ht@screen+\PM@depthscreen]
                {\dimexpr\PM@widthscreen@unit*\PM@wd@screen}%
      \def\\{\par\leavevmode}%
      \catcode`\^=13
      \def\T##1{##1}%
      \def\TT##1{##1}%
      \def\Tpourcent{\%\xspace}%
      \def\Tcarre{\up{2}\xspace}%
      \def\Tcube{\up{3}\xspace}%
      \def\Tpuissance##1{\up{##1}\xspace}%
      \def\Tcalc{CALC\xspace}%
      \def\Tlog{log(\xspace}%
      \def\Tln{ln(\xspace}%
      \def\Tneg{-\xspace}%
      \def\Tsin{SIN(\xspace}%)
      \def\Tcos{COS(\xspace}%)
      \def\Ttan{TAN(\xspace}%)
      \def\Tasin{ASIN(\xspace}%)
      \def\Tacos{ACOS(\xspace}%)
      \def\Tatan{ATAN(\xspace}%)
      \def\TAsin{SIN\up{-1}(\xspace}%)
      \def\TAcos{COS\up{-1}(\xspace}%)
      \def\TAtan{TAN\up{-1}(\xspace}%)
      \def\Trcl{RCL\xspace}%
      \def\Tmem{MEM\xspace}%
      \def\Tdel{DEL\xspace}%
      \def\Tac{AC\xspace}%
      \def\Tseconde{SECONDE\xspace}%
      \def\Tshift{SHIFT\xspace}%
      \def\Tmul{{\boldmath$\times$}\xspace}%
      \def\Tdiv{/\xspace}%
      \def\Tplus{+\xspace}%
      \def\Tmoins{-\xspace}%
      \def\Tegal{=\xspace}%
      \def\Texe{EXE\xspace}%
      \def\Tenter{ENTER\xspace}%
      \def\Tans{ANS\xspace}%
      \PM@ScreenFont
  }
{%
    \endminipage
  \end{lrbox}%
  \setbox\PM@box=\hbox{%
    \fboxrule=0mm
    \fbox{\usebox{\PM@box}}%
  }%
  \begin{pspicture}(-2.5\pslinewidth,\dimexpr-\dp\PM@box-2.5\pslinewidth)
                   (\dimexpr\wd\PM@box+2.5\pslinewidth,
                    \dimexpr\ht\PM@box+2.5\pslinewidth)
    \psframe*[linecolor=PM@screenbkg@color](0,-\dp\PM@box)(\wd\PM@box,\ht\PM@box)
    \multido{\dx=0pt+-0.25\pslinewidth,
             \dxx=\wd\PM@box+0.25\pslinewidth,
             \dy=\ht\PM@box+0.25\pslinewidth,
             \dyy=-\dp\PM@box+-0.25\pslinewidth,
             \ic=10+-1
           }{10}{%
             \psframe[linecolor=PM@screenframe@color\ic,
                       cornersize=absolute, linearc=1mm]
                      (\dx,\dy)(\dxx,\dyy)
    }
    \rput[Bl](0,0){\usebox{\PM@box}}
  \end{pspicture}%
}
\def\PM@parse@screen#1x#2\@nil{%
  \def\PM@wd@screen{#1}%
  \ifx\relax#2\relax
    \def\PM@ht@screen{1}%
  \else
    \PM@@parse@screen#2%
  \fi
}
\def\PM@@parse@screen#1x{%
  \def\PM@ht@screen{#1}%
}
\begingroup
  \catcode`\^=13
  \gdef^#1{\up{#1}}
\endgroup
\newcommand\Par{\par\vspace{5pt plus 2pt minus 2pt}\par}
\newcommand\dvline{\vline\,\vline}
\newcommand\morestretch[1][1.2]{\renewcommand{\arraystretch}{#1}}
\let\ds\displaystyle
\newcommand*\dlim{\ds\lim}
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\let\cal\mathcal
\let\onglet\thumb
\let\subonglet\subthumb
\endinput
%%
%% End of file `prepamath.cls'.
