<<

Experiences Typesetting OpenType Math with LuaLATEX and XƎLATEX Zkušenosti se sazbou matematiky ve formátu OpenType math v LuaLATEXu a XƎLATEXu Ulrik Vieth

Abstract: When LuaTEX first provided support for OpenType math ty- pesetting in version 0.40, high-level macro support for math typesetting was first developed for ConTEXt MkIV, while support for LuaLATEX was initially limited to a very low-level or non-existent. In the meantime, this gap has been closed by recent developments on macro packages such as luaotfload, fontspec, and unicode-math, so LATEX users are now provided with a unified high-level selection interface for text and math that can be used equally well with both LuaLATEX and XƎLATEX. While a unified high-level interface greatly improves interchange and eases transitions between systems, it does not guarantee that identical input will always produce identical output on different engines, as there are significant differences in the underlying implementations of math ty- pesetting algorithms. While LuaTEX provides a full-featured implemen- tation of OpenType math, XƎTEX has taken a more limited approach based on a subset of OpenType parameters to provide the functionality of traditional TEX engines. Given the possibility of running exactly the same test files on both engines, it now becomes feasible to study those differences in detail and to compare the results. Hopefully, this will allow to draw conclusions how the quality of math typesetting is affected and could be improved by taking advantage of a more sophisticated, full-featured OpenType math implementation. Key words: LuaLATEX, XƎLATEX, OpenType math, math typesetting, fontspec package, Cambria, Asana, XITS, Neo Euler.

Abstrakt: Jelikož LuaTEX podporuje Open math až od verze 0.40, byla podpora matematické sazby na vyšší úrovni vytvořena nejprve pro ConTEXt MkIV, zatímco podpora pro LuaLATEX byla nízká nebo nebyla žádná. Další vývoj však tuto mezeru zacelil – uživatelé LATEXu mají nyní k dispozici jednotné rozhraní pro připojení fontů pro běžný text i pro matematickou sazbu pomocí balíčků luaotfload, fontspec a unicode-math;

116 doi: 10.5300/2011-2-4/116

Experiences typesetting OpenType math with LuaLaTEX and XeLaTEX CONTEXT MEETING 2010 9

XITS Math Example Neo Euler Example Vector calculus: Vector calculus: ∂휙 ∂휙 ∂휙 ∂ϕ ∂ϕ ∂ϕ 훁휙(풓) = 풆 + 풆 + 풆 , ∇ϕ(퐫) = 퐞x + 퐞y + 퐞z , ∂푥 푥 ∂푦 푦 ∂푧 푧 ∂x ∂y ∂z 2 2 2 ∂2휙 ∂2휙 ∂2휙 ∂ ϕ ∂ ϕ ∂ ϕ Δ휙(풓) = + + . Δϕ(퐫) = 2 + 2 + 2 . ∂푥2 ∂푦2 ∂푧2 ∂x ∂y ∂z Maxwell equations (differential form): Maxwell equations (differential form):

div 휀0푬 = 휆 , div 푩 = 0 , div ε0퐄 = λ , div 퐁 = 0 , ∂퐁 퐁 ∂ε 퐄 ∂푩 푩 ∂휀0푬 rot 퐄 = − , rot = 퐣 + 0 . rot 푬 = − , rot = 풋 + . ∂t μ ∂t ∂푡 휇0 ∂푡 0 Maxwell equations (integral form): Maxwell equations (integral form):

ε 퐄 ⋅ d퐟 = λ dV , 퐁 ⋅ d퐟 = 0 , 휀0푬 ⋅ d풇 = 휆 d푉 , 푩 ⋅ d풇 = 0 , ∫ 0 ∫ ∫ ∫퐹 ∫푉 ∫퐹 F V F d d 퐄 ⋅ d퐥 = − 퐁 ⋅ d퐟 , 푬 ⋅ d풍 = − 푩 ⋅ d풇 , ∮ dt ∫ ∮퐶 d푡 ∫퐹 C F 퐁 ∂ε 퐄 푩 ∂휀0푬 0 ⋅ d풍 = 풋 + ⋅ d풇 . ⋅ d퐥 = 퐣 + ⋅ d퐟 . ∮ μ0 ∫ ( ∂t ) ∮퐶 휇0 ∫퐹 ( ∂푡 ) C F Electromagnetic wave equations: Electromagnetic wave equations: 2 1 ∂2푬 1 ∂풋 1 ∂ 퐄 1 ∂퐣 Δ푬 − = 훁휆 + 휇 , Δ퐄 − = ∇λ + μ0 , 2 2 0 c2 ∂t2 ε ∂t 푐 ∂푡 휀0 ∂푡 0 2 1 ∂2퐁 1 ∂ 푩 Δ퐁 − = −μ rot 퐣 . Δ푩 − = −휇0 rot 풋 . 2 2 0 푐2 ∂푡2 c ∂t Energy-mass equation (special relativity): Energy-mass equation (special relativity): 2 m c2 푚0푐 E = 0 . 퐸 = . 1 − v2/c2 √1 − 푣2/푐2 √ Einstein field equation (general relativity): Einstein field equation (general relativity): 1 8πG 휇휈 1 휇휈 휇휈 8휋퐺 휇휈 µν µν µν µν 푅 − 푅푔 + 훬푔 = − 푀 . R − Rg + Λg = − 2 M . 2 푐2 2 c Schrödinger equation (quantum mechanics): Schrödinger equation (quantum mechanics):

2 2 ∂휓 1 ℏ ∂ψ 1 ¯h iℏ = 퐻̂ 휓 = 훁 − 푞푨 휓 + 푞휙 휓 . i¯h = Ĥ ψ = ∇ − q퐀 ψ + qϕ ψ . ∂푡 2푚( i ) ∂t 2m( i ) Dirac equation (relativistic quantum mechanics): Dirac equation (relativistic quantum mechanics):

훼 ℏ α ¯h 훾 ∂ − 푞퐴 휓 + 푚 푐 휓 = 0 . γ ∂α − qAα ψ + m0c ψ = 0 . ( i 훼 훼) 0 ( i )

Figure 10: Sampling of equations typeset with LuaLaTEX using Figure 11: Sampling of equations typeset with LuaLaTEX using XITS and XITS Math. TEX Gyre Pagella and Neo Euler.

125