我一直在使用 Beamer 编写演示文稿,并在使用环境\textrm
中发现奇怪的行为equation
。
我写以下内容:
\begin{frame}{Individual Wealth Processes}
We propose the stochastic differential equation
\begin{equation*}
\dmath X^i(t) = \mu \dmath t + \sigma\rho \dmath W^\textrm{M}(t) + \sigma \sqrt{ 1 - \rho^2} \dmath W^{i}(t)
\end{equation*}
\end{frame}
但我收到错误消息missing { inserted. \end{frame}
和。但是,当我将更missing } inserted. \end{frame}
改为时,代码可以正常编译,因此看来这是我的问题的根源。textrm
texttt
textrm
我有以下序言,它是从我基于其进行演示的先前文档中复制而来的,我想保留它,以便我可以轻松复制表格、图形、方程式等。我做了一些小的修改,使演示文稿更适合投影仪
\documentclass[hyperref={colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=blue,anchorcolor=blue}]{beamer}
\input{presentation_preamble}
\begin{document}
% ... begin frame etc ...
\end{document}
其中presentation_preamble
包含:
\usepackage{adjustbox}
\usepackage{array}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{bbm}
\usepackage{braket}
\usepackage[margin=10pt,font=small,labelfont=bf,labelsep=endash,figurewithin=section,tablewithin=section]{caption}
\usepackage{chngcntr}
\usepackage{enumerate}
\usepackage{fancyhdr}
\usepackage{fixmath}
\usepackage{float}
\usepackage{color}
\usepackage{dsfont}
\usepackage[T1]{fontenc}
\usepackage[bottom]{footmisc}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{indentfirst} % Ensures the first paragraphs are indented.
\usepackage[utf8]{inputenc}
%\usepackage{listings}
\usepackage{lmodern} % load a font with all the characters
%\usepackage{imakeidx}
\usepackage{mathtools}
\usepackage[numbers,sort&compress]{natbib}
\usepackage{parskip} % Gives nicer indenting.
\usepackage{pgf}
%\usepackage{pgfplots}
\usepackage{ragged2e}
\usepackage{subcaption}
\usepackage{textcomp}
\usepackage{tikz}
\usefonttheme{serif}
\newcommand{\dmath}{\mathop{}\!\mathrm{d}}
%\makeindex
\renewcommand{\bibname}{References}
\bibliographystyle{unsrtnat}
\justifying
\addtobeamertemplate{block begin}{}{\justifying}
%\pdfoptionpdfminorversion=7 % Supresses old PDF version warnings
\hbadness=10000 % Supresses bad box warnings
%\pgfplotsset{compat=1.12}
% Gives the nicer SQRT symbol.
\usepackage{letltxmacro}
\makeatletter
\let\oldr@@t\r@@t
\def\r@@t#1#2{%
\setbox0=\hbox{$\oldr@@t#1{#2\,}$}\dimen0=\ht0
\advance\dimen0-0.2\ht0
\setbox2=\hbox{\vrule height\ht0 depth -\dimen0}%
{\box0\lower0.4pt\box2}}
\LetLtxMacro{\oldsqrt}{\sqrt}
\renewcommand*{\sqrt}[2][\ ]{\oldsqrt[#1]{#2}}
\makeatother
%\setlength{\parindent}{15mm}
% Hopefully this avoids words being hyphenated
\pretolerance=10000
\tolerance=2000
\emergencystretch=10pt
任何帮助,将不胜感激。
答案1
beamer 重新定义了\textrm
and ,因此直接将其用作下标时会中断。您需要在其周围加上括号,或者最好使用\mathrm
。虽然\mathrm
不用括号也可以,但无论如何,最好还是习惯添加括号。
\documentclass{beamer}
\begin{document}
\begin{frame}{Individual Wealth Processes}
We propose the stochastic differential equation
\begin{equation*}
%W^\textrm{M}(t) %breaks
W^{\mathrm{M}}(t)
\end{equation*}
\end{frame}
\end{document}