2019-02-24 14:23:28 +01:00
|
|
|
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
|
|
|
|
\ProvidesPackage{inputTD}
|
2018-02-21 19:12:43 +01:00
|
|
|
\makeatletter
|
|
|
|
|
\@ifundefined{stylecentrale}
|
2018-03-09 10:51:53 +01:00
|
|
|
{\@ifundefined{resetlevel}{\def\resetlevel{[section]}}{}}
|
2018-02-21 19:12:43 +01:00
|
|
|
{%
|
|
|
|
|
\renewcommand\thesection{\Roman{section}}%
|
|
|
|
|
\renewcommand\thesubsection{\thesection.\Alph{subsection}}%
|
2018-03-09 10:51:53 +01:00
|
|
|
\def\resetlevel{[subsection]}
|
2018-02-21 19:12:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\theoremstyle{plain}
|
|
|
|
|
\theoremheaderfont{\bfseries}
|
|
|
|
|
\theorembodyfont{\upshape}
|
|
|
|
|
\theoremseparator{. }
|
|
|
|
|
\theoremsymbol{}
|
|
|
|
|
\newtheorem*{important}{Important}
|
|
|
|
|
\newtheorem*{rappel}{Rappel}
|
|
|
|
|
|
2019-02-24 14:23:28 +01:00
|
|
|
\RequirePackage{xfrac}
|
|
|
|
|
\RequirePackage{xparse}
|
|
|
|
|
\RequirePackage{comment}
|
|
|
|
|
\RequirePackage{xr}
|
2018-02-21 19:12:43 +01:00
|
|
|
|
2019-05-05 13:10:47 +02:00
|
|
|
\newcount\modecorrige
|
|
|
|
|
%% 0 énoncé normal
|
|
|
|
|
%% 1 corrigé seul
|
|
|
|
|
%% 2 mode prof
|
|
|
|
|
%% 3 corrigé de concours
|
|
|
|
|
|
2018-02-21 19:12:43 +01:00
|
|
|
\newif\ifcorrige
|
2019-05-05 13:10:47 +02:00
|
|
|
\def\corr{\filigrane{\Huge CORRIG\'E --- CORRIG\'E}\global\modecorrige=2\global\corrigetrue\global\enoncefalse}
|
2018-02-21 19:12:43 +01:00
|
|
|
\newif\ifcorrigeseul
|
2019-05-05 13:10:47 +02:00
|
|
|
\def\corrseul{\filigrane{\Huge CORRIG\'E --- CORRIG\'E}\global\modecorrige=1\global\corrigeseultrue\global\enoncefalse}
|
2018-10-13 18:38:18 +02:00
|
|
|
\newif\ifenonce
|
|
|
|
|
\enoncetrue
|
2018-02-21 19:12:43 +01:00
|
|
|
|
2019-02-24 14:23:28 +01:00
|
|
|
\RequirePackage{xstring}
|
2018-10-16 17:15:25 +02:00
|
|
|
\let\basejobname\jobname
|
|
|
|
|
\IfEndWith{\jobname}{\detokenize{-ENONCE}}{\let\corr\relax\let\corrseul\relax\StrCut{\jobname}{\detokenize{-ENONCE}}\basejobname\dummy}{}
|
|
|
|
|
\IfEndWith{\jobname}{\detokenize{-PROF}}{\corr\let\corr\relax\let\corrseul\relax\StrCut{\jobname}{\detokenize{-PROF}}\basejobname\dummy}{}
|
|
|
|
|
\IfEndWith{\jobname}{\detokenize{-CORRIGE}}{\corrseul\let\corr\relax\let\corrseul\relax\StrCut{\jobname}{\detokenize{-CORRIGE}}\basejobname\dummy}{}
|
2018-02-21 19:12:43 +01:00
|
|
|
|
|
|
|
|
\def\pasenonce{
|
|
|
|
|
\excludecomment{enonce}
|
|
|
|
|
\excludecomment{qcmrep}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
\def\avecenonce{\newenvironment{enonce}{}{}
|
2018-03-11 10:06:31 +01:00
|
|
|
\edef\@temp{\noexpand\newtheorem{question}{Question}\resetlevel}\@temp
|
2018-02-21 19:12:43 +01:00
|
|
|
\newtheorem{qcm}{QCM}
|
|
|
|
|
%
|
|
|
|
|
\NewDocumentEnvironment{qcmrep}{o}
|
|
|
|
|
{\IfValueT{##1}{\begingroup\setlength\columnseprule{0pt}\begin{multicols}{##1}}\begin{enumerate}\renewcommand\theenumi{\Alph{enumi}}}{\end{enumerate}\IfValueT{##1}{\end{multicols}\endgroup}}}
|
|
|
|
|
|
|
|
|
|
|
2018-10-16 22:24:42 +02:00
|
|
|
\def\setthe#1{\@ifnextchar[{\setthei{#1}}{}}
|
|
|
|
|
\def\setthei#1[#2]{%
|
|
|
|
|
\expandafter\let\expandafter\@temp\csname the#1\endcsname
|
|
|
|
|
\toks@\expandafter{\@temp}%
|
|
|
|
|
\expandafter\xdef\csname the#1\endcsname{\expandafter\noexpand\csname the#2\endcsname\@thmcountersep\the\toks@}}
|
2018-02-21 19:12:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\AtBeginDocument{%
|
2019-05-05 13:10:47 +02:00
|
|
|
\ifnum\modecorrige=2
|
2018-02-21 19:12:43 +01:00
|
|
|
\immediate\typeout{Mode professeur}
|
2018-10-15 22:35:00 +02:00
|
|
|
\subtitle{Corrigé}
|
2018-02-21 19:12:43 +01:00
|
|
|
\newenvironment{corrige}{\begin{mdframed}[backgroundcolor=gray!20, skipbelow=1ex]}{\end{mdframed}}
|
|
|
|
|
\newenvironment{comcorrige}{\begin{mdframed}[backgroundcolor=gray!20, skipbelow=1ex]}{\end{mdframed}}
|
|
|
|
|
\newenvironment{qcmcorr}{\begin{mdframed}[backgroundcolor=gray!20, skipbelow=1ex]}{\end{mdframed}}
|
|
|
|
|
\avecenonce
|
2019-05-05 13:10:47 +02:00
|
|
|
\else\ifnum\modecorrige=1
|
2018-10-13 18:38:18 +02:00
|
|
|
\immediate\typeout{Mode corrige}
|
|
|
|
|
%
|
2018-10-13 09:02:54 +02:00
|
|
|
\let\real@xwmlastpage\r@xwmlastpage % ne pas écraser ces labels depuis le fichier externe
|
|
|
|
|
\let\real@lastpage\r@lastpage
|
|
|
|
|
\let\r@xwmlastpage\relax
|
|
|
|
|
\let\r@lastpage\relax
|
2018-10-13 00:10:05 +02:00
|
|
|
\externaldocument{\basejobname-ENONCE}
|
2018-10-13 09:02:54 +02:00
|
|
|
\let\r@xwmlastpage\real@xwmlastpage
|
|
|
|
|
\let\r@lastpage\real@lastpage
|
2018-10-13 18:38:18 +02:00
|
|
|
%
|
2018-10-15 22:35:00 +02:00
|
|
|
\subtitle{Corrigé}
|
2018-02-21 19:12:43 +01:00
|
|
|
\pasenonce
|
2018-10-13 00:10:05 +02:00
|
|
|
\edef\@temp{\noexpand\newcounter{question}\resetlevel}\@temp
|
|
|
|
|
\specialcomment{question}{\refstepcounter{question}\begingroup\def\ProcessCutFile{}}{\endgroup}
|
|
|
|
|
\newtheorem{corrige}{Question}
|
2018-10-16 22:24:42 +02:00
|
|
|
\edef\@temp{\noexpand\setthe{question}\resetlevel}\@temp
|
2018-10-13 00:10:05 +02:00
|
|
|
\let\thecorrige\thequestion
|
2018-10-13 18:38:18 +02:00
|
|
|
%
|
|
|
|
|
\newcounter{qcm}
|
|
|
|
|
\specialcomment{qcm}{\refstepcounter{qcm}\begingroup\def\ProcessCutFile{}}{\endgroup}
|
2018-02-21 19:12:43 +01:00
|
|
|
\newtheorem{qcmcorr}{QCM}
|
2018-10-13 18:38:18 +02:00
|
|
|
\let\theqcmcorr\theqcm
|
2018-02-21 19:12:43 +01:00
|
|
|
\newenvironment{comcorrige}{}{}
|
2019-05-05 13:10:47 +02:00
|
|
|
\else\ifnum\modecorrige=3
|
|
|
|
|
\edef\@temp{\noexpand\newtheorem{corrige}{Question}\resetlevel}\@temp
|
|
|
|
|
\newenvironment{comcorrige}{}{}
|
2018-02-21 19:12:43 +01:00
|
|
|
\else
|
|
|
|
|
\immediate\typeout{Mode enonce}
|
|
|
|
|
\excludecomment{corrige}
|
|
|
|
|
\excludecomment{comcorrige}
|
|
|
|
|
\excludecomment{qcmcorr}
|
|
|
|
|
\avecenonce
|
2019-05-05 13:10:47 +02:00
|
|
|
\fi\fi\fi
|
2018-02-21 19:12:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
\DeclareInstance{xfrac}{cinqdemi}{text}{scale-factor=1, h-scale=1.25, slash-left-kern=-2.5pt, slash-right-kern=-2.25pt}
|
|
|
|
|
|
|
|
|
|
\def\cinqdemi{\sfrac[cinqdemi]{5}{2}}
|
|
|
|
|
|
|
|
|
|
\endinput
|