我正在尝试使方程式动起来。以下是我所做的。
\documentclass[9pt,final,leg,aspectratio=169,landscape]{beamer}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[absolute,overlay]{textpos}
\usepackage[skins,theorems]{tcolorbox}
\tcbset{highlight math style={enhanced,
colframe=red,colback=white,arc=0pt,boxrule=0.75pt}}
\begin{document}
\begin{frame}
\begin{itemize}
\item \textbf{Governing Equations:}\vspace{1.5ex}
\begin{itemize}
\item Mass continuity:
\begin{overprint}
\onslide<1>
\begin{equation}
\small{\frac{d}{dz} (\rho u) \; + \; 2 \rho V \; = \; 0 }
\end{equation}\vspace{1.5ex}
\item Radial momentum:
\begin{equation}
\small{\rho u\frac{dV}{dz} \; + \; \rho V^2 \; = \; -\Lambda \; + \; \frac{d}{dz} \left( \mu \frac{dV}{dz}\right) }
\end{equation}
\onslide<2>
\begin{equation}
\tcbset{highlight math/.append style={left=-1.35mm,right=-1mm,top=0mm,bottom=0mm}}
\small{\frac{d}{dz} (\rho u) \; + \; 2 \rho \underset{\let\scriptstyle\textstyle
\substack{v/r}}{\tcbhighmath{V}} \; = \; 0 }
\end{equation}\vspace{1.5ex}
\item Radial momentum:
\begin{equation}
\tcbset{highlight math/.append style={left=-1mm,right=-1mm,top=0mm,bottom=0mm}}
\small{\rho u\frac{dV}{dz} \; + \; \rho V^2 \; = \; -\underset{\let\scriptstyle\textstyle
\substack{\frac{1}{r} \frac{dp}{dr}}}{\tcbhighmath{\Lambda}} \; + \; \frac{d}{dz} \left( \mu \frac{dV}{dz}\right) }
\end{equation}
\end{overprint}
\end{itemize}
\end{itemize}
\end{frame}
\end{document}
但事实上,问题是当我添加方框来描述某些术语时,方程的位置会发生变化。但我希望方程在两张幻灯片中的位置保持不变,尽管在它们周围添加了额外的细节。
答案1
您可以使用该hf-tikz
包:
\documentclass[9pt,final,leg,aspectratio=169,landscape]{beamer}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[absolute,overlay]{textpos}
\usepackage[skins,theorems]{tcolorbox}
\tcbset{highlight math style={enhanced,
colframe=red,colback=white,arc=0pt,boxrule=0.75pt}}
\usetikzlibrary{overlay-beamer-styles}
\usepackage[beamer,customcolors]{hf-tikz}
\hfsetfillcolor{white}
\hfsetbordercolor{red}
\tikzset{h1/.style={
disable rounded corners=true,
above left offset={-0.1,0.4},
below right offset={0.1,-0.05},
},
}
\begin{document}
\begin{frame}
\begin{itemize}
\item \textbf{Governing Equations:}\vspace{1.5ex}
\begin{itemize}
\item Mass continuity:
\begin{equation}
\small{\frac{d}{dz} (\rho u) \; + \; 2 \rho \underset{\let\scriptstyle\textstyle
\visible<2->{\substack{v/r}}}{\tikzmarkin<2->[h1]{a1}V\tikzmarkend{a1}} \; = \; 0 }
\end{equation}\vspace{1.5ex}
\item Radial momentum:
\begin{equation}
\small{\rho u\frac{dV}{dz} \; + \; \rho V^2 \; = \; -\underset{\let\scriptstyle\textstyle
\substack{\visible<2->{\frac{1}{r} \frac{dp}{dr}}}}{\tikzmarkin<2->[h1]{a2}\Lambda\tikzmarkend{a2}} \; + \; \frac{d}{dz} \left( \mu \frac{dV}{dz}\right) }
\end{equation}
\end{itemize}
\end{itemize}
\end{frame}
\end{document}