Generateurv2/backend/api/exercices/tex/test.tex
2022-05-18 10:15:54 +02:00

124 lines
3.3 KiB
TeX

\documentclass[a4paper, 14pt]{article}
\usepackage{fontspec}
\usepackage[utf8]{inputenc} % UTF-8
\usepackage[T1]{fontenc}
\usepackage{lmodern} % Prévient un bug d'affichage evince lié à [T1]{fontenc}
\usepackage[french]{babel} % francisation
\usepackage[fleqn]{amsmath} % aligne le mode maths à gauche
\usepackage[table, usenames, svgnames]{xcolor} % Couleurs
\usepackage{multicol} % Multi-colonnes
\usepackage{fancyhdr} % Mise en page, en-tête et pied de page
\usepackage{calc} % Opérations
\usepackage[autolanguage]{numprint} % écrituredes virgules
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage[a4paper, dvips, left=1.5cm, right=1.5cm, top=2cm,%
bottom=2cm, marginpar=5mm, marginparsep=5pt]{geometry}
\usepackage[bookmarks=true, bookmarksnumbered=true, pagebackref=true,%
colorlinks=true,linkcolor=blue,plainpages=true, unicode]{hyperref}
\hypersetup{pdfauthor={Lilian Couchet},pdfsubject={Exercices de
mathématiques},pdftitle={Exercices}}
%\usepackage{textcomp}
\def\pshlabel#1{\psframebox*[fillcolor=White,framearc=.2]{\footnotesize $#1$}}
\def\psvlabel#1{\psframebox*[fillcolor=White,framearc=.2]{\footnotesize $#1$}}
\setlength{\columnsep}{0pt}
\setlength{\headheight}{18pt}
\newcounter{exo}
\makeatletter
\newcommand\styleexo[1][]{
\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\labelenumi}{\textbf{\theenumi.}}
\renewcommand{\theenumii}{\alph{enumii}}
\renewcommand{\labelenumii}{\textbf{\theenumii}}
{\textbf{\underline{\\#1 \theexo}}}
\par\@afterheading\vspace{0.5\baselineskip minus 0.2\baselineskip}}
\newcommand\exercice[3]{
\refstepcounter{exo}%
\noindent
\begin{minipage}{\textwidth}
\styleexo[#1]
#2
#3
\end{minipage}
\vspace{1cm}
}
\setlength\parindent{0em}
\setlength\mathindent{0em}
\count1=\year \count2=\year \ifnum\month<8\advance\count1by-1\else\advance\count2by1\fi
\pagestyle{fancy}
\cfoot{\textsl{\footnotesize{Année \number\count1/\number\count2}}}
\rfoot{\textsl{\tiny{Generateur}}}
\lhead{\textsl{\footnotesize{Page \thepage/ \pageref{LastPage}}}}
\chead{\Large{\textsc{ {{title}} }}}
\begin{document}
\currentpdfbookmark{Les énoncés des exercices}{Énoncés}
\setmainfont[
BoldFont={Liberation Serif Bold},
ItalicFont={Liberation Serif Italic},
BoldItalicFont={Liberation Serif Bold Italic}
]{Liberation Serif}
\def\HS{\hspace{\fontdimen3\font}}
\newcounter{nocalcul}[exo]
\renewcommand{\thenocalcul}{\Alph{nocalcul}}
\raggedcolumns
\setlength{\columnseprule}{0.5pt}
{% for exo in exos %}
\exercice{Exercice}{ {{ exo.consigne }} }{
\begin{multicols}{ {{exo.columns}} }\noindent
\begin{enumerate}
{% for e in exo.exos%}
\item ${{e.calcul}}$
{% endfor %}
\end{enumerate}
\end{multicols}
}
{% endfor %}
\label{LastPage}
\newpage
\currentpdfbookmark{Le corrigé des exercices}{Corrigé}
\lhead{\textsl{\footnotesize Page \thepage/ \pageref{LastCorPage}}}
\setcounter{page}{1}
\setcounter{exo}{0}
{% for exo in exos %}
\exercice{Corrigé}{ {{ exo.consigne }} }{
{% if exo.correction%}
\begin{multicols}{ {{exo.columns}} }\noindent
\begin{enumerate}
{% for e in exo.exos%}
\item ${{e.correction}}$
{% endfor %}
\end{enumerate}
\end{multicols}
{% else%}
Pas de corretion donnée
{% endif %}
}
{% endfor %}
\label{LastCorPage}
\end{document}