This is supposed to be a part of: Calendar instead of table of contents.
Situation
As mentioned I want to create a calendar-ish table of contents. The link to the heading (of eg. a chapter) should be the same as in ordinary ToC's. In order to be able to place references inside the calendar, one must know where (or when) the entry belongs (corresponds to).
In order to make usage easier, the automatism should be able to insert the current date without the necessity to enter the current date (assume you create a diary-entry for that current day). Therefore I have this problem:
Problem
If I am using the \today command on different days, obviously, the displayed date changes. Manually typing the date is possible as long as some user creates a file and knows which date to insert. At most this will be cumbersome repetitive work.
However, I am planning to use this in a general piece of code, where I will not know in advance which dates to insert.
Question
How does one insert some text (like the current date) into the source-file at compile time?
- or at least some auxiliary file; this would be more error prone, as it could easily be confused and deleted
- if possible without external scripts invoked via shell escape
- could this also be dependent on other circumstances ? (eg. "option in command provided"; I am thinking of an optional argument for the date, which is auto-set, if not provided)