hi, When I try to output the Chinese date with the command below, I find that it doesn't process the month at all. No matter how I try any of the "month,month:cn-a,month:cn-c,month:cn-d" conversions Unless I pre-set the labeltext for the Chinese month. %%%% \definedfont[name:adobesongstdlight] \currentdate[year:cn-d,年,month:cn-a,day:cn,号] %output : 二〇二五年January 十一号 \setuplabeltext [en][january={一月},] \currentdate[year:cn-d,年,month:cn-a,day:cn,号] %output : 二〇二五年一月 十一号 %%%% If so, then when should I use those conversion method ? (At present, the output of "month:cn-d" is only suitable for the year, not the month and day. Its naming is somewhat misleading) What's more, there seems to be a strange space here between the month and the day. It should output 二〇二五年一月十一号 instead 二〇二五年一月 十一号 autumnus
Am 11.01.2025 um 06:08 schrieb autumnus:
hi,
When I try to output the Chinese date with the command below, I find that it doesn't process the month at all. No matter how I try any of the "month,month:cn-a,month:cn-c,month:cn-d" conversions Unless I pre-set the labeltext for the Chinese month.
%%%% \definedfont[name:adobesongstdlight] \currentdate[year:cn-d,年,month:cn-a,day:cn,号] %output : 二〇二五年January 十一号
\setuplabeltext [en][january={一月},] \currentdate[year:cn-d,年,month:cn-a,day:cn,号] %output : 二〇二五年一月 十一号 %%%%
If so, then when should I use those conversion method ? (At present, the output of "month:cn-d" is only suitable for the year, not the month and day. Its naming is somewhat misleading)
What's more, there seems to be a strange space here between the month and the day. It should output 二〇二五年一月十一号 instead 二〇二五年一月 十一号
1. You can't apply a number conversion for months. 2. You can switch languages to get label texts for chinese. \starttext \currentdate[month,day] \language[cn] \definedfont[name:adobesongstdlight] \currentdate[month,day:cn] \stoptext 3. The space after the month is inserted on purpose to get a space between the month and day as can be seen in the example above. To prevent this auto space for chinese a language check can be added to the date command. Wolfgang
Thank you for your explanation. Regarding the space after the month, will it be added to the ConTeXt in the future? I'm worried that after I patch it, it will be overwritten when I update it later. autumnus
Hi autumnus, I have got no experience with Chinese but I think it is possible to change it for the future. The current settings for Chinese has been defined as (file tex/texmf-context/tex/context/base/mkxl/lang-def.mkxl, line no. 655): \c!date={\v!year,年,\space,\v!month,\v!day,日} You can change it to how the date is correctly written, and send it to me, please, I will prepare new files for Hans. Tomáš On Sun, Jan 12, 2025 at 05:16:50AM -0000, autumnus wrote:
Thank you for your explanation. Regarding the space after the month, will it be added to the ConTeXt in the future? I'm worried that after I patch it, it will be overwritten when I update it later.
autumnus ___________________________________________________________________________________ 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 ___________________________________________________________________________________
hi, Tomáš Thank you for your help. The format that is currently more commonly used is the first one. %%%% \starttext \language[cn] \definedfont[name:adobesongstdlight] modern and mostly used : \currentdate[year,年,M,月,day,日] : 2025年1月12日 traditional and special case: \currentdate[year:cn-d,年,month,day:cn,日] : 二〇二五年一月十二日 The addition of spaces should only be added between numbers and kanji. The addition of spaces should take effect not only in the date, but in all texts. If you add a space it should be: 2025 年 1 月 12 日 (between numbers and kanji) 二〇二五年一月十二日 (no space added) \stoptext %%%% autumnus
I don't know why, the text is automatically added with spaces. The correct one should be: \currentdate[year,年,M,月,day,日] \currentdate[year:cn-d,年,month,day:cn,日]
Am 12.01.2025 um 06:16 schrieb autumnus:
Thank you for your explanation. Regarding the space after the month, will it be added to the ConTeXt in the future? I'm worried that after I patch it, it will be overwritten when I update it later.
It depends whether Hans includes the fix or not. Wolfgang
On 1/13/2025 5:43 PM, Wolfgang Schuster wrote:
Am 12.01.2025 um 06:16 schrieb autumnus:
Thank you for your explanation. Regarding the space after the month, will it be added to the ConTeXt in the future? I'm worried that after I patch it, it will be overwritten when I update it later.
It depends whether Hans includes the fix or not.
You mean this? \c!date={\v!year,年,\space,\v!month,\v!day,日} It also depends on Tomas who deals with languages, Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Am 13.01.2025 um 19:02 schrieb Hans Hagen:
On 1/13/2025 5:43 PM, Wolfgang Schuster wrote:
Am 12.01.2025 um 06:16 schrieb autumnus:
Thank you for your explanation. Regarding the space after the month, will it be added to the ConTeXt in the future? I'm worried that after I patch it, it will be overwritten when I update it later.
It depends whether Hans includes the fix or not.
You mean this?
\c!date={\v!year,年,\space,\v!month,\v!day,日}
It also depends on Tomas who deals with languages,
No, I sent a patched core-con.lmt in a previous mail where I added local packed = { ["cn"] = true } on line 1881 and changed line 1916 from if not auto and spaced[tag] then to if not auto and not packed[currentlanguage] and spaced[tag] then Wolfgang
On 1/13/2025 8:09 PM, Wolfgang Schuster wrote:
Am 13.01.2025 um 19:02 schrieb Hans Hagen:
On 1/13/2025 5:43 PM, Wolfgang Schuster wrote:
Am 12.01.2025 um 06:16 schrieb autumnus:
Thank you for your explanation. Regarding the space after the month, will it be added to the ConTeXt in the future? I'm worried that after I patch it, it will be overwritten when I update it later.
It depends whether Hans includes the fix or not.
You mean this?
\c!date={\v!year,年,\space,\v!month,\v!day,日}
It also depends on Tomas who deals with languages,
No, I sent a patched core-con.lmt in a previous mail where I added
local packed = { ["cn"] = true }
on line 1881 and changed line 1916 from
if not auto and spaced[tag] then
to
if not auto and not packed[currentlanguage] and spaced[tag] then
ah, ok, missed that one ... sure i'll patch Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
There should be two changes to be made here: One is a patch added by Wolfgang, which fixes the extra space for dates in the current Chinese environment. One is that in the current environment, the format of the Chinese date should be modified to: \currentdate[year,年,M,月,day,日] (output: 2025年1月14日) ( Because the current date format is a mix of Chinese characters and numbers. : 2025年 一月 14日)
participants (4)
-
autumnus
-
Hans Hagen
-
Tomáš Hála
-
Wolfgang Schuster