请问一下大佬们,在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}
可以看到这里的正文字体并没有变成Times New Roman
字体,公式也没有用到mtpro2
宏包的字体。
请各位大佬指教。这个模板来自于知乎
请雾月大佬赐教@u10307
现在数学字体被应用为了
mtpro2
宏包的字体,但是正文字体没有变化@u25914 你想改成什么字体?如果是
helvet
就是现在这样。如果是ptm
,把\usefonttheme{professionalfonts}
改成\usefonttheme{serif}
。@u10307 我想改成使用
newtxtext
的字体或者别的Times
字体,或者使用默认字体,但是我看黄老师中译版的手册里默认字体的效果和我得到的效果不太一样:黄老师的手册,这是我的设置问题么,他这里用的serif字体好像得到的效果也不太一样:
@u25914 图片里,
default
主题的字体是helvet
宏包的效果,serif
是ptm
字体。你想要前者,只需改动数学字体:
\usefonttheme{professionalfonts}
,后者还要加上\usefonttheme{serif}
,它也会把数学字体修改为mtpro2
。