如何在数学模式和文本模式字体中获得一致的字形?

如何在数学模式和文本模式字体中获得一致的字形?

我正在努力理解 NFSS 及其底层机制,但进展缓慢。我正在修改和更新一个软件包,并整理了一个 MWE 来测试我是否破坏了任何东西,同时试图符合 ISO 规范。我的问题是关于小写的“a”和“g”字形。我不喜欢 Math Roman 和 Math Sans 中的“g”字形。有没有一种简单的方法可以让它像其他数学模式的“g”字形一样?同样,在 Text Bold Sans 中,我真的需要 Math Bold 中的“g”字形,只是直立的。我不知道这是否可能。至于“a”字形,我想我看到了一个可以解释其外观的模式。我真的无法预测哪些组合会起作用,哪些不会起作用。这是我的 MWE 及其输出。

\documentclass[10pt]{article}
\usepackage{mandi}
\usepackage[OMLmathbf,OMLmathsfit]{isomath}
\usepackage{tensor}
\usepackage{soul}
\usepackage{lipsum}
\usepackage{geometry}
\geometry{margin=0.25in,top=0.25in,bottom=0.25in}
\pagestyle{empty}

\setul{}{0.25ex}
\newcommand*{\slot}[1][~~]{\,\underline{\smash{\makebox[1em]{\ensuremath{#1}}}}\,}

\begin{document}
\begin{align} 
  &\pi \text{ and } \mathrm{e} \text{ and } \mathrm{i} \text{ and } 
    \mathrm{d} \text{ and } \mathrm{\Delta} \\
  &\textbf{\textsf{dot}}(\slot,\slot) \text{ becomes } 
    \textbf{\textsf{dot}}(\slot[\vectorsym{a}],\slot[\vectorsym{p}])\\
  &\textbf{\textsf{cross}}(\slot,\slot,\slot) \text{ or } 
    \tensorsym{\epsilon}(\slot,\slot,\slot) \\
  &\tensorsym{T} \cdot \vectorsym{a} \\
  &\tensorsym{T} \text{ or } T\indices{^i^j} \text{ or } 
    \mathsfit{T}\indices{_i_j} \\
  &\tensorsym{I} \text{ or } I\indices{_i_j} \text{ or } 
    \mathsfit{I}\indices{_i_j} \\
  &\tensorsym{g} \text{ or } g\indices{_i_j} \text{ or } 
    \mathsfit{g}\indices{_i_j} \\
  &\tensorsym{g} \text{ or } \tensorsym{g}(\slot,\slot) \text{ or }
    \tensorsym{g}(\slot[\tensorsym{a}],\slot)  \\
  &\vectorsym{a} = a^i \vectorsym{e}_i = a^1\vectorsym{e}_1 + a^2\vectorsym{e}_2 + 
    a^3\vectorsym{e}_3 \\
  &\tensorsym{g}\indices{^\mu_\nu} \neq \tensorsym{g}\indices{_\mu_\nu}
\end{align}

Text Italic Sans
\textsf{\textit{abcdefghijklmnopqrstuvwxyz}}
\textsf{\textit{ABCDEFGHIJKLMNOPQRSTUVWXYZ}}

Text Bold Sans 
\textbf{\textsf{abcdefghijklmnopqrstuvwxyz}}
\textbf{\textsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}}

Text Bold Up
\textbf{\textup{abcdefghijklmnopqrstuvwxyz}}
\textbf{\textup{ABCDEFGHIJKLMNOPQRSTUVWXYZ}}

Math
\( abcdefghijklmnopqrstuvwxyz \)
\( ABCDEFGHIJKLMNOPQRSTUVWXYZ \)

Math Greek
\( \alpha\beta\gamma\delta\epsilon\varepsilon\zeta\eta\theta\vartheta\iota\kappa
  \lambda\mu\nu\xi o\pi\varpi\rho\varrho\sigma\varsigma\tau\upsilon\phi\varphi\chi
  \psi\omega \)
\( \Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega \)

Math Roman
\( \mathrm{abcdefghijklmnopqrstuvwxyz} \)
\( \mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

Math Bold Italic
\( \mathbfit{abcdefghijklmnopqrstuvwxyz} \)
\( \mathbfit{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

Math Sans Italic
\( \mathsfit{abcdefghijklmnopqrstuvwxyz} \)
\( \mathsfit{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

Math Sans
\( \mathsf{abcdefghijklmnopqrstuvwxyz} \)
\( \mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

Math Bold
\( \mathbf{abcdefghijklmnopqrstuvwxyz} \)
\( \mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

Math Sans Bold Italic
\( \mathsfbfit{abcdefghijklmnopqrstuvwxyz} \)
\( \mathsfbfit{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

Math Vector Symbol
\( \vectorsym{abcdefghijklmnopqrstuvwxyz} \)
\( \vectorsym{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

Math Tensor Symbol
\( \tensorsym{abcdefghijklmnopqrstuvwxyz} \)
\( \tensorsym{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)
 
Math Matrix Symbol
\( \matrixsym{abcdefghijklmnopqrstuvwxyz} \)
\( \matrixsym{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

Math Bold Symbol
\( \boldsymbol{abcdefghijklmnopqrstuvwxyz} \)
\( \boldsymbol{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

Math Bold Symbol
\( \boldsymbol{\alpha\beta\gamma\delta\epsilon\varepsilon\zeta\eta\theta\vartheta
  \iota\kappa\lambda\mu\nu\xi o\pi\varpi\rho\varrho\sigma\varsigma\tau\upsilon\phi
  \varphi\chi\psi\omega} \)
\( \boldsymbol{\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega} \)

Math Bold Symbol
\( \boldsymbol{d \nabla \partial \times \otimes \cdot \bullet} \)
 
Galileo found that \( \mathsfbfit{g} \approx \vectoracceleration{0,-9.8,0} \), the magnitude of which
is \( \magvect{g} \approx \acceleration{9.8} \). The magnitude of the ball's velocity is \( \magvect{v} = \velocity{5}\).

We can represent this machine with a label and two slots \( \textbf{\textsf{dot}}(\slot,\slot) \) while remembering that the slots encode information about basis elements. The dot product of two vectors \( \vectorsym{a}\) and \(\vectorsym{b} \) can be represented as \( \textbf{\textsf{dot}}(\slot[\vectorsym{a}],\slot[\vectorsym{\mu}]) \). We could also call a label a machine as \( \textbf{\textsf{metric}}(\slot,\slot) \).

\lipsum*[1][1-6]

\end{document}

MWE 的输出

更新:我发现使用该arev包几乎可以得到我想要的东西。一个问题是这似乎会破坏isomath tensorsym字体,但可能有办法解决这个问题。这是更新后的 MWE 及其输出。

\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage{arev}
\usepackage{mandi}
\usepackage[OMLmathbf,OMLmathsfit]{isomath}
\usepackage{tensor}
\usepackage{lipsum}
\usepackage{geometry}
\geometry{margin=0.25in,top=0.25in,bottom=0.25in}
\pagestyle{empty}

\newcommand*{\slot}[1][~]{\,\underline{\smash{\makebox[1.5em]{\ensuremath{#1}}}}\,}

\begin{document}
\begin{align} 
  &\pi \text{ and } \mathrm{e} \text{ and } \mathrm{i} \text{ and } 
     \mathrm{d} \text{ and } \mathrm{\Delta} \\
  &\textbf{\textsf{dot}}(\slot,\slot) \text{ becomes } 
     \textbf{\textsf{dot}}(\slot[\vectorsym{a}],\slot[\vectorsym{p}]) \text{ or } 
     \vectorsym{a}\cdot\vectorsym{p} \\
  &\textbf{\textsf{cross}}(\slot,\slot,\slot) \text{ or } 
     \vectorsym{\epsilon}(\slot,\slot,\slot) \text{ or } \vectorsym{a}\times\vectorsym{b} \\
  &\tensorsym{T} \text{ or } \vectorsym{T} \text{ or } \mathsfit{T}\indices{^i^j} \\
  &\tensorsym{I} \text{ or } \vectorsym{I} \text{ or } \mathsfit{I}\indices{_i_j} \\
  &\tensorsym{g} \text{ or } \vectorsym{g} \text{ or } \mathsfit{g}\indices{_i_j} \\
  &\tensorsym{g}(\slot,\slot) \text{ or } \vectorsym{g}(\slot,\slot)              \\
  &\vectorsym{a} = a^i \vectorsym{e}_i = a^1\vectorsym{e}_1 + a^2\vectorsym{e}_2 + 
     a^3\vectorsym{e}_3 \\
  &\textbf{\textsf{T}}(\slot,\slot) = \mathsfit{T}\indices{^i^j}\vectorsym{e}_i\otimes\vectorsym{e}_j \\
  &\tensorsym{g}\indices{^\mu_\nu} \neq \tensorsym{g}\indices{_\mu_\nu}
\end{align}

\begin{tabular}{l l}
Text Italic Sans & \textsf{\textit{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ}} \\
Text Bold Sans   & \textbf{\textsf{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ}} \\
Text Bold Up     & \textbf{\textup{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ}} \\
                 &                                                                        \\
Math             & \( abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \)             \\
Math Greek       & \( \alpha\beta\gamma\delta\epsilon\varepsilon\zeta\eta\theta\vartheta\iota\kappa
                      \lambda\mu\nu\xi o\pi\varpi\rho\varrho\sigma\varsigma\tau\upsilon\phi\varphi
                      \chi\psi\omega\Delta\Gamma\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega \) \\
Math Roman       & \( \mathrm{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} \)             \\
Math Bold Italic & \( \mathbfit{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} \)           \\
Math Sans Italic & \( \mathsfit{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} \)           \\
Math Sans        & \( \mathsf{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} \)             \\
Math Bold        & \( \mathbf{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} \)             \\
Math Sans Bold Italic & \( \mathsfbfit{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} \)    \\
Math Vector Symbol    & \( \vectorsym{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} \)     \\
Math Matrix Symbol    & \( \matrixsym{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} \)     \\
Math Tensor Symbol    & \( \tensorsym{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} \)     \\
Math Bold Symbol      & \( \boldsymbol{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} \)    \\
Math Bold Symbol      & \( \boldsymbol{\alpha\beta\gamma\delta\epsilon\varepsilon\zeta\eta\theta\vartheta
                           \iota\kappa\lambda\mu\nu\xi o\pi\varpi\rho\varrho\sigma\varsigma\tau\upsilon\phi
                           \varphi\chi\psi\omega\Delta\Gamma\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi
                           \Omega} \) \\
Other                 & \( \nabla\,\boldsymbol{\nabla}\,\partial\,\boldsymbol{\partial}\,\otimes\,
                           \boldsymbol{\otimes}\,\cdot\,\boldsymbol{\cdot}\,\bullet\,\boldsymbol{\bullet}\,
                           \slot\,\slot[\vectorsym{a}] \) \\
                      &                                                                        \\
\end{tabular}

Galileo found that \( \mathsfbfit{g} \approx \vectoracceleration{0,-9.8,0} \), the magnitude of which
is \( \magvect{g} \approx \acceleration{9.8} \). The magnitude of the ball's velocity is \( \magvect{v} = \velocity{5}\).

We can represent this machine with a label and two slots \( \textbf{\textsf{dot}}(\slot,\slot) \) while remembering that the slots encode information about basis elements. The dot product of two vectors \( \vectorsym{a}\) and \(\vectorsym{b} \) can be represented as \( \textbf{\textsf{dot}}(\slot[\vectorsym{a}],\slot[\vectorsym{b}]) \) or \( \textbf{\textsf{g}}(\slot[\vectorsym{a}],\slot[\vectorsym{b}]) \) or \( \textbf{\textsf{metric}}(\slot[\vectorsym{a}],\slot[\vectorsym{b}]) \).

\lipsum*[1][1-6]

\end{document}

更新后的 MWE 输出

答案1

您可以将文本模式字形与 一起使用\textnormal{\itshape foo}\textnormal{\bfseries foo}等等。您还可以使用\mathit代替默认的\mathnormal

在 中fontspec,您可以重新定义\mathrm\mathit\mathbf等。在 中unicode-math,您可以使用 将任何文本字体的精确字形映射到任何数学字母range=。在 中mathspec,您可以在数学模式下使用任何桌面字体。在 中isomath,您可以为每个数学字母选择一个字体系列。在 中mathastext,您可以将当前文本字体转换为数学字体。

您也可以通过声明数学字母来以困难的方式做到这一点。我的建议是,如果可以,使用现代工具链和 LuaTeX,unicode-math如果必须,则使用传统的 8 位字体,尽管这里并不是所有人都同意我的观点。

相关内容