Beamer中正文及数学字体的设置问题?

发布于 2024-03-25 21:08:41

请问一下大佬们,在beamer中我想修改正文字体和数学字体,引入了相应的宏包,但是好像不起作用?请问该怎么办呢?mtpro2这些字体宏包是无法再beamer中使用吗?

\documentclass[aspectratio=169,noamssymb]{beamer}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\renewcommand{\rmdefault}{ptm}
\usepackage[scaled=0.92]{helvet}
\usepackage{graphics}
\hypersetup{
  colorlinks,
  breaklinks=true,
  unicode,
  linktoc = all,
  bookmarksopen = true,
  bookmarksnumbered = true,
  pdfkeywords = {LaTeX, typesetting},
  pdftitle = {LaTeX typesetting},
  pdfauthor = {Tsiayi Gong},
  colorlinks = true,
  citecolor = blue,
  linkcolor = blue,
  urlcolor = blue,
  pdfborder = {0 0 0},
  linktocpage = false,
  pdfstartview=FitH
}
\usepackage{amsmath}
\usepackage{mtpro2}
\usepackage[scheme=plain]{ctex}

% 目录标数字
\setbeamertemplate{section in toc}[sections numbered] 
% 无序列表用实心点
\setbeamertemplate{itemize item}{$\bullet$}
% 设置每页标题格式
\setbeamertemplate{frametitle}
  {\vspace{0.1cm}
   \insertframetitle
   \vspace{-0.5cm}}
% 去掉下面没用的导航条
\setbeamertemplate{navigation symbols}{}
% 设置页脚格式
\makeatother
\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.4\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor
  \end{beamercolorbox}

  \begin{beamercolorbox}[wd=.6\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle\hspace*{13em}
    \insertframenumber{} / \inserttotalframenumber\hspace*{0ex}
  \end{beamercolorbox}}

  \vskip0pt%
}
\makeatletter


% 定义颜色
%\definecolor{alizarin}{rgb}{0.82, 0.1, 0.26} % 红色
%\definecolor{DarkFern}{HTML}{407428} % 绿色
%\colorlet{main}{DarkFern!100!white} % 第一种设置方法
%\colorlet{main}{red!70!black} % 第二种设置方法
\definecolor{bistre}{rgb}{0.24, 0.17, 0.12} % 黑色
\definecolor{mygrey}{rgb}{0.52, 0.52, 0.51} % 灰色
\colorlet{main}{green!50!black}
\colorlet{text}{bistre!100!white}

% 不同元素指定不同颜色,fg是本身颜色,bg是背景颜色,!num!改变数值提供渐变色
\setbeamercolor{title}{fg=main}
\setbeamercolor{frametitle}{fg=main}
\setbeamercolor{section in toc}{fg=text}
\setbeamercolor{normal text}{fg=text}
\setbeamercolor{block title}{fg=main,bg=mygrey!14!white}
\setbeamercolor{block body}{fg=black,bg=mygrey!10!white}
\setbeamercolor{qed symbol}{fg=main} % 证明结束后的框颜色
\setbeamercolor{math text}{fg=black}
% 设置页脚对应位置颜色
\setbeamercolor{author in head/foot}{fg=black, bg=mygrey!5!white}
\setbeamercolor{title in head/foot}{fg=black, bg=mygrey!5!white}
\setbeamercolor{structure}{fg=main, bg=mygrey!10!white} % 设置sidebar颜色



%-------------------正文-------------------------%

\author{Your Name}
\title{Presentation Title}
\date{January 1, 2018}

\begin{document}

\frame[plain]{\titlepage}

\begin{frame}
\frametitle{Outline}
\tableofcontents
\end{frame}

\section{Page Title}

\frame{\frametitle{Outline}\tableofcontents[currentsection]}

\begin{frame}
\frametitle{Page Title}

TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems.

\vspace{0.4cm}

unordered list below

\begin{itemize}
\item The first item
\item The second item
\item The third item
\item The fourth item
\end{itemize}

\end{frame}

\section{Display Theorem}

\frame{\frametitle{Outline}\tableofcontents[currentsection]}

\subsection{first subsection}

\subsection{second subsection}



\begin{frame}
  \frametitle{Display Theorem}
  \begin{theorem}
    $1 + 2 = 3$
  \end{theorem}
  \begin{proof}
    $$1 + 1 = 2$$
    $$1 + 1 + 1 = 3$$
  \end{proof}
\end{frame}

\section{Sample frame title}

\frame{\frametitle{Outline}\tableofcontents[currentsection]}

\begin{frame}
\frametitle{Sample frame title}
This is a text in second frame.
For the sake of showing an example.

\begin{itemize}
 \item Text visible on slide 1
 \item Text visible on slide 2
 \item Text visible on slide 3
\end{itemize}

\vspace{0.3cm}

another example

\begin{itemize}\itemsep0em
 \item Text visible on slide 1
 \item Text visible on slide 2
 \item Text visible on slide 3
\end{itemize}
\end{frame}

\begin{frame}
  \begin{proof}
    $$
 \frac{1}{\displaystyle 1+
   \frac{1}{\displaystyle 2+
   \frac{1}{\displaystyle 3+x}}} +
 \frac{1}{1+\frac{1}{2+\frac{1}{3+x}}}
$$
$$\int_0^\infty e^{-x^2} dx=\frac{\sqrt{\pi}}{2}$$
\begin{equation} x=y+3 \label{eq:xdef}
\end{equation}
In equation (\ref{eq:xdef}) we saw $\dots$
  \end{proof}
\end{frame}


\end{document}

image.png

image.png

可以看到这里的正文字体并没有变成Times New Roman字体,公式也没有用到mtpro2 宏包的字体。
请各位大佬指教。这个模板来自于知乎

请雾月大佬赐教@u10307

查看更多

关注者
0
被浏览
1.6k
雾月
雾月 2024-03-25
这家伙很懒,什么也没写!

在导言区加上 \usefonttheme{professionalfonts}。可以放在 \usepackage{mtpro2} 前一行。

2 个回答
LaTeXStudio
LaTeXStudio 2024-03-25
这家伙很懒,什么也没写!

那个字体是要付费购买的字体,一般用户电脑都没有的。最好去掉。

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览