\today
as it is not the day on which I print the stuff that matters, but the date on which she uses it.As certain parts of the service vary little from week to week, but still need to be kept fresh, such as the short prayer for blessing the offering, she has a selection which I have stored in a stylesheet (.sty) from which I pick a different one for each Sunday of the month. I call the \
newcommands
names like \offerone
, \offertwo
, etc.I would like to automate this, so that (if possible) LaTeX or a package should calculate which Sunday of the month it is, and output the appropriate prayer. For instance, if it were the third Sunday of the month, I would want it to pick
\offerthree
.What I would like to be happen is this: I input the date of the Sunday (e.g. 4 August 2019), and assign that to some variable with which I can work. I would then divide the day_of_the_month part (i.e. 4) by 7 (which would give 0), and add 1 to the result. That would enable me to select the
\offerone
for the first Sunday of August. The parts that I do not know how to do are:
(a) how to get LaTeX to pick up on what the Sunday date is if I tell it, for instance,
\date{2019-08-04}
. How can I fetch the 04 into a variable, please? (b) I would then need to divide that variable by 7, and add 1, to calculate which Sunday of the month it was.
I think I know how to do the logic for selecting the correct prayer.
Maybe what I am asking is not possible using LaTeX alone. However, any advice that anyone can give me would be appreciated, as my lack of knowledge as to how to grab the day-number part of the date is hampering me.
Thanks for reading this far. If you can even help me to express my question better, I would appreciate that too.
Thanks,
Calum