X-Git-Url: https://melusine.eu.org/syracuse/G/git/?a=blobdiff_plain;f=dev%2Flatex%2Fbclogo.sty;h=4dcf5cf3d177e86df55a2080ea8c7589bedf3239;hb=e38c83f8c70907c4e5ad49c0e887af5239b63c80;hp=a91063fea051b18d6f70963af88467ec6895ba05;hpb=7a9c3b15fec77cbdac85e30da09c93030a385fff;p=bclogo.git diff --git a/dev/latex/bclogo.sty b/dev/latex/bclogo.sty index a91063f..4dcf5cf 100644 --- a/dev/latex/bclogo.sty +++ b/dev/latex/bclogo.sty @@ -1,50 +1,42 @@ \NeedsTeXFormat{LaTeX2e}% \def\PackageName{bclogo}% \def\fileversion{v3.0}% -\def\filedate{2011/10/01}% +\def\filedate{2012/07/21}% \ProvidesPackage{bclogo}[\filedate\space\fileversion]% - +% % Extensions a charger \RequirePackage{xkeyval,ifthen}% \RequirePackage{graphicx}% -\RequirePackage{mdframed}% - %% Les options globales du package sont au nombre de 2: tikz ou pstricks \newif\ifbclogotikz% \newif\ifbclogoblur% \define@key{bclogo.sty}{tikz}[]{\bclogotikztrue}% \define@key{bclogo.sty}{pstricks}[]{\bclogotikzfalse}% \define@key{bclogo.sty}{blur}[]{\bclogoblurtrue}% - +% % quelques dimensions \newlength{\bc@invboxh}\newlength{\bc@invboxd}% \newlength{\bc@titleLength}% -\newlength{\logowidth} -\newlength{\bc@mdfboxwidth} -\newlength{\bc@mdfboxheight} -% \newlength{\bc@mdf@ymargin@length} - +\newlength{\logowidth}% +% \setlength{\logowidth}{17pt}% \ProcessOptionsX% % - \ifbclogotikz% \RequirePackage{tikz}% + \RequirePackage[framemethod=tikz]{mdframed}%mdframed2 \usetikzlibrary{shadows}% pour l'ombre - \usetikzlibrary{decorations.pathmorphing} % pour la barre ondulee - \def\bc@mdf@style{1}% - \input{bclogoMdframedTikz}% + \usetikzlibrary{decorations.pathmorphing}% pour la barre ondulee \else% \RequirePackage{pstricks}% \RequirePackage{pst-grad}% \RequirePackage{pst-coil}% pour la barre ondulee + \RequirePackage[framemethod=pstricks]{mdframed}%mdframed2 \ifbclogoblur% \RequirePackage{pst-blur}% \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}% - \input{bclogoMdframedPst}% \fi% \edef\Gin@extensions{.mps,\Gin@extensions}% \RequirePackage{ifpdf}% @@ -59,13 +51,10 @@ % panneau chantier (Jean-Michel Sarlat) \newcommand\bcpanchant{\includegraphics[width=\logowidth]{bc-aux-301}}% % ours -%\newcommand\bcours{\begingroup\input{bc-ours.tex}\endgroup} \newcommand\bcours{\includegraphics[width=\logowidth]{bc-ours}}% % etoile -%\newcommand\bcetoile{\begingroup\input{bc-etoile.tex}\endgroup} \newcommand\bcetoile{\includegraphics[width=\logowidth]{bc-etoile}}% % attention -%\newcommand\bcattention{\begingroup\input{bc-attention.tex}\endgroup} \newcommand\bcattention{\includegraphics[width=\logowidth]{bc-attention}}% % attention P.Fradin \newcommand\bctakecare{\includegraphics[width=\logowidth]{bc-takecare}}% @@ -163,9 +152,9 @@ \define@key{bclogo}{logo}[\bcfleur]{\def\bcval@logo{#1}}% \define@key{bclogo}{couleur}[white]{\def\bcval@couleur{#1}}% \define@key{bclogo}{arrondi}[0]{\def\bcval@arrondi{#1}}% -\define@key{bclogo}{epOmbre}[0.125]{\def\bcval@epOmbre{#1}}% +\define@key{bclogo}{epOmbre}[0.2]{\def\bcval@epOmbre{#1}}% \define@key{bclogo}{arrondi}[0]{\def\bcval@arrondi{#1}}% -\define@key{bclogo}{couleurOmbre}[black]{\def\bcval@couleurOmbre{#1}}% +\define@key{bclogo}{couleurOmbre}[black!30]{\def\bcval@couleurOmbre{#1}}% \define@key{bclogo}{couleurBarre}[black]{\def\bcval@couleurBarre{#1}}% \define@key{bclogo}{couleurBord}[black]{\def\bcval@couleurBord{#1}}% modification Philippe Fortemps \define@key{bclogo}{couleurTexte}[black]{\def\bcval@couleurTexte{#1}}% @@ -184,20 +173,20 @@ \define@boolkey{bclogo}{noborder}[true]{\ifKV@bclogo@noborder\setlength{\bcval@borderWidth}{\z@}\fi}% \define@boolkey{bclogo}{ombre}[true]{}% \define@boolkey{bclogo}{avecBarre}[true]{}% -\define@boolkey{bclogo}{nobreak}[false]{}% +\define@boolkey{bclogo}{nobreak}[true]{}% \define@boolkey{bclogo}{blur}[true]{\ifKV@bclogo@blur\KV@bclogo@ombretrue\fi}% -\define@choicekey{bclogo}{barre}{none,line,snake,motif,zigzag,imageExt,imageClip, wave}[line]{% -\ifthenelse{\equal{#1}{none}}{\KV@bclogo@avecBarrefalse}% +\define@choicekey{bclogo}{barre}{none,line,snake,motif,zigzag,imageExt,imageClip,wave}[line]{% +\ifthenelse{\equal{#1}{none}}{\KV@bclogo@avecBarrefalse\gdef\bc@barre{}}% {\gdef\bc@barre{\ifKV@bclogo@avecBarre\@nameuse{bc@barre#1}\fi}}% }% % % selection par defaut \presetkeys{bclogo}{logo,barre,couleur,arrondi,couleurOmbre,couleurTexte,couleurBarre,epOmbre,epBarre,epBord,tailleOndu,ombre=false,cadreTitre=false,% -avecBarre=true,noborder=false,marge,sousTitre, couleurBord,blur=false,nobreak=false}{}% +avecBarre=true,noborder=false,marge,sousTitre,couleurBord,blur=false,nobreak=false}{}% % %les differentes commandes de barre verticale a gauche % -\newcommand{\bc@barreline}{% +\newcommand*{\bc@barreline}{% \begin{minipage}{\logowidth}\centering% \ifbclogotikz% \begin{tikzpicture}% @@ -208,19 +197,11 @@ avecBarre=true,noborder=false,marge,sousTitre, couleurBord,blur=false,nobreak=fa \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}]% @@ -231,9 +212,10 @@ avecBarre=true,noborder=false,marge,sousTitre, couleurBord,blur=false,nobreak=fa \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}]% @@ -244,18 +226,34 @@ avecBarre=true,noborder=false,marge,sousTitre, couleurBord,blur=false,nobreak=fa \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 @@ -267,6 +265,88 @@ clip=true]{\bcval@imageBarre}% \newcommand\bcStyleTitre[1]{\large \textbf{#1}}% %======================= L'environnement ======================================= % +\ifbclogotikz%définition du style bclogo pour mdframed +\mdfdefinestyle{bc@style}{% +apptotikzsetting={\ifKV@bclogo@blur\tikzset{mdfshadow/.style={%% semblant de blur... +preaction={fill=\bcval@couleurOmbre,line width=5,line join=round,opacity=0.1,draw=\bcval@couleurOmbre,% + transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}},% +preaction={fill=\bcval@couleurOmbre,line width=4,line join=round,opacity=0.15,draw=\bcval@couleurOmbre,% + transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}},% +preaction={fill=\bcval@couleurOmbre,line width=3,line join=round,opacity=0.2,draw=\bcval@couleurOmbre,% + transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}},% +preaction={fill=\bcval@couleurOmbre,line width=2,line join=round,opacity=0.3,draw=\bcval@couleurOmbre,% + transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}},% +preaction={fill=\bcval@couleurOmbre,line width=1,line join=round,opacity=0.4,draw=\bcval@couleurOmbre,% + transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}},% +preaction={fill=\bcval@couleurOmbre,line width=0.5,line join=round,opacity=0.4,draw=\bcval@couleurOmbre,% + transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}}% + }}\fi% +},% +singleextra={% +\setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-2\mdf@innerlinewidth@length-2\mdf@outerlinewidth@length-% +2\mdf@middlelinewidth@length-\mdf@innertopmargin@length-\mdf@innerbottommargin@length\relax}% +\node[mdfbox,anchor=north west,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep,% + yshift=-0.75*\bcval@framesep-\mdf@innerlinewidth@length-0.5*\mdf@middlelinewidth@length]at% + (P-|O){\box\bc@envbox};% +\node[mdfbox,anchor=south,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,% + yshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+\bcval@framesep]at(O){\bc@barre};% +},% +firstextra={% +\setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@innerlinewidth@length-\mdf@outerlinewidth@length-% +\mdf@middlelinewidth@length-\mdf@innertopmargin@length-\mdf@splitbottomskip@length\relax}% +\node[mdfbox,anchor=north west,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep,% + yshift=-0.75*\bcval@framesep-\mdf@innerlinewidth@length-0.5*\mdf@middlelinewidth@length]at% + (P-|O){\box\bc@envbox};% +\node[mdfbox,anchor=south,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,% + yshift=\mdf@splitbottomskip@length]at(O){\bc@barre};% +},% +middleextra={% +\setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@splitbottomskip@length-\mdf@splittopskip@length\relax},% +\node[mdfbox,anchor=south,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,% + yshift=\mdf@splitbottomskip@length]at(O){\bc@barre};% +},% +secondextra={% +\setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@innerlinewidth@length-\mdf@outerlinewidth@length-% +\mdf@middlelinewidth@length-\mdf@splittopskip@length-\mdf@innerbottommargin@length\relax}% +\node[mdfbox,anchor=south,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,% + yshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.75*\bcval@framesep]at(O){\bc@barre};% +}% +}% +\else%pstricks +\mdfdefinestyle{bc@style}{% +pstrickssetting={blur=\ifbclogoblur true\else false\fi},% +singleextra={% +\setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-2\mdf@innerlinewidth@length-2\mdf@outerlinewidth@length-% +2\mdf@middlelinewidth@length-\mdf@innertopmargin@length-\mdf@innerbottommargin@length\relax}% +\rput[tl](\dimexpr\mdf@innerlinewidth@length+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length+0.5\bcval@framesep\relax,% + \dimexpr\mdfboundingboxheight-0.75\bcval@framesep-\mdf@middlelinewidth@length-% + \mdf@innerlinewidth@length-\mdf@outerlinewidth@length\relax){\box\bc@envbox}% +\rput[b](\dimexpr\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+0.5\bcval@framesep+0.5\logowidth+\mdf@innerlinewidth@length\relax,% + \dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+\mdf@innerlinewidth@length\relax){\bc@barre}% +},% +firstextra={% +\setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@innerlinewidth@length-\mdf@outerlinewidth@length-% +\mdf@middlelinewidth@length-\mdf@innertopmargin@length-\mdf@splitbottomskip@length\relax}% +\rput[tl](\dimexpr\mdf@innerlinewidth@length+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length+0.5\bcval@framesep\relax,% + \dimexpr\mdfboundingboxheight-0.75\bcval@framesep-\mdf@middlelinewidth@length-% + \mdf@innerlinewidth@length-\mdf@outerlinewidth@length\relax){\box\bc@envbox}% +\rput[b](\dimexpr\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+0.5\bcval@framesep+0.5\logowidth+\mdf@innerlinewidth@length\relax,% + \mdf@splitbottomskip@length){\bc@barre}% +},% +middleextra={% +\setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@splitbottomskip@length-\mdf@splittopskip@length\relax}% +\rput[b](\dimexpr\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+0.5\bcval@framesep+0.5\logowidth+\mdf@innerlinewidth@length\relax,% + \mdf@splitbottomskip@length){\bc@barre}% +},% +secondextra={% +\setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@innerlinewidth@length-\mdf@outerlinewidth@length-% +\mdf@middlelinewidth@length-\mdf@splittopskip@length-\mdf@innerbottommargin@length\relax}% +\rput[b](\dimexpr\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+0.5\bcval@framesep+0.5\logowidth+\mdf@innerlinewidth@length\relax,% + \dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+\mdf@innerlinewidth@length\relax){\bc@barre}% +}% +}% +\fi% +% \newenvironment*{bclogo}[2][]{% \setkeys{bclogo}{#1}%options \renewcommand*\bclogotitre{#2}% @@ -305,24 +385,33 @@ clip=true]{\bcval@imageBarre}% \end{tabular}% \end{lrbox}% % affichage -%\smallskip% ressort %% Pourquoi ? -\def\bcval@nobreak{\ifKV@bclogo@nobreak true\else false\fi} % gestion nobreak +\smallskip% ressort %% Pourquoi ? %%%parce que ça se comprime et ça s'étire! +\def\bcval@nobreak{\ifKV@bclogo@nobreak true\else false\fi}% gestion nobreak +\def\bcval@shadow{\ifKV@bclogo@ombre true\else false\fi}% gestion ombre +% \mdframed[% + style=bc@style,% 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,% - linewidth=\bcval@borderWidth,% + middlelinewidth=\bcval@borderWidth,% + linecolor=\bcval@couleurBord,% roundcorner={\bcval@arrondi cm},% - nobreak= \bcval@nobreak]% + nobreak=\bcval@nobreak,%l'option nobreak de mdframed vient avec la version 0.9 + shadow=\bcval@shadow,% + shadowsize=\bcval@epOmbre cm,% + shadowcolor=\bcval@couleurOmbre% +]% }% {% \endmdframed\par% -\ifKV@bclogo@ombre\vspace*{\bcval@epOmbre cm}\else\smallskip\fi% +\smallskip% \goodbreak% }% - +\endinput% +%%%%%%%%%%%%%%%% fin %%%%%%%%%%%%%%%%