\documentclass{article}

\usepackage[a4paper, margin=2cm]{geometry}
\usepackage{multirow}
\usepackage[colorlinks=true, urlcolor=blue, linkcolor=black]{hyperref}

\usepackage{easter}

\setlength\parskip{0.7\baselineskip}

\title{\texttt{easter} package\\\Large Version 2.0}
\author{Florian Tasso\thanks{e-mail: florian dot tasso at gmail dot com}}

\begin{document}
	\maketitle

	\begin{abstract}
		This package provides commands to compute the date of Easter, Ascension and Pentecost, according to Gregorian and Julian \emph{computus}, implementing the Meeus algorithms. It also provides commands to translate dates between Gregorian and Julian calendars.
	\end{abstract}

	\section{Commands definition}
		The main commands of this package are \verb|\EasterGregorian| and \verb|\EasterJulian|, which compute Easter, Ascension and Pentecost dates with respect to the specified \emph{computus}.

		By default, the feasts' dates are computed for compilation-time year (value stored in \verb|\year|). These commands can also receive an optional argument to select another year, provided it is valid (see section \ref{sec:calendar}). Resulting dates are stored in three counters each (\texttt{XXXYear}, \texttt{XXXMonth} and \texttt{XXXDay}, where \texttt{XXX} stands for \texttt{Easter}, \texttt{Ascension} or \texttt{Pentecost}).

		In their original form, these commands end printing Easter's date, in \texttt{YYYY-MM-DD} format. However, they also have a starred variant which cancels printing: dates can thus be computed at a moment and reused anytime later in the document. Any date may be recalled and printed by the command \verb|\printDate{feast}|, taking the feast's name as a mandatory argument. For instance, using \verb|\EasterGregorian*| followed by \verb|\printDate{Easter}| is equivalent to call \verb|\EasterGregorian|. Date printing format may be customized manually using the aforementioned counters or thanks to other packages, such as \href{https://ctan.org/pkg/datetime2}{\texttt{datetime2}}.

		A shortcut command, \verb|\Easter|, is also provided, but requires a \emph{computus} to have been previously selected (see section \ref{sec:options}). It has the same interface (default year and starred variant) as above. Further commands are finally defined to convert dates between calendars: see section \ref{sec:calendar}.

	\section{Examples}
		Dates in the following table are computed by the previous commands. They can be compared with \url{https://olravet.fr/AideCalendes/ortho.htm#ancre38020} or \url{https://fr.wikipedia.org/wiki/Calcul_de_la_date_de_P\%C3\%A2ques}:

		\def\tableLine#1{%
			#1 & \EasterGregorian[#1] & \toJulian{\theEasterYear}{\theEasterMonth}{\theEasterDay}\printDate{Transposed} & \EasterJulian[#1] & \toGregorian{\theEasterYear}{\theEasterMonth}{\theEasterDay}\printDate{Transposed} \\\hline}

		\begin{center}\begin{tabular}{|c|c|c|c|c|}
			\hline
			\multirow{2}{*}{\textbf{Year}} & \multicolumn{2}{c|}{\textbf{Gregorian Easter}} & \multicolumn{2}{c|}{\textbf{Julian Easter}} \\\cline{2-5}
			& \textit{\small Gregorian Calendar} & \textit{\small Julian Calendar} & \textit{\small Julian Calendar} & \textit{\small Gregorian Calendar} \\\hline\hline
			\tableLine{\the\year}
			\global\advance\year by -1\relax
			\tableLine{\the\year}\hline
			\global\advance\year by 1\relax
			\tableLine{2012}
			\tableLine{2011}\hline
			\tableLine{2034}
			\tableLine{2035}
		\end{tabular}\end{center}

		The next command will silently compute the Gregorian date of Easter in 2003: \verb|\EasterGregorian*[2003]|\EasterGregorian*[2003]. Result is now displayed by \verb|\printDate{Easter}|: \printDate{Easter}. And for Ascension, \verb|\printDate{Ascension}|: \printDate{Ascension}.

		Let us now compute the Julian date of Easter for the current year (\the\year): \verb|\EasterJulian*|\EasterJulian*. The result can then be displayed in \texttt{DD/MM/YYYY} format with \verb|\theEasterDay/\theEasterMonth/\theEasterYear|: \theEasterDay/\theEasterMonth/\theEasterYear\footnote{Actually, displaying a counter's value using \texttt{\textbackslash theCOUNTERNAME} does not print leading 0. To do so, one may use the \LaTeX\ macro \texttt{\textbackslash two@digits} or implement an \emph{ad hoc} function.}. The corresponding date for Pentecost is \verb|\printDate{Pentecost}|: \printDate{Pentecost}.

	\section{Technical Details Regarding Calendars}\label{sec:calendar}
		When dealing with Easter date, one should make distinction between \emph{calendar} and \emph{computus}. The former is about how to name days and group them by months and years: it is the basement of the concept of \emph{date}, which does not make any sense without it. It also defines leap years rules. The later defines how to compute moveable feasts (hence its name), which are based on Easter, depending in turn on the beginning of Spring and Moon phases. These feasts are an important part of Christian religion.

		This package allows to compute moveable feasts for both Julian and Gregorian \emph{computus}, and consequently relies on both \emph{calendars}. We refer here to \emph{old} Julian calendar and \emph{computus}: although many Orthodox Churches (but not all) did adopt the new Julian calendar, the new Julian \emph{computus} seems to be almost not used, in favor of the old one.
		
		Dates for a given \emph{computus} are naturally expressed in the corresponding calendar, but they can be further translated to the other one. It is especially useful to express Orthodox feasts (defined by the Julian \emph{computus}) in Gregorian calendar (more broadly used than Julian one). The opposite operation (expressing Catholic feasts, defined by Gregorian \emph{computus}, in Julian calendar) is also possible, although of a more specific interest.

		The difference between Julian and Gregorian calendar is due to discrepancies in Tropical year's approximation, which is about 365.24219 days long. Every four years, Julian calendar add a so called ``leap year'', lasting 366 days by inserting a 29\textsuperscript{th} day in February, to resynchronize calendar and solar year. The mean duration of Julian year is thus 365.25 days, which is better than 365 days, but still a bit long. Julian calendar is therefore slowly sliding after solar year. During the 16\textsuperscript{th} Century, the gap was of ten days. The Gregorian calendar was then introduced to compensate this gap and reduce sliding rate, by removing three leap years every four centuries. This calendar's year is then 365.2425 days long. If it is still not perfect, it is at least more accurate than old Julian calendar. The revised Julian calendar is even more accurate with a mean year of about 365.24222 days, but it will not be discussed here.

		The gap between (old) Julian and Gregorian calendars for a given year can be easily computed. The package offers the command \verb|\calendarOffset| for this purpose: it takes the desired year as an optional argument (or by default the compilation-time year), and set the counter \texttt{calendaroffset} to the right value. For instance, when this document was compiled (in \the\year), Gregorian calendar was \calendarOffset\thecalendaroffset\ days before Julian one.

		Based on this offset, one can define commands to ``translate'' a date from one calendar to the other. It is the purpose of \verb|\toGregorian{year}{month}{day}| and \verb|\toJulian{year}{month}{day}|, which set the counters \texttt{TransposedYear}, \texttt{TransposedMonth} and \texttt{TransposedDay} to the correct values. The resulting date may then be printed using \verb|\printDate{Transposed}|, or by manipulating counters directly.

	\section{Package Options}\label{sec:options}
		This package supports two options: \texttt{gregorian} and \texttt{julian}. Their effect is to define \verb|\Easter| as an alias for the specified \emph{computus}.

		\emph{Computus} can also be selected manually with \verb|\selectComputus| command. It takes one mandatory argument, \texttt{julian} or \texttt{gregorian}, and set \verb|\Easter| accordingly. Actually, it is how options are handled.

		Note that this alias is \emph{not} defined if the package is loaded without option, or more generally before the previous command is invoked. This behaviour is intended to remain \emph{computus}-agnostic, event though Gregorian calendar is the most widespread.

	\section{Implementation Notes}
		Computations are made following the Meeus algorithms\footnote{See \url{https://fr.wikipedia.org/wiki/Calcul_de_la_date_de_P\%C3\%A2ques_selon_la_m\%C3\%A9thode_de_Meeus}.}: Butcher-Meeus for Gregorian \emph{computus}, and Delambre-Meeus for Julian \emph{computus}. These algorithms are implemented using \TeX\ counters arithmetic, thus optimising compilation time and reducing package dependencies.

		Offset between Julian and Gregorian calendars is also computed using \TeX\ counters, based on the difference of how both define leap years and on the initial offset of 10 days in October 1582.

		Date of Ascension is computed by adding 39 days to Easter, and for Pentecost by adding 10 days to Ascension. These dates manipulations are enabled by package \href{https://ctan.org/pkg/datenumber}{\texttt{datenumber}}, which is the only dependence of this package.

	\section{Package History}
		\begin{description}
			\item[v2.0 --] 2026/07/20: Suppressing \verb|\Ascension| and \verb|\Pentecost|, these dates are now computed by \verb|\Easter|'s commands. Optimisation in Ascension and Pentecost computing to speed up compilation. Documentation improvement.

			\item[v1.0 --] 2026/07/07: Initial release.
		\end{description}
\end{document}

