Retour

macros_sylvain.tex

Télécharger le fichier
%#########################################################################
%
%             M A C R O S
%
%#########################################################################
 
 
%-------------------------------------------------------------------------
% Barème :
%  Exercices -> \EXO{nb_de_points}
%  Questions -> \QUEST{nb_de_points}{commentaire}
%-------------------------------------------------------------------------
\newcommand{\EXO}[1]{\marginpar{\footnotesize \textbf {\sffamily #1 pts}}}
\newcommand{\QUEST}[2]{\marginpar{\scriptsize \textsf{#1 #2}}}
 
 
%-------------------------------------------------------------------------
% Macro Titre Exercice avec compteur
%-------------------------------------------------------------------------
\newcounter{num}
\newcommand{\exo}[1]{\addtocounter{num}{1}%
\subsection*{{\sffamily Exercice~\thenum~{\itshape #1}}}%
}
 
 
%-------------------------------------------------------------------------
% Autre Macro Titre Exercice avec compteur (fourier)
%-------------------------------------------------------------------------
\newcounter{numf}
\newcommand{\exof}[1]{%
\tablarg{1}%
\addtocounter{numf}{1}%
\subsection*{%
\begin{tabular}{p{0.98\columnwidth}}
\rowcolor{gris}
$\blacktriangleright$~Exercice~\thenumf~ { \itshape #1}
\end{tabular}
}}
 
 
%-------------------------------------------------------------------------
% Macro Annexe avec compteur
%-------------------------------------------------------------------------
\newcounter{numannexe}
\newcommand{\annexe}[1]{\addtocounter{numannexe}{1}%
\subsection*{{\sffamily Annexe~\thenumannexe~{\itshape #1}}}%
}
 
\newcounter{numannexef}
\newcommand{\annexef}[1]{\addtocounter{numannexef}{1}%
\subsection*{Annexe~\thenumannexef~{\itshape #1}}%
}
 
 
%-------------------------------------------------------------------------
% Macro Titre Exercice Brevet avec compteur
%-------------------------------------------------------------------------
\newcounter{exobrevet}
\newcommand{\exob}[1]{\addtocounter{exobrevet}{1}%
\vspace{10pt}%
\etoile~{\large \sffamily \textbf{Exercice~\theexobrevet~}} -- \textit{#1}%
%\hrulefill
\\%
}
 
 
%-------------------------------------------------------------------------
% Ensembles de nombres
%-------------------------------------------------------------------------
\newcommand{\RR}{\ensuremath{\mathbb{R}}}
\newcommand{\QQ}{\ensuremath{\mathbb{Q}}}
\newcommand{\DD}{\ensuremath{\mathbb{D}}}
\newcommand{\ZZ}{\ensuremath{\mathbb{Z}}}
\newcommand{\NN}{\ensuremath{\mathbb{N}}}
 
 
%-------------------------------------------------------------------------
% Abréviations
%-------------------------------------------------------------------------
\newcommand{\cad}{c'est-à-dire~}
\newcommand{\dps}[1]{{\displaystyle #1}}
\newcommand{\ms}[1]{\mathsf{#1}}
\newcommand{\md}[1]{\mathsf{\displaystyle #1}}
\newcommand{\etoile}{\Pisymbol{pzd}{72}}
\newcommand{\equi}{\ensuremath{\Leftrightarrow}}
 
 
%-------------------------------------------------------------------------
% Ligne pour le Nom et le Prénom en devoir
%-------------------------------------------------------------------------
\newcommand{\nomprenom}{
\setlength\arrayrulewidth{0.5pt}
%\renewcommand{\arraystretch}{2}
	{\large
\noindent
	\begin{tabular}{p{0.42\textwidth}p{0.08\textwidth}p{0.42\textwidth}}
       	\textbf{Nom}~:~\dotfill & & \textbf{Prénom}~:~\dotfill
   	\end{tabular}
   	}
}
 
 
%-------------------------------------------------------------------------
% Centrage cellule dans tableau
%-------------------------------------------------------------------------
\newcommand{\cc}[1]{\multicolumn{1}{|c|}{#1}}
 
 
%-------------------------------------------------------------------------
% Arc orienté
%-------------------------------------------------------------------------
\newcommand{\ArcOr}[1]{\ensuremath{\overset{\curvearrowright}{#1}}}
 
 
%-------------------------------------------------------------------------
% Arc de cercle
%-------------------------------------------------------------------------
\newlength{\longarc}
\newcommand{\arc}[1]{\settowidth{\longarc}{$#1$}%
         \addtolength{\longarc}{-0.3em}%
\unitlength \longarc%
\ensuremath{%
         \stackrel{\begin{picture}(1,0.4)
                 \qbezier(0,0)(0.5,0.4)(1,0)
         \end{picture}}
         {#1}
}}
 
 
% ------------------------------------------------------------
% Ecriture des intervalles
%-------------------------------------------------------------------------
\newcommand{\into}[2]% intervalle ouvert ]#1;#2[
{\ensuremath{\left]\,#1\,;\,#2\,\right[}}
\newcommand{\intof}[2]% intervalle ouvert-fermé]#1;#2]
{\ensuremath{\left]\,#1\,;\,#2\,\right]}}
\newcommand{\intfo}[2]% intervalle fermé-ouvert [#1;#2[
{\ensuremath{\left[\,#1\,;\,#2\,\right[}}
\newcommand{\intf}[2]% intervalle fermé[#1,#2]
{\ensuremath{\left[\,#1\,;\,#2\,\right]}}
 
 
%-------------------------------------------------------------------------
% Vecteurs, Repères, Coordonnées, Bases.....
%-------------------------------------------------------------------------
\newcommand{\vect}[1]{%
	\ensuremath{%
	\overrightarrow{\kern-2pt\mathstrut #1\kern2pt}
	}
}
 
\newcommand{\repr}[3]{%
\ensuremath{%
\left( #1\,;\,\vect{#2},\,\vect{#3} \right)}%
}
 
\newcommand{\ora}[1]{%
\overrightarrow{#1}%
}
\newcommand{\Repr}[3]{%
\ensuremath{%
\left( #1\,;\,\ora{#2},\,\ora{#3} \right)}%
}
 
\newcommand{\Oij}{%
\Repr{O}{i}{j}}
 
\newcommand{\coord}[3]{%
\ensuremath{%
#1\,\left(#2\,;\,#3\right)
}
}
 
\newcommand{\Coord}[3]{%
\ensuremath{%
\vect{#1}\,\left(
	\begin{array}{c}
		#2\\
		#3
	\end{array}
	\right)
}
}
 
\newcommand{\base}[2]{%
\ensuremath{%
\left(\ora{#1}\,;\,\ora{#2}\right)}
}
 
\newcommand{\norme}[1]{%
\ensuremath{%
\left\| \ora{#1} \right\|}}
 
 
 
 
%-------------------------------------------------------------------------
% Mise en page : barre à gauche
%-------------------------------------------------------------------------
\newsavebox{\boite}
\newlength{\haut}
\newenvironment{barreagauche}{%
\vspace{5pt}
\begin{lrbox}{\boite}
\begin{minipage}[b]{.97\textwidth}}{%
\end{minipage}
\end{lrbox}
\settoheight{\haut}{\usebox{\boite}}
\addtolength{\haut}{3pt}
\rule{1mm}{\haut}\hfill
\usebox{\boite}}
 
%-------------------------------------------------------------------------
% Mise en page : titrage exos
%-------------------------------------------------------------------------
\newcommand{\titre}[1]{%
\etoile{}~\textit{#1}
}
 
 
%-------------------------------------------------------------------------
% Points sur une largeur fixée (pour champs à compléter)
%-------------------------------------------------------------------------
\newcommand{\points}[1]{%
\renewcommand{\arraystretch}{1}
\begin{tabular}{p{#1}}
\dotfill
\end{tabular}
}
 
 
%-------------------------------------------------------------------------
% Pour fixer la largeur texte-ligne dans un tableau
%-------------------------------------------------------------------------
\newcommand{\tablarg}[1]{%
\renewcommand{\arraystretch}{#1}
}
 
 
%-------------------------------------------------------------------------
% Mise en page : boites
%-------------------------------------------------------------------------
\newcommand{\Boite}[1]{
\setlength{\fboxsep}{3mm}
\shadowbox{
\begin{minipage}{0.97\textwidth}
#1
 
\end{minipage}
}
\setlength{\fboxsep}{1mm}
}
 
 
 
%-------------------------------------------------------------------------
% Commandes pour les propriétés
%-------------------------------------------------------------------------
 
 
% Dans un environnement 'book' avec chapitrage
% --> commande 'Prop'
 
\newcounter{comptprop}
\newcommand{\Prop}[2][]{
\addtocounter{comptprop}{1}%
 
\vspace{10pt}
 
\setlength{\fboxsep}{3mm}
\shadowbox{
\begin{minipage}{0.94\textwidth}
\textbf{Propriété\thechapter-\thecomptprop}~:#1
#2
 
\end{minipage}
}
\setlength{\fboxsep}{1mm}
}
 
 
 
 
% Dans un environnement 'article' sans chapitrage
% --> commande 'Propriete'
 
\newcounter{comptpropriete}
\newcommand{\Propriete}[1]{
\addtocounter{comptpropriete}{1}%
 
%\vspace{15pt}
 
\setlength{\fboxsep}{3mm}
\shadowbox{
\begin{minipage}{0.97\textwidth}
\textbf{Propriété~\thecomptpropriete}~:
#1
\end{minipage}
}
\setlength{\fboxsep}{1mm}
}
 
 
 
% Environnement "SI ... ALORS ... "
% --> lié compteur que la commande 'Propriete'
 
%\newcounter{comptsialors}
\newcommand{\sialors}[2]{
\addtocounter{comptpropriete}{1}%
 
%\vspace{15pt}
 
\setlength{\fboxsep}{1.5mm}
\shadowbox{
\begin{minipage}{0.97\textwidth}
\textbf{Propriété~\thecomptpropriete}~:
\ovalbox{Si}~#1\\
\ovalbox{alors}~#2
\end{minipage}
}
\setlength{\fboxsep}{1mm}
}
 
 
 
%-------------------------------------------------------------------------
%  Environnement pour les règles
%-------------------------------------------------------------------------
\newcounter{comptregle}
\newcommand{\Regle}[1]{
\addtocounter{comptregle}{1}%
 
%\vspace{15pt}
 
\setlength{\fboxsep}{3mm}
\shadowbox{
\begin{minipage}[b]{0.97\textwidth}
\textbf{Règle~\thecomptregle}~:
#1
 
\end{minipage}
}
\setlength{\fboxsep}{1mm}
}
 
 
%-------------------------------------------------------------------------
% Commandes pour les définitions *********************
%-------------------------------------------------------------------------
 
%--------- dans une classe 'book'
\newcounter{comptdef}
\newcommand{\Def}[2][]{
\addtocounter{comptdef}{1}
 
\vspace{10pt}
 
\setlength{\fboxsep}{3mm}
\Ovalbox{
\begin{minipage}{0.95\textwidth}
\textbf{Définition~\thechapter-\thecomptdef#1:}
 
#2
 
\end{minipage}
}
}
 
 
% ----------- dans une classe 'article'
\newcommand{\Definition}[1]{
\addtocounter{comptdef}{1}
 
%\vspace{15pt}
 
\setlength{\fboxsep}{3mm}
\ovalbox{
\begin{minipage}{0.97\textwidth}
\textbf{Définition~\thecomptdef:}
#1
\end{minipage}
}
 
%\vspace{10pt}
 
}
 
 
%-------------------------------------------------------------------------
% Cadres
%-------------------------------------------------------------------------
\newcommand{\Cadre}[3]{
\boxput*(#1,1){\colorbox{white}{#2}}
{\setlength{\fboxsep}{12pt}
\fbox{\begin{Bflushleft}
#3\end{Bflushleft}}}}
 
 
 
 
 
%####################################################################
%
% Pris sur le net.....
%
%####################################################################
 
 
 
%--------------------------------------------------------------------
% La fameuse \trou de Olivier K qui remplace un mot 
% par un trou de la meme taille
%--------------------------------------------------------------------
\def\m@th{\mathsurround=0pt}
\def\trou#1{
    \setbox0=\hbox{\textbf{#1}} \dp0=0pt \m@th
    \underline{\hbox{\hskip\wd0}}
}
 
\newcommand*{\makepbox}[2]{%
  \makebox[0pt][l]{\parbox[t]{\linewidth}{#1#2}}
}
 
%--------------------------------------------------------------------
% Titrage pour devoir
% USAGE : \lcr{Tes\\ commentaires}{Mathématiques no}{nom:\\ prénom:}
%--------------------------------------------------------------------
\newcommand{\lcr}[3]{%
  \par \noindent
  \makepbox{\raggedright}{#1}%
  \makepbox{\centering}{#2}%
  \makepbox{\raggedleft}{#3}%
  \par
} 
 
 
%-------------------------------------------------------------------------
% Mise en page
%
% \textefigure{largeur_figure}{largeur_texte}{figure}{echelle}{texte}
%-------------------------------------------------------------------------
\newcommand{\textefigure}[5]{%
\begin{tabular}{lp{0.5cm}l}
	\begin{minipage}{#2}
	#5
	\end{minipage}
	& &
	\begin{minipage}{#1}
	\includegraphics[scale=#4]{#3}
	\end{minipage}
\end{tabular}
}
 
\newcommand{\figuretexte}[5]{%
\begin{tabular}{lp{0.5cm}l}
	\begin{minipage}{#1}
	\includegraphics[scale=#4]{#3}
	\end{minipage}
	& &
	\begin{minipage}{#2}
	#5
	\end{minipage}
\end{tabular}
}