我想让正文部分的字体和公式部分的字体一致
因为setmathfont只能使用带有数学部分的字体,所以我把Latin Modern Math中的数字和字母部分改成了我想使用的字体(NEU-BZ),NEU-BZ-Math是我改过之后的字体,然后在设置字体的时候只让应用我修改的部分。
unicode-math关于setmathfont的叙述:
4.1 Using multiple fonts
There will probably be few cases where a single Unicode maths font suffices (sim- ply due to glyph coverage). The STIX font comes to mind as a possible exception. It will therefore be necessary to delegate specific Unicode ranges of glyphs to sep- arate fonts:
setmathfont{ ⟨font name⟩ }[range= ⟨unicode range⟩ , ⟨font features⟩ ]
where ⟨unicode range⟩ is a comma-separated list of Unicode slot numbers and ranges such as {"27D0-"27EB,"27FF,"295B-"297F}. Note that TEX’s syntax for ac- cessing the slot number of a character, such as `+, will also work here. Only nu- merical slots can be used in ranged declarations.
Note that, for efficiency, the unicode-math package only loads a default maths setup when absolutely necessary. Before you use the range option you must first load a ‘main’ maths font in the standard way.
You may also use the macro for accessing the glyph, such as range=int, or whole collection of symbols with the same math type, such as range=mathopen, or complete math styles such as range=symbb (or just range=bb).
这是两个字体
自己改的:
NEU-BZ-Math.otf
在写这个提问的时候,群友告诉我要加上「{}」,之后的MWE:
% -*- coding: utf-8 -*-
% !TEX program = xelatex
\documentclass{article}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\setmathfont{NEU-BZ-Math}[range={"0030-"0039,"0041-"005A,"0061-"007A}]
\setmainfont{NEU-BZ}
\begin{document}
Test,ABCDEFG
$Test,ABCDEFG$
\end{document}
这次没有报错了,但是并没有实现,
编译结果(这是LaTeX编译的):
希望结果(不是LaTeX编译的):
谢谢,但是并没有实现,上标中的字母和所有地方的数字都不能使用我的字体
如图:
那继续加,[range={it,up/{num,latin,Latin}}],请参考unicode-math文档p8
@u41923 上下标不行的话请:1.检查DIY的字体有没有上下标的style 2.参考文档设置各size下的字体
我把所有的字母和数字都改成了我的字体就可以了,感谢