Is it possible to reformat output of currentdate tex variable
I have been using /currentdate to identify in an exported pdf map header when the map was compiled. \edef\tmp{\the\thversion} \ifx\tmp\empty \else %only write version and date if version is not empty {\the\legendtextsize\si\the\thversiontitleA: \ss\the\thversiontitleB \ss\the\thversion} {\the\legendtextsize\si\the\datetitle \si\the\currentdate\par} \fi It takes the system date and format as input. So I was using Windows 10 OS settings to format the date how I preferred it, in the case, d Mmm YYYY. Seems that Windows 11, my new OS does not have the ability to format the system date in manner(s) that I find useful. Is there a way for Therion to take the date provided by the OS and reformat it? Think I recall someone did offer up something a little cumbersome, but it escapes me just now. Anyway, perhaps there is a better way today? (Run Therion in a Win10 VM?) Bruce
I also have an interest in this. I have been using these TeX statements in thconfig: \the\legendtextsize\ Map generated at \the\time \the\currentdate\medskip \the\legendtextsize\ Therion version \the\thversion Which results in a date output that looks like this: Map generated at 51009/04/25 I am using Linux - Fedora 42. It would be nice to show the date in a more readable format. =============== Bill Gee On 9/18/25 21:56, bruce@tomo.co.nz wrote:
I have been using /currentdate to identify in an exported pdf map header when the map was compiled.
\edef\tmp{\the\thversion} \ifx\tmp\empty \else %only write version and date if version is not empty
{\the\legendtextsize\si\the\thversiontitleA: \ss\the\thversiontitleB \ss\the\thversion}
{\the\legendtextsize\si\the\datetitle \si\the\currentdate\par}
\fi
It takes the system date and format as input. So I was using Windows 10 OS settings to format the date how I preferred it, in the case, d Mmm YYYY.
Seems that Windows 11, my new OS does not have the ability to format the system date in manner(s) that I find useful.
Is there a way for Therion to take the date provided by the OS and reformat it?
Think I recall someone did offer up something a little cumbersome, but it escapes me just now. Anyway, perhaps there is a better way today?
(Run Therion in a Win10 VM?)
Bruce
_______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
I have been messing around with this for a few hours today. TeX-Live has a package called datetime2 which appears to offer all the formatting options both Bruce and I would like to see. However, I cannot make it work in Therion. https://ctan.org/pkg/datetime2 If I add "\usepackage{datetime2}" to the "code tex-map" block in my thconfig file, then Therion throws several compile errors. It basically says it does not have any idea what that command means. Therion also does not understand \today and \currenttime. These two should be part of a base set of packages. The datetime2 package overrides them with new definitions. =============== Bill Gee On 9/19/25 07:29, Bill Gee wrote:
I also have an interest in this. I have been using these TeX statements in thconfig:
\the\legendtextsize\ Map generated at \the\time \the\currentdate\medskip \the\legendtextsize\ Therion version \the\thversion
Which results in a date output that looks like this:
Map generated at 51009/04/25
I am using Linux - Fedora 42. It would be nice to show the date in a more readable format.
=============== Bill Gee
On 9/18/25 21:56, bruce@tomo.co.nz wrote:
I have been using /currentdate to identify in an exported pdf map header when the map was compiled.
\edef\tmp{\the\thversion} \ifx\tmp\empty \else %only write version and date if version is not empty
{\the\legendtextsize\si\the\thversiontitleA: \ss\the\thversiontitleB \ss\the\thversion}
{\the\legendtextsize\si\the\datetitle \si\the\currentdate\par}
\fi
It takes the system date and format as input. So I was using Windows 10 OS settings to format the date how I preferred it, in the case, d Mmm YYYY.
Seems that Windows 11, my new OS does not have the ability to format the system date in manner(s) that I find useful.
Is there a way for Therion to take the date provided by the OS and reformat it?
Think I recall someone did offer up something a little cumbersome, but it escapes me just now. Anyway, perhaps there is a better way today?
(Run Therion in a Win10 VM?)
Bruce
_______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
_______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
On Fri, Sep 19, 2025 at 4:29 PM Bill Gee <bgee@campercaver.net> wrote:
If I add "\usepackage{datetime2}" to the "code tex-map" block in my
thconfig file, then Therion throws several compile errors. It basically says it does not have any idea what that command means.
Therion also does not understand \today and \currenttime. These two should be part of a base set of packages. The datetime2 package overrides them with new definitions.
Therion uses Plain TeX format, so LaTeX packages don't work. Plain defines only the following numeric variables: \day, \month, \year. You can use these directly or combine the \month with a series of \ifs to print a month name (AI can help to write this, don't forget to specify it should be used in Plain TeX). Another option is the texdate package ( https://ctan.org/tex-archive/macros/generic/texdate) that should work with Plain (see chapter 8 in its documentation).
On 9/18/25 21:56, bruce@tomo.co.nz wrote:
I have been using /currentdate to identify in an exported pdf map header when the map was compiled. ... It takes the system date and format as input. So I was using Windows 10 OS settings to format the date how I preferred it, in the case, d Mmm YYYY.
Seems that Windows 11, my new OS does not have the ability to format the system date in manner(s) that I find useful.
Is there a way for Therion to take the date provided by the OS and reformat it?
\currentdate contains actually only a string preformatted by Therion according to the locale set on the system. It should be enough to set your date formatting on Windows. Best wishes Martin
On 9/19/25 13:35, Martin Budaj wrote:
On Fri, Sep 19, 2025 at 4:29 PM Bill Gee <bgee@campercaver.net <mailto:bgee@campercaver.net>> wrote:
https://ctan.org/pkg/datetime2 <https://ctan.org/pkg/datetime2>
If I add "\usepackage{datetime2}" to the "code tex-map" block in my thconfig file, then Therion throws several compile errors. It basically says it does not have any idea what that command means.
Therion also does not understand \today and \currenttime. These two should be part of a base set of packages. The datetime2 package overrides them with new definitions.
Therion uses Plain TeX format, so LaTeX packages don't work.
Plain defines only the following numeric variables: \day, \month, \year. You can use these directly or combine the \month with a series of \ifs to print a month name (AI can help to write this, don't forget to specify it should be used in Plain TeX).
Another option is the texdate package (https://ctan.org/tex-archive/ macros/generic/texdate <https://ctan.org/tex-archive/macros/generic/ texdate>) that should work with Plain (see chapter 8 in its documentation).
> On 9/18/25 21:56, bruce@tomo.co.nz <mailto:bruce@tomo.co.nz> wrote: >> I have been using /currentdate to identify in an exported pdf map >> header when the map was compiled. ... >> It takes the system date and format as input. So I was using Windows >> 10 OS settings to format the date how I preferred it, in the case, d >> Mmm YYYY. >> >> Seems that Windows 11, my new OS does not have the ability to format >> the system date in manner(s) that I find useful. >> >> Is there a way for Therion to take the date provided by the OS and >> reformat it?
\currentdate contains actually only a string preformatted by Therion according to the locale set on the system. It should be enough to set your date formatting on Windows.
Best wishes Martin
_______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
Hmmm... That certainly explains why the datetime and datetime2 packages do not work. I installed a Fedora package from repositories called "texlive-texdate". The description says it pure "TeX-primitive", which I assume is the same thing as Plain TeX. https://ctan.org/pkg/texdate I tried using the basic stuff from texdate, but Therion did not like any of it. Even the most basic \initcurrdate command gave an "undefined control sequence" error. On my system, the date that Therion pulls in with \currentdate is in the form MM/DD/YY even though I have the system short date set to DD MMM YYYY. Time is a bigger problem. At 14:38 local time I compiled a map, and Therion set the time as "880". Where the heck did that come from? I can live with the date format Therion uses, though it is not ideal, and I can go without time. Just for grins, I tried to create a plain .tex file that called \initcurrdate. I could not get even that to work. =============== Bill Gee
\currentdate contains actually only a string preformatted by Therion according to the locale set on the system. It should be enough to set your date formatting on Windows.
It should be enough, although it does mean the same project on different devices is likely to produce differing outputs. It had been my approach with Windows 10, which had a reasonable number of options, amongst them d Mmm yyyy, which is what I prefer. Windows 11 has, for my locale, just two options, d/mm/yyyy and d/mm/yy. I did consider using an example http://www.alfredklomp.com/programming/tex/macros/ (section 2) that we discussed in 2011. That is now in 404! land and I did not keep a copy. I’m an eternal tex novice and more recently an ai luddite. Bruce
You can find that dead link on the Internet Archive https://web.archive.org/web/20170815180039/http://www.alfredklomp.com/progra... On Fri, 19 Sept 2025 at 21:38, <bruce@tomo.co.nz> wrote:
\currentdate contains actually only a string preformatted by Therion according to the locale set on the system. It should be enough to set your date formatting on Windows.
It should be enough, although it does mean the same project on different devices is likely to produce differing outputs. It had been my approach with Windows 10, which had a reasonable number of options, amongst them d Mmm yyyy, which is what I prefer.
Windows 11 has, for my locale, just two options, d/mm/yyyy and d/mm/yy.
I did consider using an example http://www.alfredklomp.com/programming/tex/macros/ (section 2) that we discussed in 2011. That is now in 404! land and I did not keep a copy.
I’m an eternal tex novice and more recently an ai luddite.
Bruce
_______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
participants (4)
-
Bill Gee -
bruce@tomo.co.nz -
Henry Bennett -
Martin Budaj