From 5e372abd97dc1e1272c4b27ff1012882562381fb Mon Sep 17 00:00:00 2001 From: Yann Salmon Date: Sat, 13 Oct 2018 00:10:05 +0200 Subject: [PATCH] =?UTF-8?q?plus=20besoin=20de=20skipcorrige=20+=20r=C3=A9f?= =?UTF-8?q?=C3=A9rences=20=C3=A0=20l'=C3=A9nonc=C3=A9=20dans=20le=20corrig?= =?UTF-8?q?=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- latex/inputTD.tex | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/latex/inputTD.tex b/latex/inputTD.tex index a4ebc6a..e80b84e 100644 --- a/latex/inputTD.tex +++ b/latex/inputTD.tex @@ -19,6 +19,7 @@ \usepackage{xfrac} \usepackage{xparse} \usepackage{comment} +\usepackage{xr} \newif\ifcorrige \def\corr{\filigrane{\Huge CORRIG\'E --- CORRIG\'E}\global\corrigetrue} @@ -29,9 +30,9 @@ \IfEndWith{\jobname}{\detokenize{-ENONCE}}{\let\corr\relax\let\corrseul\relax}{} \IfEndWith{\jobname}{\detokenize{-PROF}}{\corr\let\corr\relax\let\corrseul\relax}{} \IfEndWith{\jobname}{\detokenize{-CORRIGE}}{\corrseul\let\corr\relax\let\corrseul\relax}{} +\StrCut{\jobname}{\detokenize{-}}\basejobname\dummy \def\pasenonce{ - \excludecomment{question} \excludecomment{enonce} \excludecomment{qcmrep} \excludecomment{qcm} @@ -39,7 +40,6 @@ \def\avecenonce{\newenvironment{enonce}{}{} \edef\@temp{\noexpand\newtheorem{question}{Question}\resetlevel}\@temp - \def\skipcorrige{} \newtheorem{qcm}{QCM} % \NewDocumentEnvironment{qcmrep}{o} @@ -58,13 +58,17 @@ \newenvironment{qcmcorr}{\begin{mdframed}[backgroundcolor=gray!20, skipbelow=1ex]}{\end{mdframed}} \avecenonce \else\ifcorrigeseul + \externaldocument{\basejobname-ENONCE} \immediate\typeout{Mode corrige} \makeatletter\IfStrEq{\@subtitle}{}{}{\subtitle{Corrigé}}\makeatother \pasenonce - \edef\@temp{\noexpand\newtheorem{corrige}{Question}\resetlevel}\@temp + \edef\@temp{\noexpand\newcounter{question}\resetlevel}\@temp + \specialcomment{question}{\refstepcounter{question}\begingroup\def\ProcessCutFile{}}{\endgroup} + \newtheorem{corrige}{Question} + \def\thequestion{\thesection.\arabic{question}} %% hack moche à améliorer + \let\thecorrige\thequestion \newtheorem{qcmcorr}{QCM} \newenvironment{comcorrige}{}{} - \def\skipcorrige{\stepcounter{corrige}} \else \immediate\typeout{Mode enonce} \excludecomment{corrige}