让 siunitx 在本地使用通过 mathastext 选择的字体

让 siunitx 在本地使用通过 mathastext 选择的字体

我想在本地更改数学文本的字体,我可以使用包mathastext。但是,siunitx似乎不尊重这一点,如以下示例所示(使用 augie 字体)。那么,我如何才能让 siunitx 在我的示例中也使用 augie 字体呢?

\documentclass[a4paper,12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}


\usepackage{siunitx}
\sisetup{
  detect-all,
  detect-inline-family=math,
  detect-inline-weight=math,
  detect-display-math=true
}

\usepackage{amsmath}

\usepackage[subdued]{mathastext}
\MTfamily{augie}
\Mathastext[augie]


\begin{document}

{
\MTversion{augie}
This is some text and some math:
\begin{equation*}
S_n = \sum_{i=1}^n f(x_i) \Delta x_i
\end{equation*}
And here some numbers
\begin{equation*}
5\cdot 3 = 15
\end{equation*}
And now  with siunitx:
\begin{equation*}
\SI{5}{\m}\cdot \SI{3}{\m} = \SI{15}{\m\squared}
\end{equation*}  
}


The augie font should be applied only locally. 

This is some text and some math:
\begin{equation*}
S_n = \sum_{i=1}^n f(x_i) \Delta x_i
\end{equation*}
And here some numbers
\begin{equation*}
5\cdot 3 = 15
\end{equation*}
And now  with siunitx:
\begin{equation*}
\SI{5}{\m}\cdot \SI{3}{\m} = \SI{15}{\m\squared}
\end{equation*}  



\end{document}

输出:

在此处输入图片描述

相关内容