我想使用 編寫包含數學的阿拉伯語文檔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