summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/annee-scolaire/annee-scolaire.sty
blob: 5feed8421622838f5cf6428f0c3805e518f679ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
%%
%% This is file `annee-scolaire.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% annee-scolaire.dtx  (with options: `package')
%% 
%% Do not distribute this file without also distributing the
%% source files specified above.
%% 
%% Do not distribute a modified version of this file.
%% 
%% File: annee-scolaire.dtx
%% Copyright (C) 2020 Yvon Henel aka Le TeXnicien de surface
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version.  The latest version
%% of this license is in the file
%%
%%    http://www.latex-project.org/lppl.txt
%%
\RequirePackage{expl3}[2013/03/12]
\GetIdInfo$Id: annee-scolaire.dtx 1.6 2020-07-29 TdS $
  {}
\ProvidesExplPackage
  {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\RequirePackage{xparse}
\RequirePackage{l3keys2e}
\keys_define:nn {annee-scolaire}
{
  premiermois .int_set:N = \c__AnneeScolaire_Premier_Mois_int,
  premiermois .initial:n = {8},
  premierjour .int_set:N = \c__AnneeScolaire_Premier_Jour_int,
  premierjour .initial:n = {1},
  decalage .int_set:N = \c__AnneeScolaire_Decalage_int,
  decalage .initial:n = {0},
  separateur  .tl_set:N  = \c__AnneeScolaire_Separe_Annees_tl,
  separateur  .initial:n = {-}
}
\ProcessKeysOptions { annee-scolaire }
\int_const:Nn \c__AnneeScolaire_Annee_Deb_int {
  \int_compare:nNnTF { 100*\the\month + \the\day } <
  { 100*\c__AnneeScolaire_Premier_Mois_int + \c__AnneeScolaire_Premier_Jour_int}
  {\year - 1 + \c__AnneeScolaire_Decalage_int}
  {\year + \c__AnneeScolaire_Decalage_int}
}
\int_const:Nn \c__AnneeScolaire_Annee_Fin_int {
  \c__AnneeScolaire_Annee_Deb_int + 1
}
\NewDocumentCommand \AnneeScolairePresentation { o m }
{
  \int_to_arabic:n { #2 }
}
\NewDocumentCommand \anneescolaire { O{0} }
{
  \AnneeScolairePresentation[1] {\c__AnneeScolaire_Annee_Deb_int + #1}
  \c__AnneeScolaire_Separe_Annees_tl
  \AnneeScolairePresentation[2] {\c__AnneeScolaire_Annee_Fin_int + #1}
}
\NewDocumentCommand \debutanneescolaire { O{0} }
  {
    \AnneeScolairePresentation[3] {\c__AnneeScolaire_Annee_Deb_int + #1}
  }
\NewDocumentCommand \finanneescolaire { O{0} }
  {
    \AnneeScolairePresentation[4] {\c__AnneeScolaire_Annee_Fin_int + #1}
  }
\endinput
%%
%% End of file `annee-scolaire.sty'.