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