使用unicode-math包加载外置字体,基本实现,但是矩阵的括号()压扁变丑、运算符sum变窄难看;使用usepackage[no-math]{fontspec}
没看明白..代码里好像也没体现...
想把数学公式中的数字、字母、希腊字母、sin、cos、lim等排版成times字体,积分号、sum、[]、{}、()保留原有的美观性
这和ctexbook,siunitx好像都没什么关系... 另外AI生成的测试代码太长了...不想看...可以试试这个range的方法...
\documentclass{article}
\usepackage[no-math]{fontspec}
\usepackage{unicode-math}
\setmathfont{latinmodern-math.otf}
\setmathfont[
range={
up/{num,latin,Latin,greek,Greek},
it/{latin,Latin,greek,Greek},
bfup/{num,latin,Latin,greek,Greek},
bfit/{latin,Latin,greek,Greek},
"0021,"002C,"002E,"003B,"003F
}
]{texgyretermes-math.otf}
\begin{document}
123abcABC,.;?! +-*/
$123abcABC,.;?!\alpha\beta\Gamma\Delta$
\[
\iint_S \vec{F}\cdot d\vec{S},
\oint_C \vec{B}\cdot d\vec{l},
\sum_{i=1}^{N}a_i,
\prod_{k=1}^{n}(x-x_k)
\]
\[
\begin{bmatrix}
\dfrac{\partial^2 f}{\partial x^2} &
\dfrac{\partial^2 f}
{\partial x \partial y} \\
\dfrac{\partial^2 f}
{\partial x \partial y} &
\dfrac{\partial^2 f}{\partial y^2}
\end{bmatrix}
=
\begin{pmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{pmatrix}
\]
\end{document}



















问 如何替换公式中数字、字母、希腊字母、标点符号为罗马体不影响其他数学符号字体?