summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/annee-scolaire/annee-scolaire-eng.tex
blob: 70870e7f4fa97da8e69e36fd4058cf9e91ee3862 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
%%
%% This is file `annee-scolaire-eng.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% annee-scolaire.dtx  (with options: `doc,ENG')
%% 
%% 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 $
  {}
\documentclass[full]{l3doc}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french,main=english]{babel}
\usepackage{xparse}
\usepackage[decalage=0]{annee-scolaire}
\newcommand\BOP{\discretionary{}{}{}}
\usepackage{xspace}
\usepackage{csquotes}
\usepackage{fancyvrb,fancyvrb-ex}
\begin{document}
\title{\pkg{annee-scolaire} user guide\thanks{This file describes
    version~\ExplFileVersion, last revised~\ExplFileDate. Special
    \emph{quarantine} edition.}}
\author{Yvon Henel\thanks{E-mail:
    \href{mailto:le.texnicien.de.surface@yvon-henel.fr}
    {le.texnicien.de.surface@yvon-henel.fr}}}
\maketitle
\noindent\hrulefill

\begin{abstract}
A macro \cs{anneescolaire} to automatically write academic year (French way)
according to the date of compilation day.
\end{abstract}

\noindent\hrulefill

 \begin{otherlanguage}{french}
\begin{abstract}
Une macro \cs{anneescolaire} pour écrire automatiquement l'année scolaire en
fonction de la date du jour de compilation.

La documentation française pour l'utilisateur de l'extension
\pkg{annee-scolaire} est disponible sous le nom de \texttt{annee-scolaire-fra}.
\end{abstract}
\end{otherlanguage}

\noindent\hrulefill
\vspace{\baselineskip}

\section{The Macros}
\label{sec:macros}

\pkg{annee-scolaire} offers three main document macros which produce
text in the final document and one macro which is used to determine the
presentation of the said text.

\subsection{Main Macros}
\label{sec:main}

This package has three main document macros viz.
\begin{function}{\anneescolaire}
  \begin{syntax}
    \cs{anneescolaire}\oarg{shift}
  \end{syntax}
  where \meta{shift} is an integer the default value of which is~\(0\). It is
  the number of years the academic year is shifted. The same optional argument
  with the same aim is available for the next two macros.
\end{function}

In French \foreignquote{french}{année scolaire} means \enquote{school year}.

\begin{function}{\debutanneescolaire}
  \begin{syntax}
    \cs{debutanneescolaire}\oarg{shift}
  \end{syntax}
\end{function}

In French \foreignquote{french}{début d'année scolaire} means \enquote{beginning
  of school year}.

\begin{function}{\finanneescolaire}
  \begin{syntax}
    \cs{finanneescolaire}\oarg{shift}
  \end{syntax}
\end{function}

In French \foreignquote{french}{fin d'année scolaire} means \enquote{end of
  school year}.

See examples on page~\pageref{sec:writingyear}.

\subsection{Presentation Macro}
\label{sec:look}

The presentation of the years as written by the three preceding commands may be
changed redefining the following macro:
\begin{function}{\AnneeScolairePresentation}
  \begin{syntax}
    \cs{AnneeScolairePresentation}\oarg{number}\marg{year}
  \end{syntax}
  where \meta{year} is a integer (a \LaTeX3 \texttt{\textit{int}}) which is the
  number of the year to be written in the document. The optional argument
  \meta{number} can be used to tailor the presentation according to the
  following scheme
  \begin{description}
  \item[\textbf{1}] presentation of the beginning year in the text created by the
    macro \cs{anneescolaire};
  \item[\textbf{2}] presentation of the ending year in the text created by the
    macro \cs{anneescolaire};
  \item[\textbf{3}] presentation of the year in the text created by the
    macro \cs{debutanneescolaire};
  \item[\textbf{4}]  presentation of the year in the text created by the
    macro \cs{finanneescolaire}.
  \end{description}

  By default, the macro is an alias of \cs{int_to_arabic:n}.
  %
  If you want to change the presentation, you have to redefine the command with
  \cs{RenewDocumentCommand}.
\end{function}

See examples on page \pageref{sec:changelook}.


\section{The Package Options}
\label{sec:keys}

The package uses the key-value options. There are four keys:
\texttt{premiermois} (\emph{first month}), \texttt{premierjour} (\emph{first
  day}), \texttt{decalage} (\emph{shift}) and \texttt{separateur}
(\emph{separator}).

\begin{description}
\item[\texttt{premiermois} (\textit{\texttt{int}})] is the number of the first
  month of the school year. It defaults to~\(8\).

\item[\texttt{premierjour} (\textit{\texttt{int}})] is the number of the first
  day of the first month of the school year. Its default value is~\(1\) so the
  school year begins, by default, on the first of August.

  \emph{Beware: no attempt is made in order to ensure the consistency of the
    chosen date --- you can chose the 32nd February if you dare. You have to
    take care of that by yourself.}

\item[\texttt{decalage} (\textit{\texttt{int}})] is an integer which defaults
  to~\(0\). It is used to shift the school year: passing the option
  \verb|decalage=1| to the package forces \cs{anneescolaire} to give the next
  school year.

\item[\texttt{separateur} (\textit{\texttt{token list}})] is the text used
  between the numbers of the two calendar years which the school year spans. Its
  default value is~\enquote{\texttt{-}}.
\end{description}


\section{Examples}
\label{sec:examples}

\subsection{Writing the School Year}
\label{sec:writingyear}

The text\\[0.5\baselineskip]
\enquote{Today is \today, academic year \anneescolaire, beginning
  in~\debutanneescolaire{} and ending in~\finanneescolaire.}\\[0.5\baselineskip]
is obtained with the code\\[0.5\baselineskip]
\texttt{Today is \cs{today}, academic year \cs{anneescolaire}, beginning
  in}\verb|~|\cs{debutannee}\BOP \texttt{sco}\BOP \texttt{laire}\verb|{}|
\texttt{and ending in\verb|~|\cs{finanneescolaire}.}

\medskip{}

What follows illustrates the use of the optional argument of the three document
commands.


\vspace{\baselineskip}

\framebox[0.85\textwidth]{\begin{minipage}{.65\linewidth}
\vspace*{.5\baselineskip}

 On
\today{}:

\vspace{.5\baselineskip}

\noindent{}
{\cs{anneescolaire[-1]}}: \anneescolaire[-1] \par\noindent{}
{\cs{debutanneescolaire[-1]}}: \debutanneescolaire[-1] \par\noindent{}
{\cs{finanneescolaire[-1]}}: \finanneescolaire[-1]

\vspace{.5\baselineskip}

\noindent{}
{\cs{anneescolaire}}: \anneescolaire \par\noindent{}
{\cs{debutanneescolaire}}: \debutanneescolaire \par\noindent{}
{\cs{finanneescolaire}}: \finanneescolaire

\vspace{.5\baselineskip}

\noindent{}
{\cs{anneescolaire[1]}}: \anneescolaire[1] \par\noindent{}
{\cs{debutanneescolaire[1]}}: \debutanneescolaire[1] \par\noindent{}
{\cs{finanneescolaire[1]}}: \finanneescolaire[1]

\vspace*{.5\baselineskip}
\end{minipage}}

\subsection{Changing the Look}
\label{sec:changelook}

With the following code:



\begin{Verbatim}[gobble=0, frame=lines, label={code}, labelposition=topline]
\ExplSyntaxOn
\RenewDocumentCommand{\AnneeScolairePresentation}{ o m }
{
  \int_case:nn { #1 }
  {
    {1} { \textbf{ \int_to_arabic:n { #2 } } }
    {2} { \int_to_roman:n { #2 } }
    {3} { \textit{ \int_to_arabic:n { #2 } } }
    {4} { \int_to_Roman:n { #2 } }
  }
}
\ExplSyntaxOff

\anneescolaire \quad \debutanneescolaire \quad \finanneescolaire
\end{Verbatim}

 We obtain:

\bgroup{}
\ExplSyntaxOn
\RenewDocumentCommand{\AnneeScolairePresentation}{ o m }
{
  \int_case:nn { #1 }
  {
    {1} { \textbf{ \int_to_arabic:n { #2 } } }
    {2} { \int_to_roman:n { #2 } }
    {3} { \textit{ \int_to_arabic:n { #2 } } }
    {4} { \int_to_Roman:n { #2 } }
  }
}
\ExplSyntaxOff

\anneescolaire \quad \debutanneescolaire \quad \finanneescolaire
\egroup{}

\medskip{}

It should be obvious to everyone that the preceding code is given as a mere
example of what we can do and certainly not as an example of what we \emph{have to}!

\vspace{\stretch{2}}

\noindent\hspace*{0.2\textwidth}\hrulefill\hspace*{0.2\textwidth}
\begin{center}
  \textsl{Le TeXnicien de Surface scripsit.}
\end{center}
\noindent\hspace*{0.2\textwidth}\hrulefill\hspace*{0.2\textwidth}

\vspace*{\stretch{2}}

\end{document}
\endinput
%%
%% End of file `annee-scolaire-eng.tex'.