1

I have already tried {ctexbeamer}/{beamer}+{ctex} , {amssymb}. The function works well in my ctexart environment. Why won't it work in beamer?

My code:

% 中文ppt
\documentclass[10.5pt,UTF8]{beamer}

\usepackage{ctex}

% 英文ppt

%\documentclass[UTF8]{beamer}

% ppt 模板风格

\usetheme{Warsaw}

\usepackage{geometry}

% 数学公式

\usepackage{amsmath}

\usepackage{amssymb}

\usepackage{stix2}    % 包含 \leftrightarrowaccent{T} 用双向箭头表示张量

% 文献引用

\usepackage{cite}

% 图片引用

\usepackage{graphicx}

% 引用高亮(beamer默认使用,添加引用报错)

% \usepackage[backref]{hyperref}

% 文献引用存在下划线

\usepackage[strings]{underscore}

\setbeamertemplate{bibliography item}[text]

%\usepackage{comment}

\title{开题报告}

\subtitle{mysubject}

\author{myname}

\institute[*]{ my school}

\date{\today}

\begin{document}

...codes before...

        \begin{frame}

            \frametitle{流体动力学基本方程}

            \begin{itemize}

                \item 流体动力学基本方程

                \item 质量方程:

                \begin{equation}

                    \begin{cases}

                        \frac{\partial}{\partial t} \rho + \nabla \cdot 
(\rho \vec{u}) = 0 

                    \end{cases}

                \end{equation}

                \item 动量方程:

                \item 能量方程:

            \end{itemize}

        \end{frame}

...codes after...

\end{document}

enter image description here enter image description here enter image description here

10
  • Welcome. Sho a complete document, please.
    – mickep
    Nov 14, 2023 at 8:56
  • 1
    No-one have any idea what you are talking about here. Provide a full but minimal example that others can copy and test as is.
    – daleif
    Nov 14, 2023 at 8:56
  • Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for the users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Nov 14, 2023 at 8:58
  • I wanted to add a picture here but I don't know how... I just register an account 10 min before I asked this question
    – Toby
    Nov 14, 2023 at 9:22
  • @Toby Please don't remove the code indentation. Without it, syntax highlighting etc. does not work. Nov 14, 2023 at 9:39

1 Answer 1

1

Two possible solutions:

Use the professionalfonts beamer font theme:

% !TeX TS-program = lualatex
\documentclass{beamer}

\usetheme{Warsaw}

\usefonttheme{professionalfonts}
\usepackage{stix2}    % 包含 \leftrightarrowaccent{T} 用双向箭头表示张量

\begin{document}
        \begin{frame}
                \begin{equation}
                    \begin{cases}
                        \frac{\partial}{\partial t} \rho + \nabla \cdot (\rho \vec{u}) = 0 
                    \end{cases}
                \end{equation}
        \end{frame}
\end{document}

enter image description here

Remove the stix2 package:

% !TeX TS-program = lualatex
\documentclass{beamer}

\usetheme{Warsaw}

%\usepackage{stix2}    % 包含 \leftrightarrowaccent{T} 用双向箭头表示张量

\begin{document}
        \begin{frame}
                \begin{equation}
                    \begin{cases}
                        \frac{\partial}{\partial t} \rho + \nabla \cdot (\rho \vec{u}) = 0 
                    \end{cases}
                \end{equation}
        \end{frame}
\end{document}

enter image description here

4
  • Thank you very much. I tried "Remove the stix2 package" and it seems helpful. I am still wondering why it doesn't work in a beamer file; it works farely well in my ctexart file.(article + ctex)
    – Toby
    Nov 14, 2023 at 10:00
  • Again I tried "Use the professionalfonts beamer font theme". It also works well. Thx again.
    – Toby
    Nov 14, 2023 at 10:07
  • @Toby Which one to choose will depend on which font you prefer. Nov 14, 2023 at 10:12
  • Yeah I see... I would choose professionalfonts, because \leftrightarrowaccent{T} looks far better than \vec{\vec{T}}. lol
    – Toby
    Nov 14, 2023 at 10:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .