X-Git-Url: https://melusine.eu.org/syracuse/G/git/?p=bclogo.git;a=blobdiff_plain;f=dev%2Flatex%2Fbclogo.sty;fp=dev%2Flatex%2Fbclogo.sty;h=a7c4653b067fd84cfa36ac3523a8afd41868e51d;hp=c396a09831fa2d8c928bfa6d5c3497547dea1016;hb=c1190bae1c2a98712d5b7045cada2f56897a7728;hpb=ec0d8b0e9d3b853b14c4c3a46eef2d7160e286c2 diff --git a/dev/latex/bclogo.sty b/dev/latex/bclogo.sty index c396a09..a7c4653 100644 --- a/dev/latex/bclogo.sty +++ b/dev/latex/bclogo.sty @@ -1,16 +1,12 @@ \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}% -\ifdef{\ifmdf@nobreak}{\relax}{\define@key{mdf}{nobreak}[]{}}% -%l'option nobreak de mdframed vient qu'avec la version 0.9 -% %% Les options globales du package sont au nombre de 2: tikz ou pstricks \newif\ifbclogotikz% \newif\ifbclogoblur% @@ -22,30 +18,25 @@ \newlength{\bc@invboxh}\newlength{\bc@invboxd}% \newlength{\bc@titleLength}% \newlength{\logowidth}% -\newlength{\bc@mdfboxwidth}% -\newlength{\bc@mdfboxheight}% -%\newlength{\bc@mdf@ymargin@length} % \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}%pour la version 0.6 de mdframed - \input{bclogoMdframedTikz}%redefinition des macros d'affichage \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}%%pour la version 0.6 de mdframed - \input{bclogoMdframedPst}%redefinition des macros d'affichage \fi% \edef\Gin@extensions{.mps,\Gin@extensions}% \RequirePackage{ifpdf}% @@ -60,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}}% @@ -164,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}}% @@ -187,14 +175,14 @@ \define@boolkey{bclogo}{avecBarre}[true]{}% \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]{% +\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 % @@ -277,6 +265,88 @@ avecBarre=true,noborder=false,marge,sousTitre, couleurBord,blur=false, nobreak=f \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}% @@ -317,7 +387,10 @@ avecBarre=true,noborder=false,marge,sousTitre, couleurBord,blur=false, nobreak=f % 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 +\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,% @@ -326,16 +399,19 @@ avecBarre=true,noborder=false,marge,sousTitre, couleurBord,blur=false, nobreak=f 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%%l'option nobreak de mdframed vient avec la version 0.9 + 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% }% -\setkeys{bclogo}{barre=none}%% en cas d'utlisation de l'environnement mdframed \endinput% %%%%%%%%%%%%%%%% fin %%%%%%%%%%%%%%%%