From 3025f471c934b5edb1832ecb408b08d41e4c347b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 3 Oct 2014 21:01:41 +0000 Subject: yathesis git-svn-id: svn://tug.org/texlive/trunk@35306 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/yathesis/yathesis.cls | 205 +++++++++------------- 1 file changed, 81 insertions(+), 124 deletions(-) (limited to 'Master/texmf-dist/tex/latex/yathesis') diff --git a/Master/texmf-dist/tex/latex/yathesis/yathesis.cls b/Master/texmf-dist/tex/latex/yathesis/yathesis.cls index 441fb009aaf..5c7427e1a90 100644 --- a/Master/texmf-dist/tex/latex/yathesis/yathesis.cls +++ b/Master/texmf-dist/tex/latex/yathesis/yathesis.cls @@ -11,8 +11,8 @@ %% Released under the LaTeX Project Public License v1.3c or later %% See http://www.latex-project.org/lppl.txt %% ----------------------------------------------------------------------- -\def\fileversion{v0.99j} -\def\filedate{2014/07/17} +\def\fileversion{v0.99k} +\def\filedate{2014/10/01} \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{yathesis}[\filedate\space\fileversion\space Yet another class for writing thesis (DB)] \RequirePackage{pgfopts}[2011/06/02]% @@ -75,7 +75,6 @@ \newsavebox{\YAD@abstract@secondarylanguage}% \newcounter{YAD@abstracts}% \newcounter{YAD@warnings}% -\newcounter{datetoday} \setcounter{YAD@abstracts}{0}% \setcounter{YAD@warnings}{0}% \def\YAD@mainlanguage{french}% @@ -347,8 +346,7 @@ titlesec/.code={\PassOptionsToPackage{#1}{titlesec}},% draftwatermark/.code={\PassOptionsToPackage{#1}{draftwatermark}},% babel/.code={\PassOptionsToPackage{#1}{babel}},% - datetime/.code={\PassOptionsToPackage{#1}{datetime}},% - bookmark/.code={\PassOptionsToPackage{#1}{bookmark}},% + datetime/.code={\PassOptionsToPackage{#1}{datetime}}% }% \yadsetup{% .unknown/.code ={\expandafter\PassOptionsToClass\expandafter{\pgfkeyscurrentname}{book}}% @@ -378,6 +376,7 @@ \RequirePackage{textcase}[2004/10/07]% \RequirePackage{translator}[2010/06/12]% \RequirePackage{fixltx2e}[2006/09/13]% +\RequirePackage{iftex}[2013/04/04]% \RequirePackage{epigraph}[2009/09/02]% \RequirePackage{tcolorbox}[2014/03/31]% \RequirePackage{marvosym}[2011/07/20]% @@ -406,33 +405,6 @@ }% \RequirePackage{babel}[2014/03/24] \RequirePackage{iflang}[2007/11/11]% -\let\@modulo@SAVED\@modulo -\RequirePackage{datenumber}[2001/08/06]% -\let\DATENUMBER@modulo\@modulo -\def\setdaynamebynumber#1{% - \@tempcnta=#1\relax - \ifnum\the@startyear=1800\advance \@tempcnta by 1\fi - \ifnum\the@startyear=1900\advance \@tempcnta by 6\fi - \ifnum\the@startyear=2000\advance \@tempcnta by 4\fi - \DATENUMBER@modulo{\the\@tempcnta}{7}% - \setcounter{datedayname}{\the\@den}% - \addtocounter{datedayname}{1}% - \setdayname{\thedatedayname}% -} -\def\ifleapyear#1{%#1 year - \ifnum#1>1500 - \DATENUMBER@modulo{#1}{100}% - \ifnum\@den=0 - \DATENUMBER@modulo{#1}{400}% - \else - \DATENUMBER@modulo{#1}{4}% - \fi - \else - \DATENUMBER@modulo{#1}{4}% - \fi - \ifnum\@den=0 -} -\let\@modulo\@modulo@SAVED \RequirePackage{datetime}[2013/09/10]% \AtEndPreamble{% \@ifpackageloaded{hyperref}{% @@ -552,7 +524,6 @@ }% {\if@restonecol\twocolumn \else \newpage \fi }% -\patchcmd{\chapter}{plain}{empty}{}{}% \newcommand*{\YAD@configuration@directory}{configuration} \newcommand*{\YAD@configuration@file}{thesis.cfg} \newcommand*{\YAD@characteristics@file}{characteristics.tex} @@ -1640,23 +1611,26 @@ }% }% }% -\setmydatenumber{datetoday}{\the\year}{\the\month}{\the\day} -\csdef{date}#1#2#3{% +\csdef{YAD@checkdate}#1#2#3#4#5{% + \boolfalse{YAD@valid@day}% + \boolfalse{YAD@valid@month}% + \boolfalse{YAD@valid@year}% + % \csxdef{YAD@daydate}{#1}% \csxdef{YAD@monthdate}{#2}% \csxdef{YAD@yeardate}{#3}% - \ifboolexpr{% - bool {YAD@submitted@work}% - or bool {YAD@submitted@work@star}% - }{% - }{% + % \ifboolexpr{% + % bool {YAD@submitted@work}% + % or bool {YAD@submitted@work@star}% + % }{% + % }{% \ifboolexpr{% not (test {\IfInteger{\YAD@daydate}})% }{% \YAD@ClassError[nodate]{% - Jour de la date de soutenance non valide% + Jour de la date de #5 non valide% }{% - La commande \protect\date{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}\space\MessageBreak% + La commande \string#4{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}\space\MessageBreak% n'a pas ete correctement saisie car le\MessageBreak% jour (`\YAD@daydate') n'est pas valide :\MessageBreak% ce doit etre un nombre entier entre 1 et 31.% @@ -1671,15 +1645,15 @@ or test {\ifnumgreater{\YAD@daydate}{31}}% }{% \YAD@ClassError[nodate]{% - Jour de la date de soutenance non valide% + Jour de la date de #5 non valide% }{% - La commande \protect\date{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}\space\MessageBreak% + La commande \string#4{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}\space\MessageBreak% n'a pas ete correctement saisie car le\MessageBreak% numero de jour (`\YAD@daydate') n'est pas valide :\MessageBreak% ce doit etre un nombre entier entre 1 et 31.% }% }{% - \booltrue{YAD@valid@day}% + \global\booltrue{YAD@valid@day}% }% }% % month @@ -1687,9 +1661,9 @@ not (test {\IfInteger{\YAD@monthdate}})% }{% \YAD@ClassError[nodate]{% - Mois de la date de soutenance non valide% + Mois de la date de #5 non valide% }{% - La commande \protect\date{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}\space\MessageBreak% + La commande \string#4{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}\space\MessageBreak% n'a pas ete correctement saisie car le\MessageBreak% mois (`\YAD@monthdate') n'est pas valide :\MessageBreak% ce doit etre un nombre entier entre\MessageBreak% @@ -1705,16 +1679,16 @@ or test {\ifnumgreater{\YAD@monthdate}{12}}% }{% \YAD@ClassError[nodate]{% - Mois de la date de soutenance non valide% + Mois de la date de #5 non valide% }{% - La commande \protect\date{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}\space\MessageBreak% + La commande \string#4{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}\space\MessageBreak% n'a pas ete correctement saisie car le\MessageBreak% numero de mois (`\YAD@monthdate') n'est pas valide :\MessageBreak% ce doit etre un nombre entier entre\MessageBreak% 1 (janvier) et 12 (decembre).% }% }{% - \booltrue{YAD@valid@month}% + \global\booltrue{YAD@valid@month}% }% }% % year @@ -1722,64 +1696,49 @@ not (test {\IfInteger{\YAD@yeardate}})% }{% \YAD@ClassError[nodate]{% - Annee de la date de soutenance non valide% + Annee de la date de #5 non valide% }{% - La commande - \protect\date{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}\space\MessageBreak% + La commande \string#4{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}\space\MessageBreak% n'a pas ete correctement saisie car l'annee\MessageBreak% (`\YAD@yeardate') n'est pas valide : ce doit etre\MessageBreak% un nombre entier.% }% }{% - % \IfDecimal{\YAD@yeardate}{% - % \csxdef{YAD@yeardate}{\number\integerpart}% - % }{% - % }% - % \ifnumless{\YAD@yeardate}{\number\year}{% - % \YAD@ClassError[nodate]{% - % Annee de la date de soutenance non valide% - % }{% - % La commande \protect\date{#1}{#2}{#3}\space\MessageBreak% - % n'a pas ete correctement saisie car le numero de\MessageBreak% - % l'annee (`#3') n'est pas valide : ce doit etre\MessageBreak% - % un nombre entier (superieur ou egal a \number\year).% - % }% - % }{% - \booltrue{YAD@valid@year}% - % }% + \global\booltrue{YAD@valid@year}% }% - \ifboolexpr{% + % }% +}% +\csdef{date}#1#2#3{% + \YAD@checkdate{#1}{#2}{#3}{\date}{soutenance}% + \ifboolexpr{% bool {YAD@valid@day}% and bool {YAD@valid@month}% and bool {YAD@valid@year}% }{% \csdef{printdate}{% - % \setdatenumber{\YAD@yeardate}{\YAD@monthdate}{\YAD@daydate}% - % \ifnumgreater{\value{datetoday}}{\value{datenumber}}{% - % \YAD@generic@argument@translate{date}% - % \YAD@ClassError[nodate]{% - % Date de soutenance non valide% - % }{% - % La date saisie - % (`\protect\date{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}') n'est - % pas\MessageBreak% - % correcte car elle ne doit pas etre anterieure\MessageBreak% - % a la date du jour - % (\protect\date{\number\day}{\number\month}{\number\year}).% - % }% - % }{% \formatdate{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}% - % }% }% }{% \csdef{printdate}{% \YAD@generic@argument@translate{date}% }% }% - \boolfalse{YAD@valid@day}% - \boolfalse{YAD@valid@month}% - \boolfalse{YAD@valid@year}% - }% +}% +\csdef{submissiondate}#1#2#3{% + \YAD@checkdate{#1}{#2}{#3}{\submissiondate}{soumission}% + \ifboolexpr{% + bool {YAD@valid@day}% + and bool {YAD@valid@month}% + and bool {YAD@valid@year}% + }{% + \csdef{printsubmissiondate}{% + \formatdate{\YAD@daydate}{\YAD@monthdate}{\YAD@yeardate}% + }% + }{% + \csdef{printsubmissiondate}{% + \YAD@generic@argument@translate{submissiondate}% + }% + }% }% \AtEndDocument{% \YAD@ifemptyorundef{\printdate}{% @@ -1823,14 +1782,6 @@ }{% }% }% -\let\YAD@ORI@cleardoublepage\cleardoublepage -\newcommand*{\YAD@clearemptydoublepage}{% - \clearpage% - {% - \pagestyle{empty}% - \YAD@ORI@cleardoublepage% - }% -}% \ifboolexpr{% bool {YAD@inprogress@work}% or bool {YAD@inprogress@work@star}% @@ -1840,12 +1791,14 @@ \setfoot{}{\textsc{\translate{lbl-inprogressfoottext} \today}}{}% }% }{% - \ifboolexpr{% - bool {YAD@submitted@work@star}% - }{% + \ifbool{YAD@submitted@work@star}{% \newcommand*{\YAD@setfoot}{% \footrule% - \setfoot{}{\textsc{\translate{lbl-submittedfoottext} \today}}{}% + \YAD@ifemptyorundef{\printsubmissiondate}{% + \setfoot{}{\textsc{\translate{lbl-submittedfoottext} \today}}{}% + }{% + \setfoot{}{\textsc{\translate{lbl-submittedfoottext} \printsubmissiondate}}{}% + }% }% }{% \newcommand*{\YAD@setfoot}{}% @@ -1873,7 +1826,7 @@ \@startshorttoc{toc}\if@restonecol\twocolumn\fi\egroup} \renewcommand{\tableofcontents}{% \booltrue{YAD@tableofcontents@used}% - \YAD@clearemptydoublepage% + \cleardoublepage% \YAD@phantomsection% \let\cmdKV@YAD@name\contentsname% \@ifnextchar[{\tableofcontents@YAD@with@argument}{\tableofcontents@YAD@without@argument}%] @@ -2169,7 +2122,7 @@ {}% {\thepage}% \headrule% - \YAD@clearemptydoublepage% + \cleardoublepage% \YAD@phantomsection% \YAD@bookmarksetup{startatroot}% \YAD@setfoot% @@ -2200,7 +2153,7 @@ \pagestyle{backmatter}% }{}{}% \newpagestyle{contents}[]{% - \YAD@clearemptydoublepage% + \cleardoublepage% \YAD@phantomsection% \YAD@bookmarksetup{startatroot}% \singlespacing% @@ -2215,7 +2168,7 @@ \YAD@setfoot% }% \newpagestyle{glossaire}[]{% - \YAD@clearemptydoublepage% + \cleardoublepage% \YAD@phantomsection% \YAD@bookmarksetup{startatroot}% \singlespacing% @@ -2239,7 +2192,7 @@ {\thepage}% \headrule% \setsecnumdepth{none}% - \YAD@clearemptydoublepage% + \cleardoublepage% \YAD@phantomsection% \setsecnumdepth{\YAD@secnumdepth}% \YAD@bookmarksetup{startatroot}% @@ -2309,11 +2262,6 @@ \YAD@reach@file{#1}% }% }% -\let\origtcb@shadow@prepare=\tcb@shadow@prepare% -\def\tcb@shadow@prepare#1#2{% - \origtcb@shadow@prepare{#1}{#2}% - \let\tcb@shadow@arc=\tcb@zpt% -}% \renewcommand{\maketitle}[1][]{% \booltrue{YAD@maketitle@used}% \yadsetup{#1} @@ -2731,7 +2679,7 @@ \@ifstar{\@tempswatrue\csuse{YAD@starnostar@makekeywords}}{\@tempswafalse\csuse{YAD@starnostar@makekeywords}}% }% \csdef{YAD@starnostar@makekeywords}{% - \YAD@clearemptydoublepage% + \cleardoublepage% \pagestyle{prepreliminary}% % \YAD@astuce@expressioncle% \if@tempswa% @@ -2850,7 +2798,7 @@ \@ifstar{\@tempswatrue\csuse{YAD@starnostar@makelaboratory}}{\@tempswafalse\csuse{YAD@starnostar@makelaboratory}}% }% \csdef{YAD@starnostar@makelaboratory}{% - \YAD@clearemptydoublepage% + \cleardoublepage% \pagestyle{prepreliminary}% \if@tempswa% \else% @@ -3018,8 +2966,8 @@ }% \csgdef{YAD@abstractname@mainlanguage}{\abstractname}% \csgdef{YAD@abstractname@secondarylanguage}{\abstractname}% -\newcommand{\YAD@absract}[1]{% - \ifthenelse{\isempty{#1}}{ +\newcommand{\YAD@abstract}[1]{% + \ifstrempty{#1}{% \ifnumcomp{\value{YAD@abstracts}}{>}{0}{% \global\booltrue{YAD@second@abstract@empty}% }{% @@ -3043,7 +2991,7 @@ \csgdef{YAD@abstractname@mainlanguage}{#1}% \lrbox{\YAD@abstract@mainlanguage}% }% - \Collect@Body\YAD@absract% + \Collect@Body\YAD@abstract% }{% \endlrbox% \stepcounter{YAD@abstracts}% @@ -3198,11 +3146,11 @@ ][]{% \YAD@laboratory@abstract@page% }{}{}% - \YAD@clearemptydoublepage% + \cleardoublepage% \renewcommand{\YAD@chapter@header}{\abstractname}% \renewcommand{\YAD@section@header}{\abstractname}% \YAD@abstract@page% - \YAD@clearemptydoublepage% + \cleardoublepage% \egroup% \YAD@nolaboratorytrue% \YAD@nolaboratoryadresstrue% @@ -3267,7 +3215,7 @@ }% \newcommand{\makebackcover}{% \YAD@alarm@noabstract% - \YAD@clearemptydoublepage% + \cleardoublepage% \pagestyle{backcover}% \YAD@abstract@page% }% @@ -3276,7 +3224,7 @@ }% \csdef{YAD@starnostar@makededications}{% \pagestyle{prepreliminary}% - \YAD@clearemptydoublepage% + \cleardoublepage% \if@tempswa% \else% \vspace*{\stretch{2}}% @@ -3330,7 +3278,7 @@ }% \csdef{YAD@starnostar@makefrontepigraphs}{% \patchcmd{\epigraphs}{\qitemlabel}{\qitemlabel\itemsep=1.5\baselineskip}{}{}% - \YAD@clearemptydoublepage% + \cleardoublepage% \if@tempswa% \else% \vspace*{\stretch{2}}% @@ -3396,7 +3344,7 @@ }% \newenvironment{epigraphspage}{% \patchcmd{\epigraphs}{\qitemlabel}{\qitemlabel\itemsep=1.5\baselineskip}{}{} - \YAD@clearemptydoublepage% + \cleardoublepage% \vspace*{\stretch{1}}% }{% \vspace*{\stretch{1}}% @@ -3410,7 +3358,7 @@ \let\YAD@ORI@chapter\chapter% \AfterPreamble{% delay the redefinition when titlesec has done its own \renewcommand\chapter{% - \YAD@clearemptydoublepage% + \cleardoublepage% \YAD@phantomsection% \ifbool{YAD@output@paper}{% }{% @@ -3618,7 +3566,9 @@ }% }% \AtEndPreamble{% + \ifPDFTeX \shorthandon{;:!?}% + \fi \InputIfFileExists{\YAD@configuration@directory/\YAD@configuration@file}% {\ClassInfo{yathesis}{% Fichier de configuration local \YAD@configuration@file\space @@ -3630,10 +3580,14 @@ % \YAD@configuration@file\space introuvable% % }% }% + \ifPDFTeX \shorthandoff{;:!?}% + \fi }% \AtEndPreamble{% + \ifPDFTeX \shorthandon{;:!?}% + \fi \InputIfFileExists{\YAD@configuration@directory/\YAD@characteristics@file}% {% \ClassInfo{yathesis}{% @@ -3649,7 +3603,9 @@ % \YAD@characteristics@file\space peut faciliter l'usage\MessageBreak de la classe% % }% }% + \ifPDFTeX \shorthandoff{;:!?}% + \fi }% \AtEndDocument{% \ifbool{YAD@tableofcontents@used}{% @@ -3674,7 +3630,8 @@ \expression{meta-laboratory}{nom du laboratoire}{nom du laboratoire} \expression{meta-logolaboratory}{logo du laboratoire}{logo du laboratoire} \expression{meta-author}{pr\'enom et nom de l'auteur}{pr\'enom et nom de l'auteur} -\expression{meta-date}{date de la soutenance}{date de la soutenance} +\expression{meta-date}{date de la soutenance}{defense date} +\expression{meta-submissiondate}{date de la soumission}{submission date} \expression{meta-academicfield}{discipline}{academic field} \expression{meta-speciality}{sp\'ecialit\'e}{speciality} \expression{meta-title}{titre du m\'emoire de th\`ese}{thesis title} -- cgit v1.2.3