summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bclogo/bclogo.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/bclogo/bclogo.sty')
-rw-r--r--Master/texmf-dist/tex/latex/bclogo/bclogo.sty280
1 files changed, 194 insertions, 86 deletions
diff --git a/Master/texmf-dist/tex/latex/bclogo/bclogo.sty b/Master/texmf-dist/tex/latex/bclogo/bclogo.sty
index 34df91222ed..174e321333b 100644
--- a/Master/texmf-dist/tex/latex/bclogo/bclogo.sty
+++ b/Master/texmf-dist/tex/latex/bclogo/bclogo.sty
@@ -1,185 +1,293 @@
\NeedsTeXFormat{LaTeX2e}
\def\PackageName{bclogo}
-\def\fileversion{v2.1}
-\def\filedate{2009/04/01}
+\def\fileversion{v2.22}
+\def\filedate{2009/15/01}
\ProvidesPackage{bclogo}
[\filedate\space\fileversion]
-\RequirePackage{xkeyval}
+\RequirePackage{xkeyval,ifthen}
%% Les options globales du package sont au nombre de 2: tikz ou pstricks
-\newif\iftikz\tikzfalse%
-\define@key{bclogo.sty}{pstricks}[]{\tikzfalse}%
+\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}%
+\usetikzlibrary{shadows}% pour l'ombre
+\usetikzlibrary{decorations.pathmorphing} % pour la barre ondulee
\else%
+\RequirePackage{graphicx}%
\RequirePackage{pstricks}%
\RequirePackage{pst-grad}%
-\RequirePackage{graphicx}%
+\RequirePackage{pst-coil}% pour la barre ondulee
\fi%
% les symboles
% ==============================================================================
+
+% si l'option tikz est chargee
\iftikz%
% la fleur
-\newcommand\bcfleur{\includegraphics[width=17pt]{fleur}}
-% une note (Thomas Laburussias)
-\newcommand\bcnote{\includegraphics[width=17pt]{note}}
+\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=17pt]{aux-301}}
+\newcommand\bcpanchant{\includegraphics[width=\logowidth]{bc-aux-301}}
% ours
-\newcommand\bcours{\includegraphics[width=17pt]{ours}}
+\newcommand\bcours{\includegraphics[width=\logowidth]{bc-ours}}
% etoile
-\newcommand\bcetoile{\includegraphics[width=17pt]{etoile}}
+\newcommand\bcetoile{\includegraphics[width=\logowidth]{bc-etoile}}
% attention
-\newcommand\bcattention{\includegraphics[width=17pt]{attention}}
+\newcommand\bcattention{\includegraphics[width=\logowidth]{bc-attention}}
% attention P.Fradin
-\newcommand\bctakecare{\begingroup\input{takecare.pgf}\endgroup}
+\newcommand\bctakecare{\begingroup\input{bc-takecare.pgf}\endgroup}
% lampe P.Fradin
-\newcommand\bclampe{\begingroup\input{lampe.pgf}\endgroup}
+\newcommand\bclampe{\begingroup\input{bc-lampe.pgf}\endgroup}
% coeur
-\newcommand\bccoeur{\includegraphics[width=17pt]{coeur}}
+\newcommand\bccoeur{\includegraphics[width=\logowidth]{bc-coeur}}
% ornement (tire du site http://openclipart.org )
-\newcommand\bcorne{\includegraphics[width=17pt]{orne}}
+\newcommand\bcorne{\includegraphics[width=\logowidth]{bc-orne}}
% danger (Francois)
-\newcommand\bcdanger{\includegraphics[width=17pt]{danger}}
+\newcommand\bcdanger{\includegraphics[width=\logowidth]{bc-danger}}
% smiley bonne humeur (Francois)
-\newcommand\bcsmbh{\includegraphics[width=17pt]{smiley_bonnehumeur}}
+\newcommand\bcsmbh{\includegraphics[width=\logowidth]{bc-smiley_bonnehumeur}}
% smiley bonne humeur (Francois)
-\newcommand\bcsmmh{\includegraphics[width=17pt]{smiley_mauvaisehumeur}}
+\newcommand\bcsmmh{\includegraphics[width=\logowidth]{bc-smiley_mauvaisehumeur}}
% le trefle
-\newcommand\bctrefle{\includegraphics[width=17pt]{trefle}}
-% livre P.Fradin
-\newcommand\bcbook{\begingroup\input{book.pgf}\endgroup}
+\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$}
-\else%pstricks
+
+% si l'option pstricks (par defaut)
+\else
% la fleur
-\newcommand\bcfleur{\begingroup\input{fleur.tex}\endgroup}
-% une note (Thomas Laburussias)
-\newcommand\bcnote{\begingroup\input{note.tex}\endgroup}
+\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=17pt]{aux-301.eps}}
+\newcommand\bcpanchant{\includegraphics[width=\logowidth]{bc-aux-301.eps}}
% ours
-\newcommand\bcours{\begingroup\input{ours.tex}\endgroup}
+\newcommand\bcours{\begingroup\input{bc-ours.tex}\endgroup}
% etoile
-\newcommand\bcetoile{\begingroup\input{etoile.tex}\endgroup}
+\newcommand\bcetoile{\begingroup\input{bc-etoile.tex}\endgroup}
% attention
-\newcommand\bcattention{\begingroup\input{attention.tex}\endgroup}
+\newcommand\bcattention{\begingroup\input{bc-attention.tex}\endgroup}
% attention P.Fradin
-\newcommand\bctakecare{\begingroup\input{takecare.pst}\endgroup}
+\newcommand\bctakecare{\begingroup\input{bc-takecare.pst}\endgroup}
% lampe P.Fradin
-\newcommand\bclampe{\begingroup\input{lampe.pst}\endgroup}
+\newcommand\bclampe{\begingroup\input{bc-lampe.pst}\endgroup}
% coeur
-\newcommand\bccoeur{\begingroup\input{coeur.tex}\endgroup}
+\newcommand\bccoeur{\begingroup\input{bc-coeur.tex}\endgroup}
% ornement (tire du site http://openclipart.org )
-\newcommand\bcorne{\begingroup\input{orne.tex}\endgroup}
+\newcommand\bcorne{\begingroup\input{bc-orne.tex}\endgroup}
% danger (Francois)
-\newcommand\bcdanger{\begingroup\input{danger.tex}\endgroup}
+\newcommand\bcdanger{\begingroup\input{bc-danger.tex}\endgroup}
% smiley bonne humeur (Francois)
-\newcommand\bcsmbh{\begingroup\input{smiley_bonnehumeur.tex}\endgroup}
+\newcommand\bcsmbh{\begingroup\input{bc-smiley_bonnehumeur.tex}\endgroup}
% smiley bonne humeur (Francois)
-\newcommand\bcsmmh{\begingroup\input{smiley_mauvaisehumeur.tex}\endgroup}
+\newcommand\bcsmmh{\begingroup\input{bc-smiley_mauvaisehumeur.tex}\endgroup}
% le trefle
-\newcommand\bctrefle{\begingroup\input{trefle.tex}\endgroup}
-% livre P.Fradin
-\newcommand\bcbook{\begingroup\input{book.pst}\endgroup}
+\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@boolkey{bclogo}{cadretitre}[true]{}
+\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, couleur, arrondi, couleurOmbre, epOmbre, ombre=false, cadretitre=false}{}%
+\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
- %%% Ajout de JCC : il faut definir les commandes qui seront
- %%% utilisees dans la deuxieme partie de l'environnement
- %%% commande titre
+ \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
+ % deux types de titres
+ \ifKV@bclogo@cadreTitre% si cadreTitre = true
\newcommand{\structitre}{%
- \iftikz% cadretitre tizk
+ \iftikz% cadreTitre tizk
\hfil
- \raisebox{-0.0ex}{%
- \begin{tikzpicture}\node[rectangle, thick, top color=red!60!green!40, bottom color=white,draw]{\large #2};
- \end{tikzpicture}}
+ \begin{tikzpicture}\node[rectangle, thick, top color=red!60!green!40, bottom color=white,draw]{\large #2};
+ \end{tikzpicture}%
\hfil%
- \else% cadretitre pstricks
+ \else% cadreTitre pstricks
\hfil
- \psframebox[fillstyle=gradient,gradmidpoint=0.2, gradangle=0,gradbegin=red!60!green!40, gradend=white]{\large #2}
+ \psframebox[fillstyle=gradient,gradmidpoint=0.2, gradangle=0,gradbegin=red!60!green!40, gradend=white]{\large #2}%
\hfil%
- \fi
+ \fi%
}
- \else %sinon
+ \else %sinon cadreTitre = false
\newcommand{\structitre}{\large \textbf{#2}}%
\fi%
- \begin{lrbox}{\envbox}
- \ifKV@bclogo@ombre % si l'ombre, on reduit pour que ca loge sur la
- % largeur de la page (-\val@epOmbre)
- \begin{tabular}{@{}c@{}p{\dimexpr\linewidth-2\pgfframesep-4pt-17pt-\val@epOmbre cm}@{}}
- \else
- \begin{tabular}{@{}c@{}p{\dimexpr\linewidth-2\pgfframesep-4pt-17pt}@{}}
- \fi
- \begin{minipage}{20pt}{\val@logo}\end{minipage}&
- \begin{minipage}{\dimexpr\linewidth-2\pgfframesep-4pt-17pt}{\structitre}\end{minipage}\\%[0ex]
- \vrule width 0.05cm&%
-}
+ \begin{lrbox}{\invbox}%
+\begin{minipage}{\dimexpr\linewidth-2\pgfframesep-4pt-\logowidth-\ifKV@bclogo@ombre\val@epOmbre cm\else0pt\fi\relax}%
+}%
{%
- \bccaption{\bclogotitre}
- \end{tabular}%
+\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 le texte dans un cadre en couleur.
- \iftikz% texte tikz
+
+% Affiche l'ensemble dans un cadre en couleur.
+ \iftikz% tikz
\par\noindent
\begin{tikzpicture}%
- \ifKV@bclogo@ombre %cadre ombre
+ \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]{\usebox{\envbox}};
- \else %cadre sans ombre
- \node[fill=\val@couleur,thick, shape=rectangle, inner sep=\pgfframesep,rounded corners=\arr cm, draw]{\usebox{\envbox}};
+ 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% texte pstricks
+ \else% pstricks
\noindent
\ifKV@bclogo@ombre%cadre ombre
- \rput[tl](-0.21,0){\psframebox[fillstyle=solid, shadow=true, shadowsize=\val@epOmbre cm,%
- shadowcolor=\val@couleurOmbre, fillcolor=\val@couleur,framearc=\arr]{\usebox{\envbox}}}%
+ \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
- \rput[tl](-0.21,0){\psframebox[fillstyle=solid, fillcolor=\val@couleur,framearc=\arr]{\usebox{\envbox}}}%
+ \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*{\dimexpr\ht\envbox+\dp\envbox+2\psframesep+2\pslinewidth}
+ \par\vspace*{0.2cm}
\fi%fin
\ifKV@bclogo@ombre\vspace*{\val@epOmbre cm}\fi
}%