Debian Codegraph @

texmf-dist/doc/latex/datenumber/datenumber-english.tex

raw
1 %%
2 %% This is file `docgerman.tex'.
3 %%
4 %% This file is part of the `datenumber' package,
5 %%
6 %% Copyright (C) 2001 J"org-Michael Schr"oder.
7 %%
8 %% IMPORTANT NOTICE:
9 %%
10 %% This program may be distributed and/or modified under the
11 %% conditions of the LaTeX Project Public License, either version 1.2
12 %% of this license or (at your option) any later version.
13 %% The latest version of this license is in
14 %% http://www.latex-project.org/lppl.txt
15 %% and version 1.2 or later is part of all distributions of LaTeX
16 %% version 1999/12/01 or later.
17 %%
18 %% This program consists of all files listed in README.txt.
19 %%
20 %% For error reports, or offers to help make this a more powerful
21 %% tool, please contact me on [email protected]
22 %%
23 %% 2022/01/27: Corrects small error in datenumberfrench.ldf und in datenumberspanish.ldf (F. P\'etiard)
24 %%
25
26 \documentclass[draft]{article}
27 \usepackage{datenumber}
28 \oddsidemargin 0.25in
29 \textwidth 5.8750 in
30 \addtolength{\textheight}{8\baselineskip}
31 \addtolength{\topmargin}{-5\baselineskip}
32
33 \title{The {\tt datenumber.sty} package \fileversion}
34
35 \author{J\"org-Michael Schr\"oder\\%{\small\texttt{[email protected]}}
36 }
37
38 \date{\filedate\footnote{The initial date was 2001/08/06 (version 0.02). That version corrects a small error in datenumberfrench.ldf and in datenumberspanish.ldf.}}
39
40 \newcounter{dateone}\newcounter{datetwo}%
41 \newcommand{\daydifftoday}[3]{%
42 \setmydatenumber{dateone}{\the\year}{\the\month}{\the\day}%
43 \setmydatenumber{datetwo}{#1}{#2}{#3}%
44 \addtocounter{datetwo}{-\thedateone}%
45 \thedatetwo
46 }
47
48 \newcommand{\sd}{%
49 \ifcase\thedatedayname \or
50 Mon\or Tue\or Wed\or Thu\or
51 Fri\or Sat\or Sun\fi
52 }%
53
54 \newcommand{\pnext}{%
55 \thedateyear/%
56 \ifnum\value{datemonth}<10 0\fi
57 \thedatemonth/%
58 \ifnum\value{dateday}<10 0\fi
59 \thedateday%
60 \nextdate
61 }
62
63 \begin{document}
64 \maketitle
65 \begin{abstract}
66
67 This package provides commands to convert a date into a number. Turned around a date can be calculated also by a number. Additionally there are commands for incrementing and decrementing a date. Leap years and the Gregorian calendar reform are considered.
68 \end{abstract}
69
70 \tableofcontents
71 \section{Start year}
72 The start of the counting is determined with \verb+\setstartyear{year}+ (standard 1800). The first day of the start year gets the number 1. The value of \texttt{startyear} must be greater 0. It may not be larger than the year of a date to be calculated. If the difference of date and \texttt{startyear} is large, the calculation can last for a long time. The correct setting of the weekdays is guaranteed only if the value of \texttt{startyear} is 1800, 1900 or 2000.
73 \section{Counters}
74 There are five counters defined
75 \begin{description}
76 \item[\texttt{datenumber}:] number of the day
77 \item[\texttt{dateyear}:] year
78 \item[\texttt{datemonth}:] month
79 \item[\texttt{dateday}:] day
80 \item[\texttt{datedayname}:] weekday: 1--7 (Monday--Sunday)
81 \end{description}
82 \section{Macros}
83 \subsection{Macros which operate with defined counters\label{macro}}
84 All counters specified above are updated by these macros. \verb+\datedayname+ and \verb+\datemonthname+ are also updated.
85 \begin{description}
86 \item[{\mdseries\textbackslash}\texttt{setdatenumber}\{\texttt{year}\}\{\texttt{month}\}\{\texttt{day}\}:] Sets the counter \texttt{datenumber} to a value, which corresponds to the date.
87 \item[{\mdseries\textbackslash}\texttt{setdatebynumber}\{\texttt{number}\}:] Sets the counters \texttt{dateyear}, \texttt{datemonth}, and \texttt{dateday} to values, which corresponds to the number.
88 \item[{\mdseries\textbackslash}\texttt{nextdate}:] Sets the counters \texttt{dateyear}, \texttt{datemonth}, and \texttt{dateday} to the next date.
89 \item[{\mdseries\textbackslash}\texttt{prevdate}:] Sets the counters \texttt{dateyear}, \texttt{datemonth}, and \texttt{dateday} to the previous date.
90 \item[{\mdseries\textbackslash}\texttt{setdate}\{\texttt{year}\}\{\texttt{month}\}\{\texttt{day}\}:] Sets the counters \texttt{dateyear}, \texttt{datemonth}, and \texttt{dateday} to \texttt{year}, \texttt{month}, and \texttt{day}.
91 \item[{\mdseries\textbackslash}\texttt{setdatetoday}:] Sets the counters \texttt{dateyear}, \texttt{datemonth}, and \texttt{dateday} to the current date.
92 \item[{\mdseries\textbackslash}\texttt{datemonthname}:] typesets the month (see section \ref{monthname}).
93 \item[{\mdseries\textbackslash}\texttt{datedayname}:] typesets the weekday (see section \ref{dayname}).
94 \item[{\mdseries\textbackslash}\texttt{datedate}:] typesets the date, corresponding to the counters \texttt{dateyear}, \texttt{datemonth}, \texttt{dateday}.
95 \end{description}
96 \subsection{Macros which operate with your own counters}
97 Only the counters you specified are updated by these macros. \verb+\datedayname+ and \verb+\datemonthname+ are not updated.
98 \begin{description}\sloppypar
99 \item[{\mdseries\textbackslash}\texttt{setmydatenumber}\{\texttt{numbercount}\}\{\texttt{year}\}\{\texttt{month}\}\{\texttt{day}\}:] Sets the counter \texttt{numbercount} to a value, which corresponds to the date.
100 \item[{\mdseries\textbackslash}\texttt{setmydatebynumber}\{\texttt{number}\}\{\texttt{yearcount}\}\{\texttt{monthcount}\}\{\texttt{daycount}\}:] Sets the counters\\ \texttt{yearcount}, \texttt{monthcount}, and \texttt{daycount} to values, which corresponds to the number.
101 \item[{\mdseries\textbackslash}\texttt{mynextdate}\{\texttt{yearcount}\}\{\texttt{monthcount}\}\{\texttt{daycount}\}:] Sets the counters \texttt{yearcount}, \texttt{monthcount}, and \texttt{daycount} to the next date.
102 \item[{\mdseries\textbackslash}\texttt{mynextdate}\{\texttt{yearcount}\}\{\texttt{monthcount}\}\{\texttt{daycount}\}:] Sets the counters \texttt{yearcount}, \texttt{monthcount}, and \texttt{daycount} to the previous date.
103 \end{description}
104
105 \subsection{Month\label{monthname}}
106 The command \verb+\datemonthname+ typesets the month. It is updated by macros described in section \ref{macro}. You can do this by your own saying \verb+\setmonthname{number}+.
107
108 \subsection{Weekday\label{dayname}}
109 To typeset the weekday say \verb+\datedayname+. This command is updated by macros described in section \ref{macro}.
110 You can do this by your own saying \verb+\setmonthname{number}+ (1 for Monday and 7 for Sunday). You can also write \verb+\setdaynamebynumber{number}+, were \verb+number+ is the number of a date. If \texttt{startyear} is set to 1800, 1900 or 2000 the calculation of the weekday will work.
111
112 \section{Language}\sloppypar
113 The language options \texttt{english}, \texttt{USenglish} (standard), \texttt{french}, \texttt{spanish}, \texttt{german}, and \texttt{ngerman} are supported. Say \verb+\dateselectlanguage{language}+ to select a language. For other languages: Create a file \texttt{datenumbermylanguage.ldf}. Copy the text from \texttt{datenumberdummy.ldf}. Replace every ``dummy'' with ``mylanguage'' and change the months and weekdays. Say \verb+\usepackage{datenumber}+ \verb+\input{datenumbermylanguage.ldf}+ in your document.
114
115 \section{Examples}
116 \begin{quote}
117 \begin{verbatim}
118 \setdate{2002}{1}{1}%
119 \thedatenumber
120 \end{verbatim}
121 \setdate{2002}{1}{1}%
122 Result: \thedatenumber
123 \end{quote}
124
125 \begin{quote}
126 \begin{verbatim}
127 \setdatetoday
128 \addtocounter{datenumber}{10}%
129 \setdatebynumber{\thedatenumber}%
130 In 10 days is \datedate
131 \end{verbatim}
132 \setdatetoday
133 \addtocounter{datenumber}{10}%
134 \setdatebynumber{\thedatenumber}%
135 Result: In 10 days is \datedate
136 \end{quote}
137
138 \begin{quote}
139 \begin{verbatim}
140 \newcounter{dateone}\newcounter{datetwo}%
141
142 \newcommand{\daydifftoday}[3]{%
143 \setmydatenumber{dateone}{\the\year}{\the\month}{\the\day}%
144 \setmydatenumber{datetwo}{#1}{#2}{#3}%
145 \addtocounter{datetwo}{-\thedateone}%
146 \thedatetwo
147 }
148
149 There is still \daydifftoday{\the\year}{12}{25} days to Christmas.
150 \end{verbatim}
151 Result: There is still \daydifftoday{\the\year}{12}{25} days to Christmas.
152 \end{quote}
153
154 \clearpage
155 \begin{quote}
156 \begin{verbatim}
157 \newcommand{\sd}{%
158 \ifcase\thedatedayname \or
159 Mon\or Tue\or Wed\or Thu\or
160 Fri\or Sat\or Sun\fi
161 }%
162
163 \newcommand{\pnext}{%
164 \thedateyear/%
165 \ifnum\value{datemonth}<10 0\fi
166 \thedatemonth/%
167 \ifnum\value{dateday}<10 0\fi
168 \thedateday%
169 \nextdate
170 }
171
172 \setdate{2001}{9}{29}%
173 \[\begin{tabular}{lll}
174 \sd & \pnext & Abc\\
175 \sd & \pnext & Def\\
176 \sd & \pnext & Ghi\\
177 \sd & \pnext & Jkl\\
178 \end{tabular}\]
179 \end{verbatim}
180 Result: \setdate{2001}{9}{29}%
181 \[\begin{tabular}{lll}
182 \sd & \pnext & Abc\\
183 \sd & \pnext & Def\\
184 \sd & \pnext & Ghi\\
185 \sd & \pnext & Jkl\\
186 \end{tabular}\]
187 \end{quote}
188
189 \section{Other}
190 \begin{itemize}
191 \item leap year test
192 \begin{quote}
193 \begin{verbatim}
194 The \the\year\ is
195 \ifleapyear{\the\year} a \else no \fi leap year.
196 \end{verbatim}
197 Result: The \the\year\ is \ifleapyear{\the\year} a \else no \fi leap year.
198 \end{quote}
199 \item date test
200 \begin{quote}
201 \begin{verbatim}
202 The 29.2.1900 is
203 \ifvaliddate{1900}{2}{29} a \else no \fi valid date.
204 \end{verbatim}
205 Result: The 29.2.1900 is \ifvaliddate{1900}{2}{29} a \else no \fi valid date.%
206 \footnote{There are programs, which have another opinion about that. Search for ''Gregorian calendar'' in order to get more information about leap years and October 5, 1582}
207 \end{quote}
208 \end{itemize}
209
210 \end{document}
211 \endinput
212 %%
213 %% End of file `doc.tex'.