% entete
%%!TEX TS-program = latex
\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[frenchb]{babel}
\usepackage[autolanguage]{numprint}
\usepackage[fleqn]{amsmath}
\usepackage{amssymb,multicol,calc,vmargin,cancel,fancyhdr,units,pst-eucl,wrapfig,wasysym,pst-plot,tabularx,textcomp}
\setmarginsrb{1.5cm}{1.5cm}{1.5cm}{1.5cm}{.5cm}{.5cm}{.5cm}{1.cm}
\newcounter{exo}
\setlength{\headheight}{18pt}
\setlength{\fboxsep}{1em}
\setlength\parindent{0em}
\setlength\mathindent{0em}
\setlength{\columnsep}{30pt}
\usepackage[bookmarks=true, bookmarksnumbered=true, ps2pdf, pagebackref=true,%
            colorlinks=true,linkcolor=blue,plainpages=true]{hyperref}
\hypersetup{pdfauthor={Jérôme Ortais},pdfsubject={Exercices de
    mathématiques},pdftitle={Exercices créés par Pyromaths, un logiciel libre
    en Python sous licence GPL}}
\makeatletter
\newcommand\styleexo[1][]{
  \renewcommand{\theenumi}{\arabic{enumi}}
  \renewcommand{\labelenumi}{$\blacktriangleright$\textbf{\theenumi.}}
  \renewcommand{\theenumii}{\alph{enumii}}
  \renewcommand{\labelenumii}{\textbf{\theenumii)}}
  {\fontfamily{pag}\fontseries{b}\selectfont \underline{#1 \theexo}
    }
  \par\@afterheading\vspace{0.5\baselineskip minus 0.2\baselineskip}
  }
\newcommand*\exercice{%
  \psset{unit=1cm}
  %\ifthenelse{\equal{\theexo}{0}} {} {\filbreak}
  \refstepcounter{exo}%
  \stepcounter{nocalcul}%
  \par\addvspace{1.5\baselineskip minus 1\baselineskip}%
  \@ifstar%
  {\penalty-130\styleexo[Corrigé de l'exercice]}%
  {\penalty-130\styleexo[Exercice]}%
  }
\makeatother
\newlength{\ltxt}
\newcounter{fig}
\newcommand{\figureadroite}[2]{
  \setlength{\ltxt}{\linewidth}
  \setbox\thefig=\hbox{#1}
  \addtolength{\ltxt}{-\wd\thefig}
  \addtolength{\ltxt}{-10pt}
  \begin{minipage}{\ltxt}
    #2
  \end{minipage}
  \hfill
  \begin{minipage}{\wd\thefig}
    #1
  \end{minipage}
  \refstepcounter{fig}
  }
\count1=\year \count2=\year \ifnum\month<8\advance\count1by-1\else\advance\count2by1\fi

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}% filet en haut de page
\lhead[]{} \rhead[]{} \chead[]{}
\cfoot{\textsl{\footnotesize{Année \number\count1/\number\count2}}}
\rfoot{\textsl{\tiny{http://www.pyromaths.org}}}

\begin{document}
##{{BOOKMARK}}##
\newcounter{nocalcul}[exo]
\renewcommand{\thenocalcul}{\Alph{nocalcul}}
\raggedcolumns
\setlength{\columnseprule}{0.5pt}
{\noindent \textbf{NOM :} \hfill \textbf{##{{NIVEAU}}##}}\par
\vskip 0.3cm {\noindent \textbf{Prénom :} \hfill
\begin{center}
  {\large \textbf{##{{TITRE}}##}}\par
\end{center}
\vskip 0.3cm \hrule\vspace{\baselineskip}
% fin entete



% pied de page
\end{document}
% fin pied de page
