* [NTG-context] month form \currentdate in Roman numerals
@ 2024-12-06 11:35 Pablo Rodriguez via ntg-context
2024-12-06 14:39 ` [NTG-context] " Wolfgang Schuster
0 siblings, 1 reply; 3+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2024-12-06 11:35 UTC (permalink / raw)
To: ConTeXt users; +Cc: Pablo Rodriguez
Dear list,
I would like to get the current month in Roman numerals (just now, it
would be XII for December).
The best I get is:
\currentdate[\cldcontext{converters['R']
(tonumber(os.date("\letterpercent m", os.date(os.time()))))}]
This strikes me as too complex (even for someone who cannot code).
Is there now simpler way to write that?
Just in case it may be relevant, this is part of the full day reference.
Many thanks for your help,
Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: month form \currentdate in Roman numerals
2024-12-06 11:35 [NTG-context] month form \currentdate in Roman numerals Pablo Rodriguez via ntg-context
@ 2024-12-06 14:39 ` Wolfgang Schuster
2024-12-07 12:06 ` Pablo Rodriguez via ntg-context
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2024-12-06 14:39 UTC (permalink / raw)
To: mailing list for ConTeXt users, Pablo Rodriguez via ntg-context
Cc: Pablo Rodriguez
Pablo Rodriguez via ntg-context schrieb am 06.12.2024 um 12:35:
> Dear list,
>
> I would like to get the current month in Roman numerals (just now, it
> would be XII for December).
>
> The best I get is:
>
> \currentdate[\cldcontext{converters['R']
> (tonumber(os.date("\letterpercent m", os.date(os.time()))))}]
>
> This strikes me as too complex (even for someone who cannot code).
>
> Is there now simpler way to write that?
The \date (and \currentdate) command supports number conversion for the
day and year values but not the month.
\starttext
\currentdate[d:R,space,space,y:R]
\stoptext
The simplest method is to use \convertnumber in combination with
\normalmonth etc. which holds the value for the current month etc.
\starttext
\convertnumber{R}{\normalday }\textslash
\convertnumber{R}{\normalmonth}\textslash
\convertnumber{R}{\normalyear }
\stoptext
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: month form \currentdate in Roman numerals
2024-12-06 14:39 ` [NTG-context] " Wolfgang Schuster
@ 2024-12-07 12:06 ` Pablo Rodriguez via ntg-context
0 siblings, 0 replies; 3+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2024-12-07 12:06 UTC (permalink / raw)
To: ntg-context; +Cc: Pablo Rodriguez
On 12/6/24 15:39, Wolfgang Schuster wrote:
> [...]
> The \date (and \currentdate) command supports number conversion for the
> day and year values but not the month.
>
> \starttext
> \currentdate[d:R,space,space,y:R]
> \stoptext
Many thanks for your fast reply, Wolfgang.
I didn’t even know that there were such short invocations for number
conversions in \currentdate.
> The simplest method is to use \convertnumber in combination with
> \normalmonth etc. which holds the value for the current month etc.
>
> \starttext
> \convertnumber{R}{\normalday }\textslash
> \convertnumber{R}{\normalmonth}\textslash
> \convertnumber{R}{\normalyear }
> \stoptext
First time I see these commands. Good to know them.
Many thanks for your help,
Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-07 12:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-06 11:35 [NTG-context] month form \currentdate in Roman numerals Pablo Rodriguez via ntg-context
2024-12-06 14:39 ` [NTG-context] " Wolfgang Schuster
2024-12-07 12:06 ` Pablo Rodriguez via ntg-context
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).