Ajout de \robustify pour les commandes de logos, mise à jour de la doc, version 3.1
[bclogo.git] / dev / latex / bclogo.sty
1 \NeedsTeXFormat{LaTeX2e}%
2 \def\PackageName{bclogo}%
3 \def\fileversion{v3.1}%
4 \def\filedate{2012/07/21}%
5 \ProvidesPackage{bclogo}[\filedate\space\fileversion]%
6 %
7 % Extensions a charger
8 \RequirePackage{xkeyval,ifthen}%
9 \RequirePackage{graphicx}%
10 %% Les options globales du package sont au nombre de 2: tikz ou pstricks
11 \newif\ifbclogotikz%
12 \newif\ifbclogoblur%
13 \define@key{bclogo.sty}{tikz}[]{\bclogotikztrue}%
14 \define@key{bclogo.sty}{pstricks}[]{\bclogotikzfalse}%
15 \define@key{bclogo.sty}{blur}[]{\bclogoblurtrue}%
16 %
17 % quelques dimensions
18 \newlength{\bc@invboxh}\newlength{\bc@invboxd}%
19 \newlength{\bc@titleLength}%
20 \newlength{\logowidth}%
21 %
22 \setlength{\logowidth}{17pt}%
23 \ProcessOptionsX%
24 %
25 \ifbclogotikz%
26         \RequirePackage{tikz}%
27         \RequirePackage[framemethod=tikz]{mdframed}%mdframed2
28         \usetikzlibrary{shadows}% pour l'ombre
29         \usetikzlibrary{decorations.pathmorphing}% pour la barre ondulee
30 \else%
31         \RequirePackage{pstricks}%
32         \RequirePackage{pst-grad}%
33         \RequirePackage{pst-coil}% pour la barre ondulee
34         \RequirePackage[framemethod=pstricks]{mdframed}%mdframed2
35         \ifbclogoblur%
36                 \RequirePackage{pst-blur}%
37                 \let\pagecolorOLD\pagecolor% modification pour sauvegarde de la couleur du fond
38                 \def\pagecolor#1{\gdef\psx@blurbg{#1}\pagecolorOLD{#1}}%suppose l'utilisation: \pagecolor{couleur}
39         \fi%
40 \fi%
41 \edef\Gin@extensions{.mps,\Gin@extensions}%
42 \RequirePackage{ifpdf}%
43 \RequirePackage{etoolbox} % pour robustifier les commandes
44 \ifpdf\relax\else\DeclareGraphicsRule{mps}{eps}{*}{}\fi%
45 %
46 % les symboles
47 % ==============================================================================
48 % la fleur
49 \newcommand\bcfleur{\includegraphics[width=\logowidth]{bc-fleur}}%
50 % on robustifie
51 \robustify\bcfleur
52 % une note (Thomas Labarussias)
53 \newcommand\bcnote{\includegraphics[width=\logowidth]{bc-note}}%
54 \robustify\bcnote
55 % panneau chantier (Jean-Michel Sarlat)
56 \newcommand\bcpanchant{\includegraphics[width=\logowidth]{bc-aux-301}}%
57 \robustify\bcpanchant
58 % ours
59 \newcommand\bcours{\includegraphics[width=\logowidth]{bc-ours}}%
60 \robustify\bcours
61 % etoile
62 \newcommand\bcetoile{\includegraphics[width=\logowidth]{bc-etoile}}%
63 \robustify\bcetoile
64 % attention
65 \newcommand\bcattention{\includegraphics[width=\logowidth]{bc-attention}}%
66 \robustify\bcattention
67 % attention P.Fradin
68 \newcommand\bctakecare{\includegraphics[width=\logowidth]{bc-takecare}}%
69 \robustify\bctakecare
70 % lampe P.Fradin
71 \newcommand\bclampe{\includegraphics[width=\logowidth]{bc-lampe}}%
72 \robustify\bclampe
73 % coeur
74 \newcommand\bccoeur{\includegraphics[width=\logowidth]{bc-coeur}}%
75 \robustify\bccoeur
76 % ornement (tire du site http://openclipart.org )
77 \newcommand\bcorne{\includegraphics[width=\logowidth]{bc-orne}}%
78 \robustify\bcorne
79 % danger (Francois)
80 \newcommand\bcdanger{\includegraphics[width=\logowidth]{bc-danger}}%
81 \robustify\bcdanger
82 % smiley bonne humeur (Francois)
83 \newcommand\bcsmbh{\includegraphics[width=\logowidth]{bc-smiley-bonnehumeur}}%
84 \robustify\bcsmbh
85 % smiley bonne humeur (Francois)
86 \newcommand\bcsmmh{\includegraphics[width=\logowidth]{bc-smiley-mauvaisehumeur}}%
87 \robustify\bcsmmh
88 % le trefle
89 \newcommand\bctrefle{\includegraphics[width=\logowidth]{bc-trefle}}%
90 \robustify\bctrefle
91 % le livre
92 \newcommand\bcbook{\includegraphics[width=\logowidth]{bc-book}}%
93 \robustify\bcbook
94 % point d'interrogation
95 \newcommand\bcquestion{\includegraphics[width=\logowidth]{bc-inter}}%
96 \robustify\bcquestion
97 % crayon anne-sophie philippe
98 \newcommand\bccrayon{\includegraphics[width=\logowidth]{bc-crayon}}%
99 \robustify\bccrayon
100 % info (thomas labarrussias)
101 \newcommand\bcinfo{\includegraphics[width=\logowidth]{bc-info}}%
102 \robustify\bcinfo
103 % plume
104 \newcommand\bcplume{\includegraphics[width=\logowidth]{bc-plume}}%
105 \robustify\bcplume
106 % le pic LaTeX
107 \newcommand\bcspadesuit{{\centering \huge $\spadesuit$}}%
108 \robustify\bcspadesuit
109 % logos Alphonse Capriani
110 \newcommand\bcbombe{\includegraphics[width=\logowidth]{bc-bombe}}%
111 \robustify\bcbombe
112 \newcommand\bccube{\includegraphics[width=\logowidth]{bc-cube}}%
113 \robustify\bccube
114 \newcommand\bcdallemagne{\includegraphics[width=\logowidth]{bc-dallemagne}}%
115 \robustify\bcdallemagne
116 \newcommand\bcdautriche{\includegraphics[width=\logowidth]{bc-dautriche}}%
117 \robustify\bcdautriche
118 \newcommand\bcdbelgique{\includegraphics[width=\logowidth]{bc-dbelgique}}%
119 \robustify\bcdbelgique
120 \newcommand\bcdbulgarie{\includegraphics[width=\logowidth]{bc-dbulgarie}}%
121 \robustify\bcdbulgarie
122 \newcommand\bcdfrance{\includegraphics[width=\logowidth]{bc-dfrance}}%
123 \robustify\bcdfrance
124 \newcommand\bcditalie{\includegraphics[width=\logowidth]{bc-ditalie}}%
125 \robustify\bcditalie
126 \newcommand\bcdluxembourg{\includegraphics[width=\logowidth]{bc-dluxembourg}}%
127 \robustify\bcdluxembourg
128 \newcommand\bcdpaysbas{\includegraphics[width=\logowidth]{bc-dpaysbas}}%
129 \robustify\bcdpaysbas
130 \newcommand\bcdodecaedre{\includegraphics[width=\logowidth]{bc-dodecaedre}}%
131 \robustify\bcdodecaedre
132 \newcommand\bceclaircie{\includegraphics[width=\logowidth]{bc-eclaircie}}%
133 \robustify\bceclaircie
134 \newcommand\bcicosaedre{\includegraphics[width=\logowidth]{bc-icosaedre}}%
135 \robustify\bcicosaedre
136 \newcommand\bcinterdit{\includegraphics[width=\logowidth]{bc-interdit}}%
137 \robustify\bcinterdit
138 \newcommand\bcneige{\includegraphics[width=\logowidth]{bc-neige}}%
139 \robustify\bcneige
140 \newcommand\bcoctaedre{\includegraphics[width=\logowidth]{bc-octaedre}}%
141 \robustify\bcoctaedre
142 \newcommand\bcpluie{\includegraphics[width=\logowidth]{bc-pluie}}%
143 \robustify\bcpluie
144 \newcommand\bcpoisson{\includegraphics[width=\logowidth]{bc-poisson}}%
145 \robustify\bcpoisson
146 \newcommand\bcsoleil{\includegraphics[width=\logowidth]{bc-soleil}}%
147 \robustify\bcsoleil
148 \newcommand\bcstop{\includegraphics[width=\logowidth]{bc-stop}}%
149 \robustify\bcstop
150 \newcommand\bctetraedre{\includegraphics[width=\logowidth]{bc-tetraedre}}%
151 \robustify\bctetraedre
152 \newcommand\bccalendrier{\includegraphics[width=\logowidth]{bc-calendrier}}%
153 \robustify\bccalendrier
154 \newcommand\bchorloge{\includegraphics[width=\logowidth]{bc-horloge}}%
155 \robustify\bchorloge
156 \newcommand\bcyin{\includegraphics[width=\logowidth]{bc-yin}}%
157 \robustify\bcyin
158 \newcommand\bcrosevents{\includegraphics[width=\logowidth]{bc-rosevents}}%
159 \robustify\bcrosevents
160 % fin alphonse
161 % Vincent Pantaloni route glissante
162 \newcommand\bcdz{\includegraphics[width=\logowidth]{bc-dz}}%
163 \robustify\bcdz
164 % François Pétiard
165 \newcommand\bcvelo{\includegraphics[width=\logowidth]{bc-velo}}%
166 \robustify\bcvelo
167 \newcommand\bcoeil{\includegraphics[width=\logowidth]{bc-oeil}}%
168 \robustify\bcoeil
169 \newcommand\bcpeaceandlove{\includegraphics[width=\logowidth]{bc-peaceandlove}}%
170 \robustify\bcpeaceandlove
171 \newcommand\bcnucleaire{\includegraphics[width=\logowidth]{bc-nucleaire}}%
172 \robustify\bcnucleaire
173 \newcommand\bcfemme{\includegraphics[width=\logowidth]{bc-femme}}%
174 \robustify\bcfemme
175 \newcommand\bchomme{\includegraphics[width=\logowidth]{bc-homme}}%
176 \robustify\bchomme
177 \newcommand\bcloupe{\includegraphics[width=\logowidth]{bc-loupe}}%
178 \robustify\bcloupe
179 \newcommand\bcrecyclage{\includegraphics[width=\logowidth]{bc-recyclage}}%
180 \robustify\bcrecyclage
181 \newcommand\bcvaletcoeur{\includegraphics[width=\logowidth]{bc-valetcoeur}}%
182 \robustify\bcvaletcoeur
183 \newcommand\bccle{\includegraphics[width=\logowidth]{bc-cle}}%
184 \robustify\bccle
185 \newcommand\bcclefa{\includegraphics[width=\logowidth]{bc-clefa}}%
186 \robustify\bcclefa
187 \newcommand\bcclesol{\includegraphics[width=\logowidth]{bc-clesol}}%
188 \robustify\bcclesol
189 \newcommand\bcfeujaune{\includegraphics[width=\logowidth]{bc-feujaune}}%
190 \robustify\bcfeujaune
191 \newcommand\bcfeurouge{\includegraphics[width=\logowidth]{bc-feurouge}}%
192 \robustify\bcfeurouge
193 \newcommand\bcfeutricolore{\includegraphics[width=\logowidth]{bc-feutricolore}}%
194 \robustify\bcfeutricolore
195 \newcommand\bcfeuvert{\includegraphics[width=\logowidth]{bc-feuvert}}%
196 \robustify\bcfeuvert
197 \newcommand\bcoutil{\includegraphics[width=\logowidth]{bc-outil}}%
198 \robustify\bcoutil
199 \newcommand\bctrombone{\includegraphics[width=\logowidth]{bc-trombone}}%
200 \robustify\bctrombone
201 % fin François
202 % =========================== La fonction listable =============================
203 %
204 \newcommand{\titrebclogo}{Liste des \texttt{bclogo}}%
205 \newcommand\bccaption[1]{\addcontentsline{bcl}{bclogo}{#1}}%
206 \newcommand\listofbclogo{\section*{\titrebclogo}\@starttoc{bcl}}%
207 \newcommand\l@bclogo[2]{\par\noindent #1,~\textit{page~#2}}%
208 \newcounter{bclogocompteur} % idee de Francois Petiard
209 %
210 % ======================================= les keys =============================
211 %
212 \newlength{\bcval@epBarre}% on definit une longueur : l'epaisseur de la barre en point
213 \newlength{\bcval@framesep}% on definit une longueur : l'epaisseur de la marge en point
214 \newlength{\bcval@tailleOndu}% on definit une longueur : taille d'une ondulation
215 \newlength{\bcval@borderWidth}% on definit une longueur : epaisseur du bord
216 \newlength{\bcval@margeG}% on definit une longueur : marge gauche avant la boîte
217 \newlength{\bcval@margeD}% on definit une longueur : marge droite après la boîte
218 \define@key{bclogo}{logo}[\bcfleur]{\def\bcval@logo{#1}}%
219 \define@key{bclogo}{couleur}[white]{\def\bcval@couleur{#1}}%
220 \define@key{bclogo}{arrondi}[0]{\def\bcval@arrondi{#1}}%
221 \define@key{bclogo}{epOmbre}[0.2]{\def\bcval@epOmbre{#1}}%
222 \define@key{bclogo}{arrondi}[0]{\def\bcval@arrondi{#1}}%
223 \define@key{bclogo}{couleurOmbre}[black!30]{\def\bcval@couleurOmbre{#1}}%
224 \define@key{bclogo}{couleurBarre}[black]{\def\bcval@couleurBarre{#1}}%
225 \define@key{bclogo}{couleurBord}[black]{\def\bcval@couleurBord{#1}}% modification Philippe Fortemps
226 \define@key{bclogo}{couleurTexte}[black]{\def\bcval@couleurTexte{#1}}%
227 \define@key{bclogo}{imageBarre}[]{\def\bcval@imageBarre{#1}}%
228 \define@key{bclogo}{motifBarre}[*]{\def\bcval@motifBarre{#1}}%
229 \define@key{bclogo}{marge}[4]{\setlength{\bcval@framesep}{#1 pt}}%
230 \define@key{bclogo}{margeG}[0]{\setlength{\bcval@margeG}{#1 cm}}%
231 \define@key{bclogo}{margeD}[0]{\setlength{\bcval@margeD}{#1 cm}}%
232 \define@key{bclogo}{sousTitre}[]{\def\bcval@sousTitre{#1}}%
233 \define@key{bclogo}{epBarre}[1.5]{\setlength{\bcval@epBarre}{#1 pt}}%
234 \define@key{bclogo}{epBord}[0.8]{\setlength{\bcval@borderWidth}{#1 pt}%
235         \ifdimgreater{\bcval@borderWidth}{\z@}{\KV@bclogo@noborderfalse}{\KV@bclogo@nobordertrue}%
236         }%
237 \define@key{bclogo}{tailleOndu}[2.5]{\setlength{\bcval@tailleOndu}{#1 pt}}%
238 \define@boolkey{bclogo}{cadreTitre}[true]{}%
239 \define@boolkey{bclogo}{noborder}[true]{\ifKV@bclogo@noborder\setlength{\bcval@borderWidth}{\z@}\fi}%
240 \define@boolkey{bclogo}{ombre}[true]{}%
241 \define@boolkey{bclogo}{avecBarre}[true]{}%
242 \define@boolkey{bclogo}{nobreak}[true]{}%
243 \define@boolkey{bclogo}{blur}[true]{\ifKV@bclogo@blur\KV@bclogo@ombretrue\fi}%
244 \define@choicekey{bclogo}{barre}{none,line,snake,motif,zigzag,imageExt,imageClip,wave}[line]{%
245 \ifthenelse{\equal{#1}{none}}{\KV@bclogo@avecBarrefalse\gdef\bc@barre{}}%
246 {\gdef\bc@barre{\ifKV@bclogo@avecBarre\@nameuse{bc@barre#1}\fi}}%
247 }%
248 %
249 % selection par defaut
250 \presetkeys{bclogo}{logo,barre,couleur,arrondi,couleurOmbre,couleurTexte,couleurBarre,epOmbre,epBarre,epBord,tailleOndu,ombre=false,cadreTitre=false,%
251 avecBarre=true,noborder=false,marge,sousTitre,couleurBord,blur=false,nobreak=false}{}%
252 %
253 %les differentes commandes de barre verticale a gauche
254 %
255 \newcommand*{\bc@barreline}{%
256 \begin{minipage}{\logowidth}\centering%
257 \ifbclogotikz%
258 \begin{tikzpicture}%
259 \draw[line width=\bcval@epBarre,line cap=butt,color=\bcval@couleurBarre](0,\bc@invboxh)--(0,0);\end{tikzpicture}%
260 \else%
261 \psset{unit=1pt}%
262 \begin{pspicture}(0,0)(0,\bc@invboxh)%
263 \psline[linewidth=\bcval@epBarre,linecolor=\bcval@couleurBarre](0,\bc@invboxh)(0,0)%
264 \end{pspicture}%
265 \fi%
266 \end{minipage}%
267 }%
268 %
269 %
270 \newcommand*{\bc@barresnake}{%
271 \begin{minipage}{\logowidth}\centering%
272 \ifbclogotikz%
273 \begin{tikzpicture}[decoration={snake,segment length=2.66\bcval@tailleOndu, amplitude=\bcval@tailleOndu}]%
274 \draw[decorate,line width=1pt, color=\bcval@couleurBarre](0,\bc@invboxh)--(0,0);\end{tikzpicture}%
275 \else%
276 \psset{unit=1pt}%
277 \begin{pspicture}(0,0)(0,\bc@invboxh)%
278 \pszigzag[coilarm=0pt,coilwidth=2\bcval@tailleOndu,linewidth=1pt,linearc=1pt,coilheight=1.33,linecolor=\bcval@couleurBarre](0,\bc@invboxh)(0,0)%
279 \end{pspicture}%
280 \fi%
281 \end{minipage}%
282 }%
283 %
284 \newcommand*{\bc@barrezigzag}{%
285 \begin{minipage}{\logowidth}\centering%
286 \ifbclogotikz%
287 \begin{tikzpicture}[decoration={zigzag,segment length=2.66\bcval@tailleOndu, amplitude=\bcval@tailleOndu}]%
288 \draw[decorate,line width=1pt,color=\bcval@couleurBarre](0,\bc@invboxh)--(0,0);\end{tikzpicture}%
289 \else%
290 \psset{unit=1pt}%
291 \begin{pspicture}(0,0)(0,\bc@invboxh)%
292 \pszigzag[coilarm=0pt,coilwidth=2\bcval@tailleOndu,linewidth=1pt,linearc=0pt,coilheight=1.33,linecolor=\bcval@couleurBarre](0,\bc@invboxh)(0,0)%
293 \end{pspicture}%
294 \fi%
295 \end{minipage}%
296 }%
297 %
298 \newcommand*{\bc@barreimageExt}{% l'image est deformee
299 \begin{minipage}{\logowidth}\centering%
300 \includegraphics[width=\logowidth,height=\bc@invboxh]{\bcval@imageBarre}%
301 \end{minipage}%
302 }
303 %
304 \newcommand*{\bc@barreimageClip}{%
305 \begin{minipage}{\logowidth}\centering%
306 \includegraphics[viewport=0 0 \logowidth~ \bc@invboxh,clip=true]{\bcval@imageBarre}%
307 \end{minipage}%
308 }%
309 %
310 \newcommand*{\bc@barremotif}{%
311 \begin{minipage}{\logowidth}\centering%
312 \color{\bcval@couleurBarre}%
313 \vbox to \bc@invboxh{\cleaders\vbox{\vss\bcval@motifBarre\vss}\vfill}%
314 \end{minipage}%
315 }%
316 %
317 \newcommand*{\bc@barrewave}{%
318 \begin{minipage}{\logowidth}\centering%
319 \color{\bcval@couleurBarre}%
320 \vbox to \bc@invboxh{\cleaders\vbox{\vss$\leftwave\right.$\vss}\vfill}%
321 \end{minipage}%
322 }%
323 %
324 %======================= Quelques definitions===================================
325 % boite titre
326 \newsavebox{\bc@envbox}%
327 %%% precaution JCC
328 \newcommand*\bclogotitre{}%
329 \newcommand\bcStyleSousTitre[1]{\normalsize \textit{#1}}%
330 \newcommand\styleSousTitre[1]{\bcStyleSousTitre{#1}}% pour la compatibilit
331 \newcommand\bcStyleTitre[1]{\large \textbf{#1}}%
332 %======================= L'environnement =======================================
333 %
334 \ifbclogotikz%définition du style bclogo pour mdframed
335 \mdfdefinestyle{bc@style}{%
336 apptotikzsetting={\ifKV@bclogo@blur\tikzset{mdfshadow/.style={%% semblant de blur...
337 preaction={fill=\bcval@couleurOmbre,line width=5,line join=round,opacity=0.1,draw=\bcval@couleurOmbre,%
338         transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}},%
339 preaction={fill=\bcval@couleurOmbre,line width=4,line join=round,opacity=0.15,draw=\bcval@couleurOmbre,%
340         transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}},%
341 preaction={fill=\bcval@couleurOmbre,line width=3,line join=round,opacity=0.2,draw=\bcval@couleurOmbre,%
342         transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}},%
343 preaction={fill=\bcval@couleurOmbre,line width=2,line join=round,opacity=0.3,draw=\bcval@couleurOmbre,%
344         transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}},%
345 preaction={fill=\bcval@couleurOmbre,line width=1,line join=round,opacity=0.4,draw=\bcval@couleurOmbre,%
346         transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}},%
347 preaction={fill=\bcval@couleurOmbre,line width=0.5,line join=round,opacity=0.4,draw=\bcval@couleurOmbre,%
348         transform canvas={xshift=0.5*\bcval@epOmbre cm, yshift=-0.5*\bcval@epOmbre cm}}%
349                                }}\fi%
350 },%
351 singleextra={%
352 \setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-2\mdf@innerlinewidth@length-2\mdf@outerlinewidth@length-%
353 2\mdf@middlelinewidth@length-\mdf@innertopmargin@length-\mdf@innerbottommargin@length\relax}%
354 \node[mdfbox,anchor=north west,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep,%
355      yshift=-0.75*\bcval@framesep-\mdf@innerlinewidth@length-0.5*\mdf@middlelinewidth@length]at%
356      (P-|O){\box\bc@envbox};%
357 \node[mdfbox,anchor=south,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,%
358       yshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+\bcval@framesep]at(O){\bc@barre};%
359 },%
360 firstextra={%
361 \setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@innerlinewidth@length-\mdf@outerlinewidth@length-%
362 \mdf@middlelinewidth@length-\mdf@innertopmargin@length-\mdf@splitbottomskip@length\relax}%
363 \node[mdfbox,anchor=north west,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep,%
364      yshift=-0.75*\bcval@framesep-\mdf@innerlinewidth@length-0.5*\mdf@middlelinewidth@length]at%
365      (P-|O){\box\bc@envbox};%
366 \node[mdfbox,anchor=south,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,%
367       yshift=\mdf@splitbottomskip@length]at(O){\bc@barre};%
368 },%
369 middleextra={%
370 \setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@splitbottomskip@length-\mdf@splittopskip@length\relax},%
371 \node[mdfbox,anchor=south,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,%
372       yshift=\mdf@splitbottomskip@length]at(O){\bc@barre};%
373 },%
374 secondextra={%
375 \setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@innerlinewidth@length-\mdf@outerlinewidth@length-%
376 \mdf@middlelinewidth@length-\mdf@splittopskip@length-\mdf@innerbottommargin@length\relax}%
377 \node[mdfbox,anchor=south,xshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.5*\bcval@framesep+0.5*\logowidth,%
378       yshift=\mdf@innerlinewidth@length+0.5*\mdf@middlelinewidth@length+0.75*\bcval@framesep]at(O){\bc@barre};%
379 }%
380 }%
381 \else%pstricks
382 \mdfdefinestyle{bc@style}{%
383 pstrickssetting={blur=\ifbclogoblur true\else false\fi},%
384 singleextra={%
385 \setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-2\mdf@innerlinewidth@length-2\mdf@outerlinewidth@length-%
386 2\mdf@middlelinewidth@length-\mdf@innertopmargin@length-\mdf@innerbottommargin@length\relax}%
387 \rput[tl](\dimexpr\mdf@innerlinewidth@length+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length+0.5\bcval@framesep\relax,%
388            \dimexpr\mdfboundingboxheight-0.75\bcval@framesep-\mdf@middlelinewidth@length-%
389                    \mdf@innerlinewidth@length-\mdf@outerlinewidth@length\relax){\box\bc@envbox}%
390 \rput[b](\dimexpr\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+0.5\bcval@framesep+0.5\logowidth+\mdf@innerlinewidth@length\relax,%
391          \dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+\mdf@innerlinewidth@length\relax){\bc@barre}%
392 },%
393 firstextra={%
394 \setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@innerlinewidth@length-\mdf@outerlinewidth@length-%
395 \mdf@middlelinewidth@length-\mdf@innertopmargin@length-\mdf@splitbottomskip@length\relax}%
396 \rput[tl](\dimexpr\mdf@innerlinewidth@length+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length+0.5\bcval@framesep\relax,%
397            \dimexpr\mdfboundingboxheight-0.75\bcval@framesep-\mdf@middlelinewidth@length-%
398                    \mdf@innerlinewidth@length-\mdf@outerlinewidth@length\relax){\box\bc@envbox}%
399 \rput[b](\dimexpr\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+0.5\bcval@framesep+0.5\logowidth+\mdf@innerlinewidth@length\relax,%
400          \mdf@splitbottomskip@length){\bc@barre}%
401 },%
402 middleextra={%
403 \setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@splitbottomskip@length-\mdf@splittopskip@length\relax}%
404 \rput[b](\dimexpr\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+0.5\bcval@framesep+0.5\logowidth+\mdf@innerlinewidth@length\relax,%
405          \mdf@splitbottomskip@length){\bc@barre}%
406 },%
407 secondextra={%
408 \setlength{\bc@invboxh}{\dimexpr\mdfboundingboxheight-\mdf@innerlinewidth@length-\mdf@outerlinewidth@length-%
409 \mdf@middlelinewidth@length-\mdf@splittopskip@length-\mdf@innerbottommargin@length\relax}%
410 \rput[b](\dimexpr\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+0.5\bcval@framesep+0.5\logowidth+\mdf@innerlinewidth@length\relax,%
411          \dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length+\mdf@outerlinewidth@length+\mdf@innerlinewidth@length\relax){\bc@barre}%
412 }%
413 }%
414 \fi%
415 %
416 \newenvironment*{bclogo}[2][]{%
417    \setkeys{bclogo}{#1}%options
418    \renewcommand*\bclogotitre{#2}%
419   % deux types de titres
420    \ifKV@bclogo@cadreTitre% si cadreTitre = true
421        \def\bc@structitre{%
422             \hfil%
423             \ifbclogotikz% cadreTitre tikz
424             \begin{tikzpicture}%
425                 \node[rectangle, thick, top color=red!60!green!40, bottom color=white,draw]{\large #2};%
426             \end{tikzpicture}%
427             \else% cadreTitre pstricks
428             \psframebox[fillstyle=gradient,gradmidpoint=0.2, gradangle=0,gradbegin=red!60!green!40, gradend=white]{\large  #2}%
429             \fi%
430             \hfil%
431         }%
432   \else%sinon cadreTitre = false
433       \def\bc@structitre{\bcStyleTitre{#2} \bcStyleSousTitre{\bcval@sousTitre}}%
434   \fi%
435 %boite logo+titre
436 \setlength{\bc@titleLength}{%
437 \dimexpr\linewidth-\bcval@margeD-\bcval@margeG-1.5\bcval@framesep-\ifKV@bclogo@noborder\z@\else2\bcval@borderWidth\fi-%
438 \logowidth-\ifKV@bclogo@ombre\bcval@epOmbre cm\else\z@\fi\relax}%
439 %
440    \begin{lrbox}{\bc@envbox}% boite titre
441      \begin{tabular}{@{}c@{}p{\bc@titleLength}@{}}%
442        \begin{minipage}{\logowidth}%
443                 \refstepcounter{bclogocompteur}\bccaption{\bclogotitre}\bcval@logo%
444        \end{minipage}%
445      &%
446        \ifKV@bclogo@cadreTitre%
447          \begin{minipage}{\bc@titleLength}%
448                 \bc@structitre%
449          \end{minipage}%
450        \else\bc@structitre\fi%
451    \end{tabular}%
452   \end{lrbox}%
453 % affichage
454 \smallskip% ressort %% Pourquoi ? %%%parce que ça se comprime et ça s'étire!
455 \def\bcval@nobreak{\ifKV@bclogo@nobreak true\else false\fi}% gestion nobreak
456 \def\bcval@shadow{\ifKV@bclogo@ombre true\else false\fi}% gestion ombre
457 %
458 \mdframed[%
459  style=bc@style,%
460  innerleftmargin={\dimexpr\ifKV@bclogo@avecBarre\logowidth\else\z@\fi+\bcval@framesep\relax},%
461  innertopmargin={\dimexpr\ht\bc@envbox+\dp\bc@envbox+\bcval@framesep\relax},%hauteur titre+framesep
462  innerrightmargin=\bcval@framesep,%
463  innerbottommargin=\bcval@framesep,%
464  rightmargin={\dimexpr\bcval@margeD+\ifKV@bclogo@ombre\bcval@epOmbre cm\else\z@\fi\relax},%
465  leftmargin=\bcval@margeG,%
466  backgroundcolor=\bcval@couleur,%
467  fontcolor=\bcval@couleurTexte,%
468  middlelinewidth=\bcval@borderWidth,%
469  linecolor=\bcval@couleurBord,%
470  roundcorner={\bcval@arrondi cm},%
471  nobreak=\bcval@nobreak,%l'option nobreak de mdframed vient avec la version 0.9
472  shadow=\bcval@shadow,%
473  shadowsize=\bcval@epOmbre cm,%
474  shadowcolor=\bcval@couleurOmbre%
475 ]%
476 }%
477 {%
478 \endmdframed\par%
479 \smallskip%
480 \goodbreak%
481 }%
482 \endinput%
483 %%%%%%%%%%%%%%%% fin %%%%%%%%%%%%%%%%

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.