我想在上下文中更改月份名稱,在 tex 中\month
定義月份編號,月份名稱可以重新定義\ifcase
變更 \today 指令中的月份名稱
我如何在上下文中執行相同的操作(修改\date
命令中出現的月份名稱),\month
在上下文中顯示為不可用。
更新
這裡有一個MWE
\setuppapersize[A4]
\mainlanguage[arabic]
\setupdirections[bidi=global]
\setupalign[r2l]
\definefontfeature
[arabic]
[mode=node,language=dflt,script=arab,
init=yes,medi=yes,fina=yes,isol=yes,
liga=yes,dlig=yes,rlig=yes,tlig=yes,
calt=yes,trep=yes,clig=yes,
mark=yes,mkmk=yes,kern=yes,curs=yes]
\starttypescript [serif] [arabic]
\definefontsynonym [Arabic-Regular] [name:Amiri] [features=arabic]
\definefontsynonym [Arabic-Bold] [name:Amiri] [features=arabic]
\stoptypescript
\starttypescript [serif] [arabic] [name]
\usetypescript[serif][fallback]
\definefontsynonym [Serif] [Arabic-Regular] [features=arabic]
\definefontsynonym [SerifBold] [Arabic-Bold] [features=arabic]
\stoptypescript
\starttypescript [Arabic]
\definetypeface [Arabic] [rm] [serif] [arabic] [default]
\definetypeface [Arabic] [mm] [math] [palatino] [default]
\stoptypescript
\setuplayout[
grid=min,
backspace=20mm, width=170mm,
topspace=10mm, height=275mm,
header=10mm,footer=10mm,
headerdistance=2mm
]
\setupbodyfont[Arabic,18pt]
\setupinterlinespace[line=30pt]
\starttext
\date
\stoptext
答案1
如果您不想變更文件的主要語言(使用\mainlanguage[…]
then 您可以使用以下指令重新定義月份\setuplabeltext
:
\setuplabeltext
%% [en] %% for a language specific setting
[january=J,
february=F]
此外,如果您想要變更 所使用的日期格式\date
,您可以使用以下命令\setuplanguage
:
\setuplanguage
%% [en] %% for a language specific setting
[date={year, \thinspace–\thinspace, mm, \thinspace–\thinspace, dd}]