[NTG-context] tex.month can't be overridden like tex.day and tex.year

Hans Hagen j.hagen at xs4all.nl
Mon May 6 16:54:42 CEST 2019


On 5/2/2019 5:54 PM, Tristan Stenner wrote:
> Dear list,
> 
> in the following document I can set the date as seen by LuaTeX so the
> date functions use a different date:
> 
> ---
> \starttext
> \ctxlua{tex.year=1980; tex.month=1; tex.day=15}
> 
> % Taken from https://wiki.contextgarden.net/Command/date,
> % outputs 15 may 1980
> \date[m=1][day,~,{\monthshort\normalmonth},~,year]
> 
> % outputs January 15, 1980
> \ctxlua{context.date{m=tex.month};}
> \stoptext
> ---
> 
> This works for all parts of the date (even the weekday), except the
> month. I've looked through the core-con.lua and found nothing that would
> explain this (or what I'd need to change), as the tex.month is properly set.
\meaning\day   \par
\meaning\month \par
\meaning\year  \par

\meaning\normalday   \par
\meaning\normalmonth \par
\meaning\normalyear  \par


context (re)defines \month so you need to use the original meanings 
(\normal..)

Jams

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list