我想用 编写包含数学内容的阿拉伯语文档context
,我想使用拉丁现代字体来表示数学(我在用 xelatex 编写文档时使用该字体)。
我的问题是如何将阿拉伯字体与拉丁现代字体结合起来用于数学
xelatex MWE
\documentclass[a4paper]{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage{polyglossia}
\setdefaultlanguage[calendar=gregorian]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic]{Amiri}
\parindent 0pt
\begin{document}
كلمة كلمة
$x+y$
\end{document}
背景(不是我们)
\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]
\stoptypescript
\setuplayout[
grid=min,
backspace=25mm, width=160mm,
topspace=15mm, height=265mm,
header=10mm,footer=10mm,
headerdistance=2mm
]
\setupbodyfont[Arabic,18pt]
\setupinterlinespace[line=30pt]
\starttext
كلمة كلمة
$x+y$
\stoptext
答案1
您还需要定义math
字体。以下应该有效(未测试,因为我没有阿拉伯字体):
\starttypescript [Arabic]
\definetypeface [Arabic] [rm] [serif] [arabic] [default]
\definetypeface [Arabic] [mm] [math] [modern] [default]
\stoptypescript