使用 Stix 使文本和数学公式具有相同的字体

使用 Stix 使文本和数学公式具有相同的字体

我的标签如下:

\documentclass{book}
\RequirePackage[T1]{fontenc}%
\RequirePackage{stix}%

\begin{document}

This is for test \textit{test}
\[
\int+\alpha=a+b
\]

\end{document}

在此处输入图片描述

生成的输出,文本中的斜体字体名称显示为 STIXGeneral-Italic,文本中的数学斜体字体显示为 STIXMath-Italic,但我希望这也应该显示为 STIXGeneral-Italic,这可能吗?请指教

答案1

我不确定出版商为什么想要质量较低的 PDF。据我所知,STIXMath-Italic 中的字形与 STIXGeneral-Italic 中的字形相同,但数学字体具有适合数学的包装。

无论如何,您可以执行以下操作,更改字母的数学代码以使用 STIXGeneral-Italic。

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{stix}

\makeatletter
\DeclareSymbolFont{itletters}{OT1}{stix}{m}{it}
\SetSymbolFont{itletters}{bold}{OT1}{stix}{b}{it}
\DeclareSymbolFontAlphabet{\mathit}  {itletters}
\stix@MathSymbol{A}     {\mathalpha}{itletters}  {`A}
\stix@MathSymbol{B}     {\mathalpha}{itletters}  {`B}
\stix@MathSymbol{C}     {\mathalpha}{itletters}  {`C}
\stix@MathSymbol{D}     {\mathalpha}{itletters}  {`D}
\stix@MathSymbol{E}     {\mathalpha}{itletters}  {`E}
\stix@MathSymbol{F}     {\mathalpha}{itletters}  {`F}
\stix@MathSymbol{G}     {\mathalpha}{itletters}  {`G}
\stix@MathSymbol{H}     {\mathalpha}{itletters}  {`H}
\stix@MathSymbol{I}     {\mathalpha}{itletters}  {`I}
\stix@MathSymbol{J}     {\mathalpha}{itletters}  {`J}
\stix@MathSymbol{K}     {\mathalpha}{itletters}  {`K}
\stix@MathSymbol{L}     {\mathalpha}{itletters}  {`L}
\stix@MathSymbol{M}     {\mathalpha}{itletters}  {`M}
\stix@MathSymbol{N}     {\mathalpha}{itletters}  {`N}
\stix@MathSymbol{O}     {\mathalpha}{itletters}  {`O}
\stix@MathSymbol{P}     {\mathalpha}{itletters}  {`P}
\stix@MathSymbol{Q}     {\mathalpha}{itletters}  {`Q}
\stix@MathSymbol{R}     {\mathalpha}{itletters}  {`R}
\stix@MathSymbol{S}     {\mathalpha}{itletters}  {`S}
\stix@MathSymbol{T}     {\mathalpha}{itletters}  {`T}
\stix@MathSymbol{U}     {\mathalpha}{itletters}  {`U}
\stix@MathSymbol{V}     {\mathalpha}{itletters}  {`V}
\stix@MathSymbol{W}     {\mathalpha}{itletters}  {`W}
\stix@MathSymbol{X}     {\mathalpha}{itletters}  {`X}
\stix@MathSymbol{Y}     {\mathalpha}{itletters}  {`Y}
\stix@MathSymbol{Z}     {\mathalpha}{itletters}  {`Z}
\stix@MathSymbol{a}     {\mathalpha}{itletters}  {`a}
\stix@MathSymbol{b}     {\mathalpha}{itletters}  {`b}
\stix@MathSymbol{c}     {\mathalpha}{itletters}  {`c}
\stix@MathSymbol{d}     {\mathalpha}{itletters}  {`d}
\stix@MathSymbol{e}     {\mathalpha}{itletters}  {`e}
\stix@MathSymbol{f}     {\mathalpha}{itletters}  {`f}
\stix@MathSymbol{g}     {\mathalpha}{itletters}  {`g}
\stix@MathSymbol{h}     {\mathalpha}{itletters}  {`h}
\stix@MathSymbol{i}     {\mathalpha}{itletters}  {`i}
\stix@MathSymbol{j}     {\mathalpha}{itletters}  {`j}
\stix@MathSymbol{k}     {\mathalpha}{itletters}  {`k}
\stix@MathSymbol{l}     {\mathalpha}{itletters}  {`l}
\stix@MathSymbol{m}     {\mathalpha}{itletters}  {`m}
\stix@MathSymbol{n}     {\mathalpha}{itletters}  {`n}
\stix@MathSymbol{o}     {\mathalpha}{itletters}  {`o}
\stix@MathSymbol{p}     {\mathalpha}{itletters}  {`p}
\stix@MathSymbol{q}     {\mathalpha}{itletters}  {`q}
\stix@MathSymbol{r}     {\mathalpha}{itletters}  {`r}
\stix@MathSymbol{s}     {\mathalpha}{itletters}  {`s}
\stix@MathSymbol{t}     {\mathalpha}{itletters}  {`t}
\stix@MathSymbol{u}     {\mathalpha}{itletters}  {`u}
\stix@MathSymbol{v}     {\mathalpha}{itletters}  {`v}
\stix@MathSymbol{w}     {\mathalpha}{itletters}  {`w}
\stix@MathSymbol{x}     {\mathalpha}{itletters}  {`x}
\stix@MathSymbol{y}     {\mathalpha}{itletters}  {`y}
\stix@MathSymbol{z}     {\mathalpha}{itletters}  {`z}
\makeatother

\begin{document}

This is for test \textit{test}
\[
abcABC
\]

\end{document}

的输出pdffonts

name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
LHJDKK+STIXGeneral-Regular           Type 1            yes yes no       4  0
GQLIBX+STIXGeneral-Italic            Type 1            yes yes no       5  0
GQLIBX+STIXGeneral-Italic            Type 1            yes yes no       6  0

如果没有更改,输出将是

name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
LHJDKK+STIXGeneral-Regular           Type 1            yes yes no       4  0
EUZLLL+STIXGeneral-Italic            Type 1            yes yes no       5  0
URGOEX+STIXMath-Italic               Type 1            yes yes no       6  0

但是,你应该意识到输出肯定更糟糕。例如,在 中会应用连字$fl$;数学公式中斜体字母之间的间距是错误的。

相关内容