====== Différences ====== Cette page vous donne les différences entre la révision choisie et la version actuelle de la page.
sylcha:macros [2008/03/05 20:31] sylcha |
sylcha:macros [2009/06/01 23:35] (Version actuelle) sylcha |
||
---|---|---|---|
Ligne 7: | Ligne 7: | ||
% | % | ||
% M A C R O S | % M A C R O S | ||
+ | % | ||
+ | % version du 01/06/2009 | ||
% | % | ||
%######################################################################### | %######################################################################### | ||
Ligne 12: | Ligne 14: | ||
%------------------------------------------------------------------------- | %------------------------------------------------------------------------- | ||
- | % Barème : | + | % Texte dans un cercle |
- | % Exercices -> \EXO{nb_de_points} | + | |
- | % Questions -> \QUEST{nb_de_points}{commentaire} | + | |
%------------------------------------------------------------------------- | %------------------------------------------------------------------------- | ||
- | \newcommand{\EXO}[1]{\marginpar{\footnotesize \textbf {\sffamily #1 pts}}} | + | \newcommand{\txtcercle}[1]{% |
- | \newcommand{\QUEST}[2]{\marginpar{\scriptsize \textsf{#1 #2}}} | + | \tikz[baseline=(X.base)] \filldraw[fill=black!20, draw=none]% |
+ | (0,0) node (X) {#1} circle (8pt); | ||
+ | } | ||
+ | %------------------------------------------------------------------------- | ||
+ | % Macro bareme | ||
+ | %------------------------------------------------------------------------- | ||
+ | \newcommand{\bareme}[1]{% | ||
+ | \marginpar{\small \textbf{#1}} | ||
+ | } | ||
%------------------------------------------------------------------------- | %------------------------------------------------------------------------- | ||
Ligne 25: | Ligne 33: | ||
\newcounter{num} | \newcounter{num} | ||
\newcommand{\exo}[1]{\addtocounter{num}{1}% | \newcommand{\exo}[1]{\addtocounter{num}{1}% | ||
- | \subsection*{{\sffamily Exercice~\thenum~{\itshape #1}}}% | + | \subsection*{ \textsc{Exercice~\thenum~{\itshape \textsf{#1}}}}% |
} | } | ||
Ligne 37: | Ligne 45: | ||
\addtocounter{numf}{1}% | \addtocounter{numf}{1}% | ||
\subsection*{% | \subsection*{% | ||
- | \begin{tabular}{p{0.98\columnwidth}} | + | \begin{tabular}{p{0.97\columnwidth}} |
\rowcolor{gris} | \rowcolor{gris} | ||
$\blacktriangleright$~Exercice~\thenumf~ { \itshape #1} | $\blacktriangleright$~Exercice~\thenumf~ { \itshape #1} | ||
Ligne 62: | Ligne 70: | ||
%------------------------------------------------------------------------- | %------------------------------------------------------------------------- | ||
\newcounter{exobrevet} | \newcounter{exobrevet} | ||
- | \newcommand{\exob}[1]{\addtocounter{exobrevet}{1}% | + | \newcommand{\exob}[1]{% |
- | \vspace{10pt}% | + | \tablarg{1}% |
- | \etoile~{\large \sffamily \textbf{Exercice~\theexobrevet~}} -- \textit{#1}% | + | \addtocounter{exobrevet}{1}% |
+ | \subsection*{% | ||
+ | \begin{tabular}{p{0.97\columnwidth}} | ||
+ | \rowcolor{gris} | ||
+ | $\blacktriangleright$~Exercice~\theexobrevet~ -- \textit{#1}% | ||
%\hrulefill | %\hrulefill | ||
- | \\% | + | \end{tabular} |
- | } | + | }} |
Ligne 138: | Ligne 150: | ||
\newcommand{\into}[2]% intervalle ouvert ]#1;#2[ | \newcommand{\into}[2]% intervalle ouvert ]#1;#2[ | ||
{\ensuremath{\left]\,#1\,;\,#2\,\right[}} | {\ensuremath{\left]\,#1\,;\,#2\,\right[}} | ||
- | \newcommand{\intof}[2]% intervalle ouvert-ferm�]#1;#2] | + | \newcommand{\intof}[2]% intervalle ouvert-fermᅵ]#1;#2] |
{\ensuremath{\left]\,#1\,;\,#2\,\right]}} | {\ensuremath{\left]\,#1\,;\,#2\,\right]}} | ||
- | \newcommand{\intfo}[2]% intervalle ferm�ouvert [#1;#2[ | + | \newcommand{\intfo}[2]% intervalle fermᅵouvert [#1;#2[ |
{\ensuremath{\left[\,#1\,;\,#2\,\right[}} | {\ensuremath{\left[\,#1\,;\,#2\,\right[}} | ||
- | \newcommand{\intf}[2]% intervalle ferm�[#1,#2] | + | \newcommand{\intf}[2]% intervalle fermᅵ[#1,#2] |
{\ensuremath{\left[\,#1\,;\,#2\,\right]}} | {\ensuremath{\left[\,#1\,;\,#2\,\right]}} | ||
Ligne 205: | Ligne 217: | ||
\newsavebox{\boite} | \newsavebox{\boite} | ||
\newlength{\haut} | \newlength{\haut} | ||
+ | \newlength{\marge}\setlength{\marge}{5mm} | ||
\newenvironment{barreagauche}{% | \newenvironment{barreagauche}{% | ||
\vspace{5pt} | \vspace{5pt} | ||
Ligne 212: | Ligne 225: | ||
\end{lrbox} | \end{lrbox} | ||
\settoheight{\haut}{\usebox{\boite}} | \settoheight{\haut}{\usebox{\boite}} | ||
+ | %} | ||
\addtolength{\haut}{3pt} | \addtolength{\haut}{3pt} | ||
\rule{1mm}{\haut}\hfill | \rule{1mm}{\haut}\hfill | ||
- | \usebox{\boite}} | + | \usebox{\boite} |
+ | } | ||
%------------------------------------------------------------------------- | %------------------------------------------------------------------------- | ||
Ligne 411: | Ligne 426: | ||
% | % | ||
%#################################################################### | %#################################################################### | ||
- | |||
Ligne 469: | Ligne 483: | ||
\end{tabular} | \end{tabular} | ||
} | } | ||
+ | |||
+ | %------------------------------------------------------------------------- | ||
+ | % Mise en page | ||
+ | % | ||
+ | % liste numérotée personnalisé | ||
+ | %------------------------------------------------------------------------- | ||
+ | \newenvironment{myenumerate}{ | ||
+ | \renewcommand{\theenumi}{\arabic{enumi}} | ||
+ | \def\labelenumi{{\bf \theenumi .}} | ||
+ | \begin{enumerate}}{\end{enumerate}} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | %------------------------------------------------------------------------- | ||
+ | % Calcul de pgcd (utilise xlop) | ||
+ | % | ||
+ | % liste des divisions successives de l'algorithme d'euclide | ||
+ | % SANS LA DERNIÈRE !!! | ||
+ | %------------------------------------------------------------------------- | ||
+ | |||
+ | \newcommand\euclide[2]{% | ||
+ | \opcopy{#1}{r0} | ||
+ | \opcopy{#2}{r1} | ||
+ | \loop | ||
+ | \opidiv*{r0}{r1}{q}{r}% | ||
+ | \opcmp{r}{0} | ||
+ | \ifopneq | ||
+ | \opidiv[style=text]{r0}{r1}\endgraf | ||
+ | \opcmp{r}{0}% | ||
+ | \endgraf | ||
+ | \opcopy{r1}{r0} | ||
+ | \opcopy{r}{r1} | ||
+ | \repeat | ||
+ | \opidiv[style=text]{r0}{r1}\endgraf | ||
+ | } | ||
+ | |||
+ | \newcommand\Pgcd[2]{% | ||
+ | \ensuremath{% | ||
+ | \opgcd{#1}{#2}{p} | ||
+ | \opprint{p} | ||
+ | } | ||
+ | } | ||
+ | |||
+ | \newcommand\PGCD[2]{% | ||
+ | \opgcd{#1}{#2}{pp} | ||
+ | \ensuremath{% | ||
+ | \mathrm{pgcd}(#1\;;\;#2)=\opprint{pp} | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | %------------------------------------------------------------------------- | ||
+ | % | ||
+ | % Disposition texte <--> image | ||
+ | % | ||
+ | %------------------------------------------------------------------------- | ||
+ | |||
+ | |||
+ | \newlength{\ltxt} | ||
+ | \newcommand{\compo}[4]{ | ||
+ | \setlength{\ltxt}{\linewidth} | ||
+ | \setbox#1=\hbox{\includegraphics[scale=#3]{#2.#1}} | ||
+ | \addtolength{\ltxt}{-\wd#1} | ||
+ | \addtolength{\ltxt}{-10pt} | ||
+ | \addtolength{\ltxt}{-2em} | ||
+ | \begin{minipage}{\wd#1} | ||
+ | \includegraphics[scale=#3]{#2.#1} | ||
+ | \end{minipage} | ||
+ | \hfill\hspace{2em}\hfill | ||
+ | \begin{minipage}{\ltxt} | ||
+ | #4 | ||
+ | \end{minipage} | ||
+ | } | ||
+ | |||
+ | \newlength{\lntxt} | ||
+ | \newcommand{\Compo}[4]{ | ||
+ | \setlength{\lntxt}{\linewidth} | ||
+ | \setbox#1=\hbox{\includegraphics[scale=#3]{#2}} | ||
+ | \addtolength{\lntxt}{-\wd#1} | ||
+ | \addtolength{\lntxt}{-10pt} | ||
+ | \addtolength{\ltxt}{-2em} | ||
+ | \begin{minipage}{\wd#1} | ||
+ | \includegraphics[scale=#3]{#2} | ||
+ | \end{minipage} | ||
+ | \hfill\hspace{2em}\hfill | ||
+ | \begin{minipage}{\lntxt} | ||
+ | #4 | ||
+ | \end{minipage} | ||
+ | } | ||
+ | |||
+ | \newlength{\lnttxt} | ||
+ | \newcommand{\dispo}[3]{ | ||
+ | \setlength{\lnttxt}{\linewidth} | ||
+ | \setbox#1=\hbox{#2} | ||
+ | \addtolength{\lnttxt}{-\wd#1} | ||
+ | \addtolength{\lnttxt}{-20pt} | ||
+ | \addtolength{\ltxt}{-2em} | ||
+ | \begin{minipage}{\wd#1} | ||
+ | #2 | ||
+ | \end{minipage} | ||
+ | \hfill\hspace{2em}\hfill | ||
+ | \begin{minipage}{\lnttxt} | ||
+ | #3 | ||
+ | \end{minipage} | ||
+ | } | ||
+ | |||
</code> | </code> | ||