summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bclogo/bclogo.sty
blob: 38d107de8682dbc3b1f9a815403612d2c6408eab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
\NeedsTeXFormat{LaTeX2e}

\ProvidesPackage{bclogo}[2008/03/12, V1.31]

% extensions
 
\RequirePackage{pstricks}
\RequirePackage{pst-grad}
\RequirePackage{tabularx}
\RequirePackage{graphicx}
\RequirePackage{ifthen}
%\RequirePackage{xkeyval}
%les symboles
%==========================================================================================
%la fleur
\newcommand\fleur{\begingroup\input{fleur}\endgroup}
%une note (Thomas Laburussias)
\newcommand\note{\begingroup\input{note}\endgroup}
%panneau chantier (Jean-Michel Sarlat)
\newcommand{\panchant}{\includegraphics[width=17pt]{aux-301.eps}}
%ours
\newcommand\ours{\begingroup\input{ours.tex}\endgroup}
%étoile
\newcommand\etoile{\begingroup\input{etoile.tex}\endgroup}
%attention
\newcommand\attention{\begingroup\input{attention.tex}\endgroup}
%coeur
\newcommand\coeur{\begingroup\input{coeur.tex}\endgroup}
%ornement (tiré du site http://openclipart.org )
\newcommand\orne{\begingroup\input{orne.tex}\endgroup}
%danger (François)
\newcommand\danger{\begingroup\input{danger.tex}\endgroup}
%smiley bonne humeur (François)
\newcommand\smbh{\begingroup\input{smiley_bonnehumeur.tex}\endgroup}
%smiley bonne humeur (François)
\newcommand\smmh{\begingroup\input{smiley_mauvaisehumeur.tex}\endgroup}
%=================================================================================

%=========================== La fonction listable ================================
\newcommand{\titrebclogo}{Liste des \texttt{bclogo}}
\newcommand\bccaption[1]{\addcontentsline{bcl}{bclogo}{#1}}
\makeatletter
\newcommand\listofbclogo{\section*{\titrebclogo}\@starttoc{bcl}}
\newcommand\l@bclogo[2]{\par\noindent #1,~\textit{page~#2}}
\makeatother
%=================================================================================
\makeatletter
%======================================= les keys ================================
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
\def\fileversion{1.31}
\def\filedate{2008/09/18}
\message{`bclogo' v\fileversion, \filedate}

\pst@addfams{bclogo}
\define@key[psset]{bclogo}{logo}{\def\val@logo{#1}}
\define@key[psset]{bclogo}{couleur}{\def\val@couleur{#1}}
\define@key[psset]{bclogo}{arrondi}{\def\val@arrondi{#1}}
\psset[bclogo]{logo=\fleur,couleur=white,arrondi=0}

\define@boolkey[psset]{bclogo}[Pst@]{cadretitre}[false]{}
\psset[bclogo]{cadretitre}%   set to the default, which is false

%=================================================================================

\newsavebox{\envbox}
%%% précaution JCC
\newcommand*\bclogocolor{}
\newcommand*\bclogotitre{}

\newenvironment*{bclogo}[2][]{%
   \psset[bclogo]{#1} %on récupère les options
   \par\noindent % attention au retrait d'alinéa
%%% Ajout de JCC : il faut définir les commandes qui seront untilisées dans la deuxième partie de l'environnement
%%% commande titre
   \renewcommand*\bclogotitre{#2}
   \renewcommand*\bclogocolor{\val@couleur}
%La commande pour les coins arrondis
   \newcommand{\arr}{\val@arrondi}
%%% deux types de titres
   \ifPst@cadretitre %si cadretitre = true
       \newcommand{\structitre}{ \rput({\dimexpr -17pt+0.5\linewidth},0.1){\psframebox[fillstyle=gradient,gradmidpoint=0.2, gradangle=0,gradbegin=red!60!green!40, gradend=white]{\large  #2}}}
   \else %sinon
       \newcommand{\structitre}{{\large \textbf{#2}}}       
   \fi
%
   \begin{lrbox}{\envbox}
   \begin{tabular}{@{}c@{}p{\dimexpr\linewidth-2\psframesep-2\pslinewidth-17pt}@{}}
   \raisebox{-3mm}{\val@logo} &\structitre \\[1ex]
   \vrule width 0.05cm&
}
{%
  \bccaption{\bclogotitre}
  \end{tabular}%
  \end{lrbox}%
  % Affiche le texte dans un cadre en couleur.
  \noindent
  \rput[tl](-0.18,0){%
    \psframebox[fillstyle=solid, fillcolor=\bclogocolor,framearc=\arr]{%
      \usebox{\envbox}%
    }%
  }%
  \par\vspace*{\dimexpr\ht\envbox+\dp\envbox+2\psframesep+2\pslinewidth}
}

\makeatother