我在使用 beamer 时遇到了数学字体问题。这是我的代码
\documentclass[x11names]{beamer}
\usepackage{bm,fontenc,amsmath}
\begin{document}
\begin{frame}
\begin{equation*} h_{\mathtt{x}}(x_1,x_2) = \frac{\exp{\Big(\frac{1}{2}(\mathbf{x}-\bm{\mu})^{\mathtt{T}} \bm{\Sigma}^{-1} (\mathbf{x}-\bm{\mu})^{}\Big)}}{\sqrt{(2\pi)^2\begin{vmatrix}\bm{\Sigma}\end{vmatrix}}}
\end{equation*}
\end{frame}
\end{document}
及其输出
我怎样才能得到这样的输出
答案1
\documentclass[x11names]{beamer}
\usefonttheme[onlymath]{serif}
\usepackage{bm,fontenc,amsmath}
\begin{document}
\begin{frame}
\begin{equation*} h_{\mathtt{x}}(x_1,x_2) = \frac{\exp{\Big(\frac{1}{2}(\mathbf{x}-\bm{\mu})^{\mathtt{T}} \bm{\Sigma}^{-1} (\mathbf{x}-\bm{\mu})^{}\Big)}}{\sqrt{(2\pi)^2\begin{vmatrix}\bm{\Sigma}\end{vmatrix}}}
\end{equation*}
\end{frame}
\end{document}