%pour les feries ça marche :) \documentclass[10pt,a4paper]{article} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[frenchb]{babel} \usepackage{fourier} \parindent0pt \usepackage[dvips,margin=9mm,lmargin=1.5cm,noheadfoot]{geometry} \usepackage{graphicx} \usepackage{pst-all,calc,colortbl,ifthen,xlop,multirow} \pagestyle{empty} %pour les calculs sur les dates \newcounter{jour} \setcounter{jour}{4} \newcounter{mois} \setcounter{mois}{9} \newcounter{annee} \setcounter{annee}{2006} \newcounter{totaljour} \newcounter{datejour} \newcounter{datemois} \newcommand{\Date}[1]{% \ifthenelse{#1=0}{\setcounter{datejour}{\thejour}}{}% \ifthenelse{#1=0}{\setcounter{datemois}{\themois}}{}% \addtocounter{jour}{#1}% \ifthenelse{\themois=9}{\setcounter{totaljour}{31}}{}% \ifthenelse{\themois=10}{\setcounter{totaljour}{32}}{}% \ifthenelse{\themois=11}{\setcounter{totaljour}{31}}{}% \ifthenelse{\themois=12}{\setcounter{totaljour}{32}}{}% \ifthenelse{\themois=13}{\setcounter{totaljour}{32}}{}% \ifthenelse{\themois=14}{\setcounter{totaljour}{29}}{}% \ifthenelse{\themois=15}{\setcounter{totaljour}{32}}{}% \ifthenelse{\themois=16}{\setcounter{totaljour}{31}}{}% \ifthenelse{\themois=17}{\setcounter{totaljour}{32}}{}% \ifthenelse{\themois=18}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thejour<\thetotaljour}{}{\setcounter{jour}{\thejour-\thetotaljour+1}\addtocounter{mois}{1}}% \ifthenelse{\themois=13}{\setcounter{annee}{2007}}{}% \ifthenelse{\themois<13}{\thejour/\themois/\theannee}{\thejour/\opsub*{\themois}{12}{a}\opprint{a}/\theannee}% } \newcommand{\Datejour}[1]{% \addtocounter{datejour}{#1}% \ifthenelse{\thedatejour<1}{\addtocounter{datemois}{-1}}{}% \ifthenelse{\thedatemois=9}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatemois=10}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=11}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatemois=12}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=13}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=14}{\setcounter{totaljour}{29}}{}% \ifthenelse{\thedatemois=15}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=16}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatemois=17}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=18}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatejour<1}{\setcounter{datejour}{\thetotaljour-1+\thedatejour}}{}% \ifthenelse{\thedatejour<\thetotaljour}{}{\setcounter{datejour}{\thedatejour-\thetotaljour+1}\addtocounter{datemois}{1}}% \ifthenelse{\thedatemois=13}{\setcounter{annee}{2007}}{}% \ifthenelse{\thedatemois<13}{\thedatejour/\thedatemois/\theannee}{\thedatejour/\opsub*{\thedatemois}{12}{a}\opprint{a}/\theannee}% } \newboolean{Ferie} \newcommand{\Datejourferie}[1]{% \addtocounter{datejour}{#1}% \ifthenelse{\thedatejour<1}{\addtocounter{datemois}{-1}}{}% \ifthenelse{\thedatemois=9}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatemois=10}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=11}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatemois=12}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=13}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=14}{\setcounter{totaljour}{29}}{}% \ifthenelse{\thedatemois=15}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=16}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatemois=17}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=18}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatejour<1}{\setcounter{datejour}{\thetotaljour-1+\thedatejour}}{}% \ifthenelse{\thedatejour<\thetotaljour}{}{\setcounter{datejour}{\thedatejour-\thetotaljour+1}\addtocounter{datemois}{1}}% \ifthenelse{\thedatemois=13}{\setcounter{annee}{2007}}{}% %essai ferie \setboolean{Ferie}{false} \ifthenelse{\thedatejour=1}{\ifthenelse{\thedatemois=11}{\setboolean{Ferie}{true}}{\setboolean{Ferie}{false}}{}\ifthenelse{\thedatemois=13}{\setboolean{Ferie}{true}}{\ifthenelse{\boolean{Ferie}}{}{}}\ifthenelse{\thedatemois=17}{\setboolean{Ferie}{true}}{\ifthenelse{\boolean{Ferie}}{}{}}}{}% \ifthenelse{\thedatejour=11}{\ifthenelse{\thedatemois=11}{\setboolean{Ferie}{true}}{\setboolean{Ferie}{false}}}{}% \ifthenelse{\thedatejour=25}{\ifthenelse{\thedatemois=12}{\setboolean{Ferie}{true}}{\setboolean{Ferie}{false}}}{}% \ifthenelse{\thedatejour=8}{\ifthenelse{\thedatemois=17}{\setboolean{Ferie}{true}}{\setboolean{Ferie}{false}}}{}% %essai ferie } \newboolean{Vacances} \newcommand{\Datejourvacances}[1]{% \addtocounter{datejour}{#1}% \ifthenelse{\thedatejour<1}{\addtocounter{datemois}{-1}}{}% \ifthenelse{\thedatemois=9}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatemois=10}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=11}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatemois=12}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=13}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=14}{\setcounter{totaljour}{29}}{}% \ifthenelse{\thedatemois=15}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=16}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatemois=17}{\setcounter{totaljour}{32}}{}% \ifthenelse{\thedatemois=18}{\setcounter{totaljour}{31}}{}% \ifthenelse{\thedatejour<1}{\setcounter{datejour}{\thetotaljour-1+\thedatejour}}{}% \ifthenelse{\thedatejour<\thetotaljour}{}{\setcounter{datejour}{\thedatejour-\thetotaljour+1}\addtocounter{datemois}{1}}% \ifthenelse{\thedatemois=13}{\setcounter{annee}{2007}}{}% % \setboolean{Vacances}{false} %Toussaint \ifthenelse{\thedatejour>25}{\ifthenelse{\thedatemois=10}{\setboolean{Vacances}{true}}{\setboolean{Vacances}{false}}}{}% \ifthenelse{\thedatejour<6}{\ifthenelse{\thedatemois=11}{\setboolean{Vacances}{true}}{\setboolean{Vacances}{false}}}{}% %Noel \ifthenelse{\thedatejour>23}{\ifthenelse{\thedatemois=12}{\setboolean{Vacances}{true}}{\ifthenelse{\boolean{Vacances}}{}{}}}{}% \ifthenelse{\thedatejour<8}{\ifthenelse{\thedatemois=13}{\setboolean{Vacances}{true}}{\ifthenelse{\boolean{Vacances}}{}{}}}{}% %Fevrier \ifthenelse{\thedatejour>24}{\ifthenelse{\thedatemois=14}{\setboolean{Vacances}{true}}{\ifthenelse{\boolean{Vacances}}{}{}}}{}% \ifthenelse{\thedatejour<12}{\ifthenelse{\thedatemois=15}{\setboolean{Vacances}{true}}{\ifthenelse{\boolean{Vacances}}{}{}}}{}% %Pâques \ifthenelse{\thedatejour>14}{\ifthenelse{\thedatemois=16}{\setboolean{Vacances}{true}}{\ifthenelse{\boolean{Vacances}}{}{}}}{}% \ifthenelse{\thedatejour<2}{\ifthenelse{\thedatemois=17}{\setboolean{Vacances}{true}}{\ifthenelse{\boolean{Vacances}}{}{}}}{}% %Juillet \ifthenelse{\thedatejour>4}{\ifthenelse{\thedatemois=19}{\setboolean{Vacances}{true}}{\ifthenelse{\boolean{Vacances}}{}{}}}{}% } %Construction du tableau \renewcommand{\arraystretch}{1.24} \newcommand{\Page}{ %\begin{center} \begin{tabular}{|m{0.02\linewidth}|m{0.45\linewidth}|m{0.45\linewidth}|} \hline \multicolumn{3}{|c|}{\sc{Semaine du \Date{0} au \Date{4}}}\\ \hline \multirow{11}{0.02\linewidth}{\rotatebox{90}{Lundi \Datejour{0}}}&8~h - 9~h\Datejourferie{0}\Datejourvacances{0}\ifthenelse{\boolean{Vacances}}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.2}}}}{}\ifthenelse{\boolean{Ferie}}{\ifthenelse{\boolean{Vacances}}{}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.1}}}}}{}\dotfill&13~h~30 - 14~h~30\Datejourferie{0}\Datejourvacances{0}\ifthenelse{\boolean{Ferie}}{\ifthenelse{\boolean{Vacances}}{}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.1}}}}}{}\dotfill\\ &\dotfill&\dotfill\\ &9~h - 10~h\dotfill&14~h~30 - 15~h~30\dotfill\\ &\dotfill&\dotfill\\ &10~h - 11~h\dotfill&15~h~30 - 16~h~30\dotfill\\ &\dotfill&\dotfill\\ &11~h - 12~h\dotfill&16~h~30 - 17~h~30\dotfill\\ &\dotfill&\dotfill\\ &\multicolumn{2}{c|}{\hbox to0.4\linewidth{\hrulefill}}\\ &\dotfill&\dotfill\\ &\dotfill&\dotfill\\ \hline \multirow{11}{0.02\linewidth}{\rotatebox{90}{Mardi \Datejour{1}}}&8~h - 9~h\Datejourferie{0}\Datejourvacances{0}\ifthenelse{\boolean{Vacances}}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.2}}}}{}\ifthenelse{\boolean{Ferie}}{\ifthenelse{\boolean{Vacances}}{}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.1}}}}}{}\dotfill&13~h~30 - 14~h~30\Datejourferie{0}\Datejourvacances{0}\ifthenelse{\boolean{Ferie}}{\ifthenelse{\boolean{Vacances}}{}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.1}}}}}{}\dotfill\\ &\dotfill&\dotfill\\ &9~h - 10~h\dotfill&14~h~30 - 15~h~30\dotfill\\ &\dotfill&\dotfill\\ &10~h - 11~h\dotfill&15~h~30 - 16~h~30\dotfill\\ &\dotfill&\dotfill\\ &11~h - 12~h\dotfill&16~h~30 - 17~h~30\dotfill\\ &\dotfill&\dotfill\\ &\multicolumn{2}{c|}{\hbox to0.4\linewidth{\hrulefill}}\\ &\dotfill&\dotfill\\ &\dotfill&\dotfill\\ \hline \multirow{7}{0.02\linewidth}{\rotatebox{90}{Mer. \Datejour{1}}}&8~h - 9~h\Datejourferie{0}\Datejourvacances{0}\ifthenelse{\boolean{Vacances}}{\raisebox{12pt}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.2}}}}}{}\ifthenelse{\boolean{Ferie}}{\ifthenelse{\boolean{Vacances}}{}{\raisebox{12pt}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.1}}}}}}{}\dotfill&9~h - 10~h\Datejourferie{0}\Datejourvacances{0}\ifthenelse{\boolean{Ferie}}{\ifthenelse{\boolean{Vacances}}{}{\raisebox{12pt}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.1}}}}}}{}\dotfill\\ &\dotfill&\dotfill\\ &10~h - 11~h\dotfill&11~h - 12~h\dotfill\\ &\dotfill&\dotfill\\ &\multicolumn{2}{c|}{\hbox to0.4\linewidth{\hrulefill}}\\ &\dotfill&\dotfill\\ &\dotfill&\dotfill\\ \hline \multirow{11}{0.02\linewidth}{\rotatebox{90}{Jeudi \Datejour{1}}}&8~h - 9~h\Datejourferie{0}\Datejourvacances{0}\ifthenelse{\boolean{Vacances}}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.2}}}}{}\ifthenelse{\boolean{Ferie}}{\ifthenelse{\boolean{Vacances}}{}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.1}}}}}{}\dotfill&13~h~30 - 14~h~30\Datejourferie{0}\Datejourvacances{0}\ifthenelse{\boolean{Ferie}}{\ifthenelse{\boolean{Vacances}}{}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.1}}}}}{}\dotfill\\ &\dotfill&\dotfill\\ &9~h - 10~h\dotfill&14~h~30 - 15~h~30\dotfill\\ &\dotfill&\dotfill\\ &10~h - 11~h\dotfill&15~h~30 - 16~h~30\dotfill\\ &\dotfill&\dotfill\\ &11~h - 12~h\dotfill&16~h~30 - 17~h~30\dotfill\\ &\dotfill&\dotfill\\ &\multicolumn{2}{c|}{\hbox to0.4\linewidth{\hrulefill}}\\ &\dotfill&\dotfill\\ &\dotfill&\dotfill\\ \hline \multirow{11}{0.02\linewidth}{\rotatebox{90}{Vendredi \Datejour{1}}}&8~h - 9~h\Datejourferie{0}\Datejourvacances{0}\ifthenelse{\boolean{Vacances}}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.2}}}}{}\ifthenelse{\boolean{Ferie}}{\ifthenelse{\boolean{Vacances}}{}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.1}}}}}{}\dotfill&13~h~30 - 14~h~30\Datejourferie{0}\Datejourvacances{0}\ifthenelse{\boolean{Ferie}}{\ifthenelse{\boolean{Vacances}}{}{\vbox to0cm{\hbox to0cm{\includegraphics{agenda.1}}}}}{}\dotfill\\ &\dotfill&\dotfill\\ &9~h - 10~h\dotfill&14~h~30 - 15~h~30\dotfill\\ &\dotfill&\dotfill\\ &10~h - 11~h\dotfill&15~h~30 - 16~h~30\dotfill\\ &\dotfill&\dotfill\\ &11~h - 12~h\dotfill&16~h~30 - 17~h~30\dotfill\\ &\dotfill&\dotfill\\ &\multicolumn{2}{c|}{\hbox to0.4\linewidth{\hrulefill}}\\ &\dotfill&\dotfill\\ &\dotfill&\dotfill\\ \hline \end{tabular} %\end{center} } \begin{document} \newcounter{semaine} \setcounter{semaine}{1} \setcounter{semaine}{1} \whiledo{\thesemaine<10}{\Page\newpage\addtocounter{semaine}{1}\addtocounter{jour}{3}} \end{document}