From da2b0170972682e8b3dce37339d3bc7907a78ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Poulain?= Date: Mon, 18 May 2020 15:28:27 +0200 Subject: [PATCH] feat(classe): ajoute les manchettes --- lolipop.cls | 52 +++++++++++++++++++++++++++++++++++++++++----------- lolipop.hva | 5 +++++ 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/lolipop.cls b/lolipop.cls index c79d510..b867f48 100644 --- a/lolipop.cls +++ b/lolipop.cls @@ -143,6 +143,17 @@ % Mise en forme %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Commençons par écrire un constructeur pour les parametres à déclarer. +\def\lolipop@declare#1{% + \global\long\expandafter% + \def \csname lolipop@#1\endcsname {}% + \global\long\expandafter% + \def \csname #1\endcsname ##1{% + \global\long\expandafter% + \def \csname lolipop@#1\endcsname{##1}% + }% +} + %%% Couleur %%% % Le magenta est la couleur dominante du guide. @@ -226,6 +237,8 @@ \newlength{\headwidth} \pgfdeclareimage{tache}{\@images tache} +\lolipop@declare{manchette} + \newcommand{\fancychapter}[1]{ \reflectodd{ \setlength\headwidth{0.6\columnwidth} @@ -265,6 +278,32 @@ \def\@chapapp{} +\def\@chapter[#1]#2{% + \let\oldmanchette\manchette% + \def\manchette##1{}% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}#1}% + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \let\manchette\oldmanchette% + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} + \def\@makechapterhead#1{% \vspace*{20\p@}% {\parindent \z@ @@ -283,6 +322,7 @@ \Huge \bfseries #1 } \par\nobreak + \if@not@empty{\lolipop@manchette}{\vskip 10\p@\large\lolipop@manchette}\manchette{} \vskip 20\p@ } } @@ -297,6 +337,7 @@ \Huge \bfseries #1 } \par\nobreak + \if@not@empty{\lolipop@manchette}{\vskip 10\p@\large\lolipop@manchette}\manchette{} \vskip 20\p@ } } @@ -360,17 +401,6 @@ % Flottants : logiciels %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Commençons par écrire un constructeur pour les parametres à déclarer. -\def\lolipop@declare#1{% - \global\long\expandafter% - \def \csname lolipop@#1\endcsname {}% - \global\long\expandafter% - \def \csname #1\endcsname ##1{% - \global\long\expandafter% - \def \csname lolipop@#1\endcsname{##1}% - }% -} - % Déclarons les paramètres qui nous intéressent. \lolipop@declare{nom} \lolipop@declare{logo} diff --git a/lolipop.hva b/lolipop.hva index 287d671..d9a9838 100644 --- a/lolipop.hva +++ b/lolipop.hva @@ -64,6 +64,11 @@ \end{rawhtml}#1\begin{rawhtml}\end{rawhtml} } +%%% Manchettes +\renewcommand{\manchette}[1] +{\begin{rawhtml}\end{rawhtml}#1\begin{rawhtml}\end{rawhtml}} + + %%% Autres interfaces %%% % Pour l'écrit étranger.