summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-09-11 22:32:47 +0000
committerKarl Berry <karl@freefriends.org>2016-09-11 22:32:47 +0000
commitf2ae127564f5c32956a455cd4ec16b3b13ff3190 (patch)
treed2ac7e1a81b835b8bd352c92f772de56fd0bd68e /Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex
parentc9ba4cdc8383cbfc52687201c455a367d1824924 (diff)
pas-cours (11sep16)
git-svn-id: svn://tug.org/texlive/trunk@42036 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex')
-rw-r--r--Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex163
1 files changed, 130 insertions, 33 deletions
diff --git a/Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex b/Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex
index 0a0b3314dda..d04c1b84f6c 100644
--- a/Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex
+++ b/Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex
@@ -1,3 +1,5 @@
+\def\couleur{black}
+
% Fichier comprenant les macros de styles
\newcounter{cnt@chap}
@@ -26,7 +28,18 @@
\define@boolkey[PAS] {env} {degrade}[true]{}
\define@boolkey[PAS] {env} {notitle}[true]{}
\define@boolkey[PAS] {env} {notitlebreak}[true]{}
-\presetkeys [PAS] {env} {style= , name= , title= ,pluriel = false, color=, symb = $\blacksquare$, degrade = false, toc=false, notoc=false, notitle=false, notitlebreak=false, endsymb=false, num=false}{}
+\define@boolkey[PAS] {env} {effect}[true]{}
+\if@notitlebreak
+ \presetkeys[PAS] {env} {notitlebreak=true}{}
+\else
+ \presetkeys[PAS] {env} {notitlebreak=false}{}
+\fi
+\if@noeffect
+ \presetkeys[PAS] {env} {effect=false}{}
+\else
+ \presetkeys[PAS] {env} {effect=true}{}
+\fi
+\presetkeys [PAS] {env} {style= , name= , title= ,pluriel = false, color=, symb = $\blacksquare$, degrade = false, toc=false, notoc=false, notitle=false, endsymb=false, num=false}{}
\newcommand*{\env}[1][]{\pasEnv[#1]}
@@ -59,7 +72,7 @@
\stepcounter{cnt@prop}
\edef\texte{\texte~\thecnt@prop}
\fi
- \def\couleur{red}%
+ \def\couleur{prop}%
}{}
\IfStrEq{\cmdPAS@env@style}{demo}
{%
@@ -72,7 +85,7 @@
\stepcounter{cnt@demo}
\edef\texte{\texte~\thecnt@demo}
\fi
- \def\couleur{black}%
+ \def\couleur{demo}%
}{}
\IfStrEq{\cmdPAS@env@style}{rem}{\ifPAS@env@pluriel\def\texte{Remarques}\else\def\texte{Remarque}\fi\def\couleur{rem}}{}
\IfStrEq{\cmdPAS@env@style}{defi}
@@ -91,7 +104,7 @@
\IfStrEq{\cmdPAS@env@style}{thm}{\ifPAS@env@pluriel\def\texte{Th\'eor\`emes}\else\def\texte{Th\'eor\`eme}\fi\ifPAS@env@num\stepcounter{cnt@thm}\edef\texte{\texte~\thecnt@thm}\fi\def\couleur{thm}}{}
\IfStrEq{\cmdPAS@env@style}{ex}{\ifPAS@env@pluriel\def\texte{Exemples}\else\def\texte{Exemple}\fi \ifPAS@env@num\stepcounter{cnt@ex}\edef\texte{\texte~\thecnt@ex}\fi\def\couleur{ex}}{}
\IfStrEq{\cmdPAS@env@style}{nota}{\ifPAS@env@pluriel\def\texte{Notations}\else\def\texte{Notation}\fi \ifPAS@env@num\stepcounter{cnt@nota}\edef\texte{\texte~\thecnt@nota}\fi\def\couleur{nota}}{}
- \IfStrEq{\cmdPAS@env@style}{act}{\ifPAS@env@pluriel\def\texte{Activit\'es}\else\def\texte{Activit\'e}\fi \ifPAS@env@num\stepcounter{cnt@act}\edef\texte{\texte~\thecnt@act}\fi\def\couleur{orange}}{}
+ \IfStrEq{\cmdPAS@env@style}{act}{\ifPAS@env@pluriel\def\texte{Activit\'es}\else\def\texte{Activit\'e}\fi \ifPAS@env@num\stepcounter{cnt@act}\edef\texte{\texte~\thecnt@act}\fi\def\couleur{act}}{}
\IfStrEq{\cmdPAS@env@style}{meth}{\ifPAS@env@pluriel\def\texte{M\'ethodes}\else\def\texte{M\'ethode}\fi \ifPAS@env@num\stepcounter{cnt@meth}\edef\texte{\texte~\thecnt@meth}\fi\def\couleur{brown}}{}
\IfStrEq{\cmdPAS@env@title}{}{}{\def\texte{\cmdPAS@env@title}}
\IfStrEq{\cmdPAS@env@color}{}{}{\def\couleur{\cmdPAS@env@color}}
@@ -113,10 +126,16 @@
\end{minipage}
};
\ifPAS@env@notitle\else
- \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$)
+ \ifPAS@env@effect
+ \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$)
+ {\kern-3pt\begin{ant}\textbf{\texte}\end{ant}};
+ \draw[color=\couleur!50!black,very thick] (box.north west)--(box.south west)--(box.south east);
+ \else
+ \node[text=white,fill=\couleur,rectangle, above right] (title) at ($(box.north west)+(-0.03,0)$)
{\kern-3pt\begin{ant}\textbf{\texte}\end{ant}};
+ \draw[color=\couleur,very thick] (box.north west)--(box.south west)--(box.south east);
+ \fi
\fi
- \draw[color=\couleur!50!black,very thick] (box.north west)--(box.south west)--(box.south east);
\node[left,color=\couleur] at (box.north east) {\emph{\cmdPAS@env@name}};
\end{tikzpicture}
\vspace{0.5cm}
@@ -285,20 +304,33 @@
};
\ifnum\thesuite@box=1
\edef\texte{\texte~(suite)}
- \ifPAS@env@notitlebreak\else\ifPAS@env@notitle\else
- \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$)
- {\begin{ant}\kern-3pt\texte\end{ant}};
- \fi\fi
+ \ifPAS@env@notitlebreak%
+ \else
+ \ifPAS@env@notitle
+ \else
+ \ifPAS@env@effect
+ \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$){\begin{ant}\kern-3pt\texte\end{ant}};
+ \draw[color=\couleur!50!black,very thick] (box.north west)--(box.south west)--(box.south east);
+ \else
+ \node[text=white,fill=\couleur,rectangle, above right] (title) at ($(box.north west)+(-0.03,0)$){\kern-3pt\begin{ant}\textbf{\texte}\end{ant}};
+ \draw[color=\couleur, very thick] (box.north west)--(box.south west)--(box.south east);
+ \fi
+ \fi
+ \fi
\else
\ifPAS@env@notitle\else
- \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$)
- {\kern-3pt\begin{ant}\texte\end{ant}};
- \fi
- \fi
- \draw[color=\couleur!50!black,very thick] (box.north west)--(box.south west)--(box.south east);
- \node[left,color=\couleur] at ($(box.north east)+(0,1pt)$) {\emph{\cmdPAS@env@name}};
- \end{tikzpicture}
- \vspace{0.5cm}
+ \ifPAS@env@effect
+ \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$){\kern-3pt\begin{ant}\texte\end{ant}};
+ \draw[color=\couleur!50!black,very thick] (box.north west)--(box.south west)--(box.south east);
+ \else
+ \node[text=white,fill=\couleur,rectangle, above right] (title) at ($(box.north west)+(-0.03,0)$){\kern-3pt\begin{ant}\texte\end{ant}};
+ \draw[color=\couleur,very thick] (box.north west)--(box.south west)--(box.south east);
+ \fi
+ \fi
+ \fi
+ \node[left,color=\couleur] at ($(box.north east)+(0,1pt)$) {\emph{\cmdPAS@env@name}};
+ \end{tikzpicture}
+ \vspace{0.5cm}
}
% \breakbox
@@ -314,8 +346,11 @@
\usebox{\pas@box}
};
\ifPAS@env@notitle\else
- \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$)
- {\begin{ant}\textbf{\texte}\end{ant}};
+ \ifPAS@env@effect
+ \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$){\begin{ant}\textbf{\texte}\end{ant}};
+ \else
+ \node[text=white,fill=\couleur,rectangle, above right] (title) at ($(box.north west)+(-0.03,0)$){\begin{ant}\textbf{\texte}\end{ant}};
+ \fi
\fi
\draw[color=\couleur!50!black,very thick] (box.north west)--(box.south west)--(box.south east);
\node[left,color=\couleur] at (box.north east) {\emph{\cmdPAS@env@name}};
@@ -333,17 +368,27 @@
\define@cmdkey [PAS] {chap} {color}{}
\define@cmdkey [PAS] {chap} {pos}{}
\define@boolkey[PAS] {chap} {autonum}[true]{}
+\define@boolkey[PAS] {chap} {nonewpage}[true]{}
\presetkeys [PAS] {chap} {num = ,
color = red,
pos = right,
- autonum = false}{} % maj 19/08/2014
+ autonum = false, % maj 19/08/2014
+ nonewpage = false}{} % maj 22/03/2015
\newcommand*{\chap}[1][]{\pasChap[#1]}
-
+\setcounter{cnt@chap}{0}
\def\pasChap[#1]#2#3{
\setkeys[PAS]{chap}{#1}
- \setcounter{cnt@chap}{0}
- \ifPAS@chap@autonum\stepcounter{cnt@chap}\def\titre@chapitre{\thecnt@chap}\else\def\titre@chapitre{\cmdPAS@chap@num} \clearpage \fi
+ \ifPAS@chap@autonum
+ \stepcounter{cnt@chap}
+ \def\titre@chapitre{\thecnt@chap}
+ \else
+ \def\titre@chapitre{\cmdPAS@chap@num}
+ \fi
+ \ifPAS@chap@nonewpage
+ \else
+ \clearpage
+ \fi
\IfStrEq{\cmdPAS@chap@pos}{right}
{ \tikzstyle{pastitrepos} = [text=\cmdPAS@chap@color,rectangle,left]
\tikzstyle{pastrait} = [right color=\cmdPAS@chap@color, left color=white,thick]
@@ -380,12 +425,14 @@
%%%%%%%%%%%% Définition d'un mot
-\newcommand{\definmot}[1]{\texttt{\textbf{\textcolor{\couleur}{#1}}}}
+\newcommand{\definmot}[1]
+{\texttt{\textbf{\textcolor{\couleur}{\boldmath#1}}}}
% Itemclass
\newcommand{\itemclass}[1] % #1 = couleur
{
+ \if@noitemstyle\else
\setlist[itemize,1]{label={\color{#1!50!black}\textbullet}}
\setlist[itemize,2]{label={\color{#1!50!black}$\rightarrow$}}
\setlist[enumerate,1]
@@ -395,19 +442,36 @@
{\color{#1!20}\normalsize\bfseries\arabic*}
}
\setlist[enumerate,2]{label=\textcolor{#1!50!black}{\normalsize\bfseries\alph*.}}
+ \fi
}
\itemclass{black}{}
%%%%%%%%%%%% Pour le sommaire
+\def\@dottedtocline#1#2#3#4#5{%
+ \ifnum #1>\c@tocdepth \else
+ \vskip \z@ \@plus.2\p@
+ {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
+ \parindent #2\relax\@afterindenttrue
+ \interlinepenalty\@M
+ \leavevmode
+ \@tempdima #3\relax
+ \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
+ {#4}\nobreak
+ \leaders\hbox{$\m@th
+ \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
+ mu$}\hfill
+ \nobreak
+ \hb@xt@\@pnumwidth{\hfil #5}%
+ \par}%
+ \fi}
+
\renewcommand*\l@section{\color{blue!50!black}\def\@linkcolor{blue!50!black}\@dottedtocline{1}{1em}{2.3em}}
\def\contentsline#1#2#3#4{%
\ifx\\#4\\%
\csname l@#1\endcsname{#2}{#3}%
\else
- \csname l@#1\endcsname{\hyper@linkstart{link}{#4}{#2}\hyper@linkend}{%
- \hyper@linkstart{link}{#4}{#3}\hyper@linkend
- }%
+ \csname l@#1\endcsname{\hyper@linkstart{link}{#4}{#2}\hyper@linkend}{\hyper@linkstart{link}{#4}{#3}\hyper@linkend}%
\fi
}
\renewcommand{\contentsname}{\color{purple}\titreFONT\huge Sommaire}
@@ -447,6 +511,7 @@
}
%%%%%%%%%%%%%%% A RETENIR
+
\newsavebox{\imageBox}
\newlength{\largeurimageBox}
\newsavebox{\aretenirBox}
@@ -474,11 +539,43 @@
\newsavebox{\attentionBox}
+\define@cmdkey [PAS] {warning} {img}{}
+\define@cmdkey [PAS] {warning} {scale}{}
+\define@cmdkey [PAS] {warning} {margins}{}
+\define@cmdkey [PAS] {warning} {draw}{}
+\define@boolkey[PAS] {warning} {bg}[true]{}
+\define@cmdkey [PAS] {warning} {bgcolor}{}
+\presetkeys [PAS] {warning} {img=attention.eps,scale=1,margins=1pt,draw=red!50!black,bg=false}{}
+
+\newenvironment{warning}[1][]
+{%
+ \setkeys[PAS]{warning}{#1}
+ \begin{lrbox}{\imageBox}
+ \includegraphics[scale=\cmdPAS@warning@scale]{\cmdPAS@warning@img}
+ \end{lrbox}
+ \settowidth{\largeurimageBox}{\usebox{\imageBox}}%
+ \begin{lrbox}{\attentionBox}
+ \begin{minipage}{\dimexpr\linewidth-\largeurimageBox-1em-10pt}
+}
+{%
+ \end{minipage}
+ \end{lrbox}
+ \begin{tikzpicture}
+ \node[outer ysep=0pt,inner ysep=0pt] (icone) {\includegraphics[scale=\cmdPAS@warning@scale]{\cmdPAS@warning@img}};
+ \ifPAS@warning@bg
+ \node[below right,rounded corners,very thick,draw=\cmdPAS@warning@draw,inner sep=\cmdPAS@warning@margins,fill=\cmdPAS@warning@bgcolor] (box) at (icone.north east) {\usebox{\attentionBox}};
+ \else
+ \node[below right,rounded corners,very thick,draw=\cmdPAS@warning@draw,inner sep=\cmdPAS@warning@margins,outer sep=0pt] (box) at (icone.north east) {\usebox{\attentionBox}};
+ \fi
+ \end{tikzpicture}
+}
+
+
\newenvironment{attention}[1][1]
{%
-\def\sc{#1}
+\def\scale@img{#1}
\begin{lrbox}{\imageBox}
-\includegraphics[scale=\sc]{attention.png}
+\includegraphics[scale=\scale@img]{attention.png}
\end{lrbox}
\settowidth{\largeurimageBox}{\usebox{\imageBox}}%
\begin{lrbox}{\attentionBox}
@@ -488,8 +585,8 @@
\end{minipage}
\end{lrbox}
\begin{tikzpicture}
-\node[below right,rounded corners,very thick,draw=red!60!black] (box) {\usebox{\attentionBox}};
-\node[below left] at ($(box.north west)+(0,0.8em)$) {\includegraphics[scale=\sc]{attention.png}};
+\node[outer ysep=0pt,inner ysep=0pt] (icone) {\includegraphics[scale=\scale@img]{attention.png}};
+\node[below right,rounded corners,very thick,draw=red!60!black] (box) at (icone.north east) {\usebox{\attentionBox}};
\end{tikzpicture}
\vspace*{2em}
}
@@ -516,4 +613,4 @@
\color{blue!40!black}Compl\'ement \thebonus : #1
\endgroup
\vspace*{1em}
-}
+} \ No newline at end of file