Beamer doesn't render "(", "-" and "/"

Beamer doesn't render "(", "-" and "/"

当我在背面呈现此代码时:

\documentclass{beamer}

\mode<presentation> {
\setbeamertemplate{footline}[page number] 
\setbeamertemplate{navigation symbols}{} 
}

\usepackage{appendixnumberbeamer}
\usepackage{stix2}
\usepackage{url} 
\usepackage{media9}
\usepackage[croatian]{babel}
\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage{amsmath}
\def\DJ{{\fontencoding{T1}\selectfont\char208}}

\begin{document}
\begin{frame}
\frametitle{some text}
\begin{itemize}
    \item $ \mu_0 M = \chi_p\left(B_a + B_E \right)$
    \item  $\chi_p= C / T$
    \item lalalaal:
            \begin{equation}
                \chi = \frac{M}{B_a} = \frac{C}{T-C\lambda}.
            \end{equation}
\end{itemize}
\end{frame}

\end{document}

我得到(注意,第一个等式中缺少“)”,第二个等式中缺少“/”,第三个等式中缺少“-”):

使成为

我不知道我做错了什么。

答案1

在你发布的截图中,数学字体是不是Times Roman 克隆应该会暴露软件包未正确加载。您需要在运行之前stix2提供说明。\usefonttheme{professionalfonts}\usepackage{stix2}

在此处输入图片描述

\documentclass{beamer}

\mode<presentation> {
\setbeamertemplate{footline}[page number] 
\setbeamertemplate{navigation symbols}{} 
}

\usepackage{appendixnumberbeamer}
\usepackage{xurl} 
\usepackage{media9}
\usepackage[croatian]{babel}
\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage{amsmath}
\def\DJ{{\fontencoding{T1}\selectfont\char208}}

\usefonttheme{professionalfonts}
\usepackage{stix2}

\begin{document}
\begin{frame}[t]
\frametitle{some text}
\begin{itemize}
    \item $\mu_0 M = \chi_p(B_a + B_E )$
    \item $\chi_p= C / T$
    \item lalalaal:
            \begin{equation}
                \chi = \frac{M}{B_a} = \frac{C}{T-C\lambda}.
            \end{equation}
\end{itemize}
\end{frame}

\end{document}

附录:如果您想知道它的\usefonttheme{professionalfonts}作用是什么以及/或者为什么需要它,这里是用户指南第 196 页的摘录beamer

在此处输入图片描述 在此处输入图片描述

Note the final instruction. Do contact the package's maintainer(s) and ask them to add stix2 to the list of font packages which automatically prompt beamer to execute \usefonttheme{professionalfonts}.

相关内容