% Extensions a charger
\RequirePackage{xkeyval,ifthen}%
\RequirePackage{graphicx}%
-\RequirePackage{mdframed}%
+\RequirePackage{mdframedpre}%
\ifdef{\ifmdf@nobreak}{\relax}{\define@key{mdf}{nobreak}[]{}}%
%l'option nobreak de mdframed vient qu'avec la version 0.9
%
\RequirePackage{tikz}%
\usetikzlibrary{shadows}% pour l'ombre
\usetikzlibrary{decorations.pathmorphing}% pour la barre ondulee
- \def\bc@mdf@style{1}%pour la version 0.6
+ \def\bc@mdf@style{1}%pour la version 0.6 de mdframed
\input{bclogoMdframedTikz}%redefinition des macros d'affichage
\else%
\RequirePackage{pstricks}%
\let\pagecolorOLD\pagecolor% modification pour sauvegarde de la couleur du fond
\def\pagecolor#1{\gdef\psx@blurbg{#1}\pagecolorOLD{#1}}%suppose l'utilisation: \pagecolor{couleur}
\fi%
- \def\bc@mdf@style{3}%%pour la version 0.6
+ \def\bc@mdf@style{3}%%pour la version 0.6 de mdframed
\input{bclogoMdframedPst}%redefinition des macros d'affichage
\fi%
\edef\Gin@extensions{.mps,\Gin@extensions}%
%
%les differentes commandes de barre verticale a gauche
%
-\newcommand{\bc@barreline}{%
+\newcommand*{\bc@barreline}{%
\begin{minipage}{\logowidth}\centering%
\ifbclogotikz%
\begin{tikzpicture}%
\psline[linewidth=\bcval@epBarre,linecolor=\bcval@couleurBarre](0,\bc@invboxh)(0,0)%
\end{pspicture}%
\fi%
-\end{minipage}}%
-%
-\newcommand{\bc@barremotif}{%
-\begin{minipage}{\logowidth}\color{\bcval@couleurBarre}\centering%
-\vbox to \bc@invboxh{\cleaders\vbox{\vss \bcval@motifBarre \vss}\vfill}%
-\end{minipage}}%
+\end{minipage}%
+}%
%
-\newcommand{\bc@barrewave}{%
-\begin{minipage}{\logowidth}\color{\bcval@couleurBarre}\centering%
-\vbox to \bc@invboxh{\cleaders\vbox{\vss $\leftwave\right.$ \vss}\vfill}%
-\end{minipage}}%
%
-\newcommand{\bc@barresnake}{%
+\newcommand*{\bc@barresnake}{%
\begin{minipage}{\logowidth}\centering%
\ifbclogotikz%
\begin{tikzpicture}[decoration={snake,segment length=2.66\bcval@tailleOndu, amplitude=\bcval@tailleOndu}]%
\pszigzag[coilarm=0pt,coilwidth=2\bcval@tailleOndu,linewidth=1pt,linearc=1pt,coilheight=1.33,linecolor=\bcval@couleurBarre](0,\bc@invboxh)(0,0)%
\end{pspicture}%
\fi%
-\end{minipage}}%
+\end{minipage}%
+}%
%
-\newcommand{\bc@barrezigzag}{%
+\newcommand*{\bc@barrezigzag}{%
\begin{minipage}{\logowidth}\centering%
\ifbclogotikz%
\begin{tikzpicture}[decoration={zigzag,segment length=2.66\bcval@tailleOndu, amplitude=\bcval@tailleOndu}]%
\pszigzag[coilarm=0pt,coilwidth=2\bcval@tailleOndu,linewidth=1pt,linearc=0pt,coilheight=1.33,linecolor=\bcval@couleurBarre](0,\bc@invboxh)(0,0)%
\end{pspicture}%
\fi%
-\end{minipage}}%
+\end{minipage}%
+}%
%
-\newcommand{\bc@barreimageExt}{% l'image est deformee
+\newcommand*{\bc@barreimageExt}{% l'image est deformee
\begin{minipage}{\logowidth}\centering%
\includegraphics[width=\logowidth,height=\bc@invboxh]{\bcval@imageBarre}%
-\end{minipage}}%
+\end{minipage}%
+}
%
-\newcommand{\bc@barreimageClip}{%
+\newcommand*{\bc@barreimageClip}{%
\begin{minipage}{\logowidth}\centering%
-\includegraphics[viewport=0 0 \logowidth~ \bc@invboxh,%
-clip=true]{\bcval@imageBarre}%
-\end{minipage}}%
+\includegraphics[viewport=0 0 \logowidth~ \bc@invboxh,clip=true]{\bcval@imageBarre}%
+\end{minipage}%
+}%
+%
+\newcommand*{\bc@barremotif}{%
+\begin{minipage}{\logowidth}\centering%
+\color{\bcval@couleurBarre}%
+\vbox to \bc@invboxh{\cleaders\vbox{\vss\bcval@motifBarre\vss}\vfill}%
+\end{minipage}%
+}%
+%
+\newcommand*{\bc@barrewave}{%
+\begin{minipage}{\logowidth}\centering%
+\color{\bcval@couleurBarre}%
+\vbox to \bc@invboxh{\cleaders\vbox{\vss$\leftwave\right.$\vss}\vfill}%
+\end{minipage}%
+}%
%
%======================= Quelques definitions===================================
% boite titre
% affichage
\smallskip% ressort %% Pourquoi ? %%%parce que ça se comprime et ça s'étire!
\def\bcval@nobreak{\ifKV@bclogo@nobreak true\else false\fi}% gestion nobreak
-\begin{mdframed}[%
+\mdframed[%
innerleftmargin={\dimexpr\ifKV@bclogo@avecBarre\logowidth\else\z@\fi+\bcval@framesep\relax},%
innertopmargin={\dimexpr\ht\bc@envbox+\dp\bc@envbox+\bcval@framesep\relax},%hauteur titre+framesep
innerrightmargin=\bcval@framesep,%
innerbottommargin=\bcval@framesep,%
- rightmargin=\dimexpr\bcval@margeD+\ifKV@bclogo@ombre\bcval@epOmbre cm\else\z@\fi,%
+ rightmargin={\dimexpr\bcval@margeD+\ifKV@bclogo@ombre\bcval@epOmbre cm\else\z@\fi\relax},%
leftmargin=\bcval@margeG,%
backgroundcolor=\bcval@couleur,%
fontcolor=\bcval@couleurTexte,%
]%
}%
{%
-\end{mdframed}\par%
+\endmdframed\par%
\ifKV@bclogo@ombre\vspace*{\bcval@epOmbre cm}\else\smallskip\fi%
\goodbreak%
}%
\setkeys{bclogo}{barre=none}%% en cas d'utlisation de l'environnement mdframed
+\endinput%
+%%%%%%%%%%%%%%%% fin %%%%%%%%%%%%%%%%
\def\md@putbox@single{%boite qui tient sur la page
\leftline{\null\hspace*{\mdf@leftmargin@length}%%
\setlength\bc@mdfboxwidth{\wd\@tempboxa}%
- \setlength\bc@mdfboxheight{\ht\@tempboxa+\dp\@tempboxa}%
+ \setlength\bc@mdfboxheight{\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}%
\setlength{\bc@invboxh}{\bc@mdfboxheight}%
- \setlength{\mdfboundingboxheight}{%
- \bc@mdfboxheight%
- +\mdf@innertopmargin@length%
- +\mdf@innerbottommargin@length%
-% +\mdf@middlelinewidth@length%
-% +\mdf@middlelinewidth@length%
- }%
+ \setlength{\mdfboundingboxheight}{\dimexpr\bc@mdfboxheight+\mdf@innertopmargin@length+\mdf@innerbottommargin@length\relax}%
\ifbool{mdf@topline}{\addtolength{\mdfboundingboxheight}{\mdf@middlelinewidth@length}}{}%
\ifbool{mdf@bottomline}{\addtolength{\mdfboundingboxheight}{\mdf@middlelinewidth@length}}{}%
- \setlength{\mdfboundingboxwidth}{%
- \bc@mdfboxwidth%
- +\mdf@innerleftmargin@length%
- +\mdf@innerrightmargin@length%
-% +\mdf@middlelinewidth@length%
-% +\mdf@middlelinewidth@length%
- }%
+ \setlength{\mdfboundingboxwidth}{\dimexpr\bc@mdfboxwidth+\mdf@innerleftmargin@length+\mdf@innerrightmargin@length\relax}%
\ifbool{mdf@leftline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
\ifbool{mdf@rightline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
\psset{linearc=\mdf@roundcorner@length,cornersize=absolute}%
\psset{unit=1pt}%
- \begin{pspicture}(0,0)(\dimexpr\mdfboundingboxwidth,\mdfboundingboxheight)%
+ \begin{pspicture}(0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
\ifKV@bclogo@ombre%cadre ombre
\ifKV@bclogo@blur%blur
\psframe[fillstyle=solid, shadow=true, blur=true, shadowsize=\bcval@epOmbre cm,%
\fi%
\rput[tl](\dimexpr0.5\bcval@framesep+\mdf@middlelinewidth@length,%
\dimexpr\mdfboundingboxheight-0.75\bcval@framesep-\mdf@middlelinewidth@length){\box\bc@envbox}%
- \rput[bl](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep,%
+ \rput[b](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep+0.5\logowidth,%
\dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length){\bc@barre}%
\rput[bl](\dimexpr\mdf@innerleftmargin@length+\mdf@middlelinewidth@length,%
\dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length){\box\@tempboxa}%
\def\md@putbox@first{%tete d'une boite coupée
\leftline{\null\hspace*{\mdf@leftmargin@length}%%
\setlength\bc@mdfboxwidth{\wd\tw@}%
- \setlength\bc@mdfboxheight{\ht\tw@+\dp\tw@}%
+ \setlength\bc@mdfboxheight{\dimexpr\ht\tw@+\dp\tw@\relax}%
\setlength{\bc@invboxh}{\bc@mdfboxheight}%
- \setlength{\mdfboundingboxheight}{%
- +\bc@mdfboxheight%
- +\mdf@innertopmargin@length%
- +\mdf@splitbottomskip@length%
- }%
+ \setlength{\mdfboundingboxheight}{\dimexpr\bc@mdfboxheight+\mdf@innertopmargin@length+\mdf@splitbottomskip@length\relax}%
\ifbool{mdf@topline}{\addtolength{\mdfboundingboxheight}{\mdf@middlelinewidth@length}}{}%
- \setlength{\mdfboundingboxwidth}{%
- +\mdf@innerleftmargin@length%
- +\bc@mdfboxwidth
- +\mdf@innerrightmargin@length%
- }%
+ \setlength{\mdfboundingboxwidth}{\dimexpr\mdf@innerleftmargin@length+\bc@mdfboxwidth+\mdf@innerrightmargin@length\relax}%
\ifbool{mdf@leftline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
\ifbool{mdf@rightline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
\psset{linearc=\mdf@roundcorner@length}%
}%
\rput[tl](\dimexpr0.5\bcval@framesep+\mdf@middlelinewidth@length,%
\dimexpr\mdfboundingboxheight-0.75\bcval@framesep-\mdf@middlelinewidth@length){\box\bc@envbox}%
- \rput[bl](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep,0){\bc@barre}%
+ \rput[b](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep+0.5\logowidth,0){\bc@barre}%
\rput[bl](\dimexpr\mdf@innerleftmargin@length+\mdf@middlelinewidth@length,0){\box\tw@}%
\end{pspicture}%
}%
\def\md@putbox@middle{%milieu d'une boite coupée (occupe une page entière)
\leftline{\null\hspace*{\mdf@leftmargin@length}%%
\setlength\bc@mdfboxwidth{\wd\tw@}%
- \setlength\bc@mdfboxheight{\ht\tw@+\dp\tw@}%
+ \setlength\bc@mdfboxheight{\dimexpr\ht\tw@+\dp\tw@\relax}%
\setlength{\bc@invboxh}{\bc@mdfboxheight}%
- \setlength{\mdfboundingboxheight}{%
- +\bc@mdfboxheight%
- +\mdf@splitbottomskip@length%
- }%
- \setlength{\mdfboundingboxwidth}{%
- +\mdf@innerleftmargin@length%
- +\bc@mdfboxwidth%
- +\mdf@innerrightmargin@length%
- }%
+ \setlength{\mdfboundingboxheight}{\dimexpr\bc@mdfboxheight+\mdf@splitbottomskip@length\relax}%
+ \setlength{\mdfboundingboxwidth}{\dimexpr\mdf@innerleftmargin@length+\bc@mdfboxwidth+\mdf@innerrightmargin@length\relax}%
\ifbool{mdf@leftline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
\ifbool{mdf@rightline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
\psset{linearc=\mdf@roundcorner@length}%
(\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)%
(\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,0)%
\fi%
- \rput[bl](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep,0){\bc@barre}%
+ \rput[b](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep+0.5\logowidth,0){\bc@barre}%
\rput[bl](\dimexpr\mdf@innerleftmargin@length+\mdf@middlelinewidth@length,0){\box\tw@}%
\end{pspicture}%
}%
\def\md@putbox@second{%pied d'une boite coupée
\leftline{\null\hspace*{\mdf@leftmargin@length}%%
\setlength\bc@mdfboxwidth{\wd\@tempboxa}%
- \setlength\bc@mdfboxheight{\ht\@tempboxa+\dp\@tempboxa}%
+ \setlength\bc@mdfboxheight{\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}%
\setlength{\bc@invboxh}{\bc@mdfboxheight}%
- \setlength{\mdfboundingboxheight}{%
- +\bc@mdfboxheight%
- +\mdf@innerbottommargin@length%
- }%
+ \setlength{\mdfboundingboxheight}{\dimexpr\bc@mdfboxheight+\mdf@innerbottommargin@length\relax}%
\ifbool{mdf@bottomline}{\addtolength{\mdfboundingboxheight}{\mdf@middlelinewidth@length}}{}%
- \setlength{\mdfboundingboxwidth}{%
- +\mdf@innerleftmargin@length%
- +\bc@mdfboxwidth
- +\mdf@innerrightmargin@length%
- }%
+ \setlength{\mdfboundingboxwidth}{\dimexpr+\mdf@innerleftmargin@length+\bc@mdfboxwidth+\mdf@innerrightmargin@length\relax}%
\ifbool{mdf@leftline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
\ifbool{mdf@rightline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
\psset{linearc=\mdf@roundcorner@length}%
(\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)%
\fi%
}%
- \rput[bl](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep,%
+ \rput[b](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep+0.5\logowidth,%
\dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length){\bc@barre}%
\rput[bl](\dimexpr\mdf@innerleftmargin@length+\mdf@middlelinewidth@length,%
\dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length){\box\@tempboxa}%
}%
{}%
}{}%
- \tikzset{mdftext/.style={inner sep=0pt,outer sep=0pt}}%
+ \tikzset{mdftext/.style={inner sep=0pt,outer sep=0pt,\mdf@fontcolor}}%
\tikzset{mdfcorners/.style={rounded corners=\mdf@roundcorner@length}}%
\tikzset{mdfbackground/.style={fill=\mdf@backgroundcolor}}%
\ifdimgreater{\mdf@outerlinewidth@length}{\z@}%
\leftline{\null\hspace*{\mdf@leftmargin@length}%%
\md@tikz@settings%
\setlength\bc@mdfboxwidth{\wd\@tempboxa}%
- \setlength\bc@mdfboxheight{\ht\@tempboxa+\dp\@tempboxa}%
+ \setlength\bc@mdfboxheight{\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}%
\setlength{\bc@invboxh}{\bc@mdfboxheight}%
\begin{tikzpicture}%
\coordinate(O)at(0,0);%
\clip[preaction=mdfborderA]%
[postaction={mdfbackground,mdfborderI}]%
[mdfcorners](O)--(O|-P)--(P)--(P|-O)--cycle;%
- \end{scope}%
\path[mdfmiddle,mdfcorners,draw=\ifKV@bclogo@noborder none\else\bcval@couleurBord\fi](O)--(O|-P)--(P)--(P|-O)--cycle;
\node[mdftext,anchor=north west]at%
(\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep,%
- \y-0.75*\bcval@framesep-\mdf@innerlinewidth@length-0.5*\mdf@middlelinewidth@length){\box\bc@envbox};
- \node[mdftext,anchor=south west]at(\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep,\yp){\bc@barre};
- \node[mdftext,anchor=south west]at(\xp,\yp){\box\@tempboxa};
+ \y-0.75*\bcval@framesep-\mdf@innerlinewidth@length-0.5*\mdf@middlelinewidth@length){\box\bc@envbox};%
+ \node[mdftext,anchor=south]at(\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,\yp){\bc@barre};%
+ \node[mdftext,anchor=south west]at(\xp,\yp){\box\@tempboxa};%
+ \end{scope}%
%\draw[fill] (0,0) circle (.1cm);
%\draw[fill,yellow] (\x,\y) circle (.1cm);
%\draw[fill,orange] (\xp,\yp) circle (.05cm);
\leftline{\null\hspace*{\mdf@leftmargin@length}%%
\md@tikz@settings%
\setlength\bc@mdfboxwidth{\wd\tw@}%
- \setlength\bc@mdfboxheight{\ht\tw@+\dp\tw@}%
+ \setlength\bc@mdfboxheight{\dimexpr\ht\tw@+\dp\tw@\relax}%
\setlength{\bc@invboxh}{\bc@mdfboxheight}%
\ifdimequal{\pagegoal}{\maxdimen}{\enlargethispage{\baselineskip}}{}%
\begin{tikzpicture}%
\clip[preaction=mdfborderA]%
[postaction={mdfbackground,mdfborderI}]%
[mdfcorners](O|-P)--(O)--(P|-O)--(P);%
- \end{scope}%
\path[mdfmiddle,mdfcorners,mdfbackground,draw=\ifKV@bclogo@noborder none\else \bcval@couleurBord\fi](O|-P)--(O)--(P|-O)--(P);
\node[mdftext,anchor=north west]at(\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep,%
-0.75*\bcval@framesep-\mdf@innerlinewidth@length-0.5*\mdf@middlelinewidth@length){\box\bc@envbox};%
- \node[mdftext,anchor=south west]at(\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep,\y){\bc@barre};%
+ \node[mdftext,anchor=south]at(\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,\y){\bc@barre};%
\node[mdftext,anchor=west,inner sep=0pt,outer sep=0pt]at(\xp,\yp){\box\tw@};%
+ \end{scope}%
%\draw[fill] (0,0) circle (.1cm);
%\draw[fill,yellow] (\x,\y) circle (.1cm);
%\draw[fill,orange] (\xp,\yp) circle (.05cm);
\leftline{\null\hspace*{\mdf@leftmargin@length}%%
\md@tikz@settings%
\setlength\bc@mdfboxwidth{\wd\tw@}%
- \setlength\bc@mdfboxheight{\ht\tw@+\dp\tw@}%
+ \setlength\bc@mdfboxheight{\dimexpr\ht\tw@+\dp\tw@\relax}%
\setlength{\bc@invboxh}{\bc@mdfboxheight}%
%\setlength{\bc@mdf@ymargin@length}{0.4\baselineskip}%
\begin{tikzpicture}%
\clip%
[postaction=mdfbackground](O)--(O|-P)--(P)--(P|-O);%
\path[mdfborderI](O)--(O|-P)(P)--(P|-O);%
- \end{scope}%
\path[mdfmiddle,draw=\ifKV@bclogo@noborder none\else \bcval@couleurBord\fi](O)--(O|-P)(P)--(P|-O);%
- \node[mdftext,anchor=south west]at(\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep,0){\bc@barre};%
- \node[mdftext,anchor=south west]at(\xp,\yp){\color{\mdf@fontcolor}\box\tw@};%
+ \node[mdftext,anchor=south]at(\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,0){\bc@barre};%
+ \node[mdftext,anchor=south west]at(\xp,\yp){\box\tw@};%
+ \end{scope}%
\end{tikzpicture}%
}%
}%
\leftline{\null\hspace*{\mdf@leftmargin@length}%%
\md@tikz@settings%
\setlength\bc@mdfboxwidth{\wd\@tempboxa}%
- \setlength\bc@mdfboxheight{\ht\@tempboxa+\dp\@tempboxa}%
+ \setlength\bc@mdfboxheight{\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}%
\setlength{\bc@invboxh}{\bc@mdfboxheight}%
\begin{tikzpicture}%
\coordinate(O)at(0,0);%
\clip[preaction=mdfborderA]%
[postaction={mdfbackground,mdfborderI}]%
[mdfcorners](P-|O)--(O)--(O-|P)--(P);%
- \end{scope}%
\path[mdfmiddle,mdfcorners,draw=\ifKV@bclogo@noborder none\else \bcval@couleurBord\fi](P-|O)--(O)--(O-|P)--(P);%
- \node[mdftext,anchor=south west]at(\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep,\yp){\bc@barre};%
- \node[mdftext,anchor=south west] at (\xp,\yp){\color{\mdf@fontcolor}\box\@tempboxa};%
+ \node[mdftext,anchor=south]at(\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,\yp){\bc@barre};%
+ \node[mdftext,anchor=south west] at (\xp,\yp){\box\@tempboxa};%
+ \end{scope}%
\end{tikzpicture}%
}%
}%