\NeedsTeXFormat{LaTeX2e} \def\PackageName{bclogo} \def\fileversion{v2.22} \def\filedate{2009/15/01} \ProvidesPackage{bclogo} [\filedate\space\fileversion] \RequirePackage{xkeyval,ifthen} %% Les options globales du package sont au nombre de 2: tikz ou pstricks \newif\iftikz% \define@key{bclogo.sty}{tikz}[]{\tikztrue}% \define@key{bclogo.sty}{pstricks}[]{\tikzfalse}% \newlength{\logowidth}\setlength{\logowidth}{17pt}% \ProcessOptionsX% \iftikz% \RequirePackage{tikz}% \usetikzlibrary{shadows}% pour l'ombre \usetikzlibrary{decorations.pathmorphing} % pour la barre ondulee \else% \RequirePackage{graphicx}% \RequirePackage{pstricks}% \RequirePackage{pst-grad}% \RequirePackage{pst-coil}% pour la barre ondulee \fi% % les symboles % ============================================================================== % si l'option tikz est chargee \iftikz% % la fleur \newcommand\bcfleur{\includegraphics[width=\logowidth]{bc-fleur}} % une note (Thomas Labarussias) \newcommand\bcnote{\includegraphics[width=\logowidth]{bc-note}} % panneau chantier (Jean-Michel Sarlat) \newcommand\bcpanchant{\includegraphics[width=\logowidth]{bc-aux-301}} % ours \newcommand\bcours{\includegraphics[width=\logowidth]{bc-ours}} % etoile \newcommand\bcetoile{\includegraphics[width=\logowidth]{bc-etoile}} % attention \newcommand\bcattention{\includegraphics[width=\logowidth]{bc-attention}} % attention P.Fradin \newcommand\bctakecare{\begingroup\input{bc-takecare.pgf}\endgroup} % lampe P.Fradin \newcommand\bclampe{\begingroup\input{bc-lampe.pgf}\endgroup} % coeur \newcommand\bccoeur{\includegraphics[width=\logowidth]{bc-coeur}} % ornement (tire du site http://openclipart.org ) \newcommand\bcorne{\includegraphics[width=\logowidth]{bc-orne}} % danger (Francois) \newcommand\bcdanger{\includegraphics[width=\logowidth]{bc-danger}} % smiley bonne humeur (Francois) \newcommand\bcsmbh{\includegraphics[width=\logowidth]{bc-smiley_bonnehumeur}} % smiley bonne humeur (Francois) \newcommand\bcsmmh{\includegraphics[width=\logowidth]{bc-smiley_mauvaisehumeur}} % le trefle \newcommand\bctrefle{\includegraphics[width=\logowidth]{bc-trefle}} % le livre \newcommand\bcbook{\begingroup\input{bc-book.pgf}\endgroup} % point d'interrogation \newcommand\bcquestion{\includegraphics[width=\logowidth]{bc-inter}} % crayon anne-sophie philippe \newcommand\bccrayon{\includegraphics[width=\logowidth]{bc-crayon}} % le pic LaTeX \newcommand\bcspadesuit{\centering \huge $\spadesuit$} % si l'option pstricks (par defaut) \else % la fleur \newcommand\bcfleur{\begingroup\input{bc-fleur.tex}\endgroup} % une note (Thomas Labarussias) \newcommand\bcnote{\begingroup\input{bc-note.tex}\endgroup} % panneau chantier (Jean-Michel Sarlat) \newcommand\bcpanchant{\includegraphics[width=\logowidth]{bc-aux-301.eps}} % ours \newcommand\bcours{\begingroup\input{bc-ours.tex}\endgroup} % etoile \newcommand\bcetoile{\begingroup\input{bc-etoile.tex}\endgroup} % attention \newcommand\bcattention{\begingroup\input{bc-attention.tex}\endgroup} % attention P.Fradin \newcommand\bctakecare{\begingroup\input{bc-takecare.pst}\endgroup} % lampe P.Fradin \newcommand\bclampe{\begingroup\input{bc-lampe.pst}\endgroup} % coeur \newcommand\bccoeur{\begingroup\input{bc-coeur.tex}\endgroup} % ornement (tire du site http://openclipart.org ) \newcommand\bcorne{\begingroup\input{bc-orne.tex}\endgroup} % danger (Francois) \newcommand\bcdanger{\begingroup\input{bc-danger.tex}\endgroup} % smiley bonne humeur (Francois) \newcommand\bcsmbh{\begingroup\input{bc-smiley_bonnehumeur.tex}\endgroup} % smiley bonne humeur (Francois) \newcommand\bcsmmh{\begingroup\input{bc-smiley_mauvaisehumeur.tex}\endgroup} % le trefle \newcommand\bctrefle{\begingroup\input{bc-trefle.tex}\endgroup} % le livre \newcommand\bcbook{\begingroup\input{bc-book.pst}\endgroup} % point d'interrogation \newcommand\bcquestion{\begingroup\input{bc-inter.tex}\endgroup} % crayon anne-sophie philippe \newcommand\bccrayon{\begingroup\input{bc-crayon.tex}\endgroup} % le pic LaTeX \newcommand\bcspadesuit{\centering \huge $\spadesuit$} \fi % =========================== La fonction listable ============================= \newcommand{\titrebclogo}{Liste des \texttt{bclogo}} \newcommand\bccaption[1]{\addcontentsline{bcl}{bclogo}{#1}} \newcommand\listofbclogo{\section*{\titrebclogo}\@starttoc{bcl}} \newcommand\l@bclogo[2]{\par\noindent #1,~\textit{page~#2}} \newcounter{bclogocompteur} % idee de Francois Petiard % ======================================= les keys ============================= \newlength{\val@epBarre} % on definit une longueur : l'epaisseur de la barre \newlength{\val@tailleOndu} % on definit une longueur : taille d'une ondulation \define@key{bclogo}{logo}[\bcfleur]{\def\val@logo{#1}} \define@key{bclogo}{couleur}[white]{\def\val@couleur{#1}} \define@key{bclogo}{arrondi}[0]{\def\val@arrondi{#1}} \define@key{bclogo}{epOmbre}[0.125]{\def\val@epOmbre{#1}} \define@key{bclogo}{arrondi}[0]{\def\val@arrondi{#1}} \define@key{bclogo}{couleurOmbre}[black]{\def\val@couleurOmbre{#1}} \define@key{bclogo}{couleurBarre}[black]{\def\val@couleurBarre{#1}} \define@key{bclogo}{imageBarre}[]{\def\val@imageBarre{#1}} \define@key{bclogo}{motifBarre}[*]{\def\val@motifBarre{#1}} \define@key{bclogo}{epBarre}[1.5]{\setlength{\val@epBarre}{#1 pt}} \define@key{bclogo}{tailleOndu}[2.5]{\setlength{\val@tailleOndu}{#1 pt}} \define@boolkey{bclogo}{cadreTitre}[true]{} \define@boolkey{bclogo}{noborder}[true]{} \define@boolkey{bclogo}{ombre}[true]{} \define@boolkey{bclogo}{avecBarre}[true]{} \define@choicekey{bclogo}{barre}{none,line,snake,motif,zigzag,imageExt,imageClip}[line]{% \ifthenelse{\equal{#1}{none}}{\KV@bclogo@avecBarrefalse}% {\def\bc@barre{\@nameuse{bc@barre#1}}}% }% % selection par defaut \presetkeys{bclogo}{logo,barre,couleur,arrondi,couleurOmbre,couleurBarre,epOmbre,epBarre,tailleOndu,ombre=false,cadreTitre=false, avecBarre = true,noborder=false}{}% % les differente commande de barre vertical a gauche \newcommand{\bc@barreline}{\color{\val@couleurBarre}\vrule width \val@epBarre}% \newcommand{\bc@barremotif}{% \begin{minipage}{\logowidth}\color{\val@couleurBarre}\centering% \vbox to \invboxh{\cleaders\vbox{\vss \val@motifBarre \vss}\vfill}% \end{minipage}} \newcommand{\bc@barresnake}{% \begin{minipage}{\logowidth}\centering \iftikz \begin{tikzpicture}[decoration={snake,segment length=2.66\val@tailleOndu, amplitude=\val@tailleOndu}] \draw[decorate,line width=1pt, color=\val@couleurBarre](0,\invboxh)--(0,0);\end{tikzpicture}% \else \psset{unit=1pt} \begin{pspicture}(0,0)(0,\invboxh) \pszigzag[coilarm=0pt,coilwidth=2\val@tailleOndu,linewidth=1pt, linearc=1pt,coilheight=1.33,linecolor=\val@couleurBarre](0,\invboxh)(0,0) \end{pspicture}% \fi \end{minipage}}% \newcommand{\bc@barrezigzag}{% \begin{minipage}{\logowidth}\centering \iftikz \begin{tikzpicture}[decoration={zigzag,segment length=2.66\val@tailleOndu, amplitude=\val@tailleOndu}] \draw[decorate,line width=1pt,color=\val@couleurBarre](0,\invboxh)--(0,0);\end{tikzpicture}% \else \psset{unit=1pt} \begin{pspicture}(0,0)(0,\invboxh) \pszigzag[coilarm=0pt,coilwidth=2\val@tailleOndu,linewidth=1pt,coilheight=1.33,linecolor=\val@couleurBarre](0,\invboxh)(0,0) \end{pspicture}% \fi \end{minipage}}% \newcommand{\bc@barreimageExt}{% l'image est deformee \begin{minipage}{\logowidth}\centering \includegraphics[width=\logowidth,height=\invboxh]{\val@imageBarre} \end{minipage} }% \newcommand{\bc@barreimageClip}{% \begin{minipage}{\logowidth}\centering \includegraphics[viewport=0 0 \logowidth~ \invboxh,% clip=true]{\val@imageBarre}% \end{minipage} }% %======================= Quelques definitions=================================== % boite globale \newsavebox{\envbox} % boite interieure la ligne 2 du tableau barre + texte \newsavebox{\invbox} % pour la hauteur de la boite \newlength{\invboxh}\newlength{\invboxd} %%% precaution JCC \newcommand*\bclogotitre{} \newlength{\pgfframesep} \setlength{\pgfframesep}{\iftikz3pt\else\psframesep\fi} %======================= L'environnement ======================================= \newenvironment*{bclogo}[2][]{% \setkeys{bclogo}{#1}%on recupere les options \par\noindent% attention au retrait d'alinea % on definit les commandes qui seront utilisees dans la seconde % parti de l'environnement % la commande pour le titre \renewcommand*\bclogotitre{#2} % La commande pour les coins arrondis \newcommand{\arr}{\val@arrondi} % deux types de titres \ifKV@bclogo@cadreTitre% si cadreTitre = true \newcommand{\structitre}{% \iftikz% cadreTitre tizk \hfil \begin{tikzpicture}\node[rectangle, thick, top color=red!60!green!40, bottom color=white,draw]{\large #2}; \end{tikzpicture}% \hfil% \else% cadreTitre pstricks \hfil \psframebox[fillstyle=gradient,gradmidpoint=0.2, gradangle=0,gradbegin=red!60!green!40, gradend=white]{\large #2}% \hfil% \fi% } \else %sinon cadreTitre = false \newcommand{\structitre}{\large \textbf{#2}}% \fi% \begin{lrbox}{\invbox}% \begin{minipage}{\dimexpr\linewidth-2\pgfframesep-4pt-\logowidth-\ifKV@bclogo@ombre\val@epOmbre cm\else0pt\fi\relax}% }% {% \end{minipage}% \end{lrbox}% % calcul de la hauteur totale de la boite intéreure \settoheight{\invboxh}{\usebox{\invbox}}% \settodepth{\invboxd}{\usebox{\invbox}}% \addtolength{\invboxh}{\invboxd}% % on commence la boite interieur ou est le texte et la barre vertical \begin{lrbox}{\envbox}% \begin{tabular}{@{}c@{}p{\dimexpr\linewidth-2 \pgfframesep-4pt-\logowidth-\ifKV@bclogo@ombre\val@epOmbre cm\else0pt \fi}@{}} \begin{minipage}{\logowidth}{\refstepcounter{bclogocompteur}\bccaption{\bclogotitre}\val@logo}\end{minipage}&% \ifKV@bclogo@cadreTitre% \begin{minipage}{\dimexpr\linewidth-2 \pgfframesep-4pt-\logowidth-\ifKV@bclogo@ombre\val@epOmbre cm\else0pt \fi}{\structitre}\end{minipage}% \else\structitre\fi\\% \ifKV@bclogo@avecBarre% si il y a une barre verticale \bc@barre&\usebox{\invbox}% \else% sinon \multicolumn{2}{c}{\usebox{\invbox}}% \fi% \end{tabular}% \end{lrbox}% % Affiche l'ensemble dans un cadre en couleur. \iftikz% tikz \par\noindent \begin{tikzpicture}% \ifKV@bclogo@ombre%cadre ombre \node[fill=\val@couleur,thick, shape=rectangle, inner sep=\pgfframesep, rounded corners=\arr cm,% general shadow={fill=\val@couleurOmbre},shadow xshift=\val@epOmbre cm, shadow yshift=-\val@epOmbre cm, draw=\ifKV@bclogo@noborder none\else black\fi]{\usebox{\envbox}}; \else%cadre sans ombre \node[fill=\val@couleur,thick, shape=rectangle, inner sep=\pgfframesep,rounded corners=\arr cm, draw=\ifKV@bclogo@noborder none\else black\fi]{\usebox{\envbox}}; \fi \end{tikzpicture} \par% \else% pstricks \noindent \ifKV@bclogo@ombre%cadre ombre \psframebox[cornersize=absolute,linearc=\dimexpr\arr cm * 2,fillstyle=solid, shadow=true, shadowsize=\val@epOmbre cm,% shadowcolor=\val@couleurOmbre, fillcolor=\val@couleur,linestyle=\ifKV@bclogo@noborder none\else solid\fi]{\usebox{\envbox}} \else%cadre sans ombre \psframebox[cornersize=absolute,linearc=\dimexpr\arr cm * 2 ,fillstyle=solid, fillcolor=\val@couleur,linestyle=\ifKV@bclogo@noborder none\else solid\fi]{\usebox{\envbox}} \fi% \par\vspace*{0.2cm} \fi%fin \ifKV@bclogo@ombre\vspace*{\val@epOmbre cm}\fi }%