一次一张幻灯片,对一系列不等式上方的不等式进行注释

一次一张幻灯片,对一系列不等式上方的不等式进行注释

我正在尝试编写具有以下特征的不等式链:首先,在连续的幻灯片上,我希望突出显示(例如,使用 tcolorbox)连续的不等式,并在其上方注释一些解释。我目前正在尝试使用 stackrel 来实现此目的,但它不会突出显示内容,也不会使用数学进行注释(即,如果注释中包含数学,LaTeX 会引发编译错误)。其次,我希望在我进行突出显示时,此不等式链上方的数学显示为灰色(反之亦然,当我显示上方的数学块时,不等式链应该显示为灰色)。

我也尝试使用 hf-tikz,但我认为它需要使用数组,并且我无法使用数组使所有内容很好地对齐。

\documentclass{beamer}
\mode<presentation>
{
%  \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
%  \usecolortheme{default} % or try albatross, beaver, crane, ...
%  \usefonttheme{default}  % or try serif, structurebold, ...
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
}

\usepackage{verbatim}
\usepackage{tikz}
\usepackage{booktabs}
\usetikzlibrary{matrix,overlay-beamer-styles}

\definecolor{myorange}{rgb}{.98, .59, .01}
\definecolor{myyellow}{rgb}{1, .78, .33}
\definecolor{myblue}{rgb}{.18, .63, .78}
%%%%%%%%%
\usetikzlibrary{calc}
\definecolor{pbblue}{HTML}{0A75A8}% color for the progress bar and the circle

\makeatletter
\def\progressbar@progressbar{} % the progress bar
\newcount\progressbar@tmpcounta% auxiliary counter
\newcount\progressbar@tmpcountb% auxiliary counter
\newdimen\progressbar@pbht %progressbar height
\newdimen\progressbar@pbwd %progressbar width
\newdimen\progressbar@rcircle % radius for the circle
\newdimen\progressbar@tmpdim % auxiliary dimension

\progressbar@pbwd=\linewidth
\progressbar@pbht=1pt
\progressbar@rcircle=2.5pt

% the progress bar
\def\progressbar@progressbar{%

    \progressbar@tmpcounta=\insertframenumber
    \progressbar@tmpcountb=\inserttotalframenumber
    \progressbar@tmpdim=\progressbar@pbwd
    \multiply\progressbar@tmpdim by \progressbar@tmpcounta
    \divide\progressbar@tmpdim by \progressbar@tmpcountb

  \begin{tikzpicture}
    \draw[pbblue!30,line width=\progressbar@pbht]
      (0pt, 0pt) -- ++ (\progressbar@pbwd,0pt);

    \filldraw[pbblue!30] %
      (\the\dimexpr\progressbar@tmpdim-\progressbar@rcircle\relax, .5\progressbar@pbht) circle (\progressbar@rcircle);

    \node[draw=pbblue!30,text width=3.5em,align=center,inner sep=1pt,
      text=pbblue!70,anchor=east] at (0,0) {\insertframenumber/\inserttotalframenumber};
  \end{tikzpicture}%
}

\addtobeamertemplate{headline}{}
{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=4ex,center,dp=1ex]{white}%
    \progressbar@progressbar%
  \end{beamercolorbox}%
}
\makeatother
%%%%%%%%%%%
\begin{document}
\section{Proofs}
\begin{frame}[t]{Step 3: Packing Potential Tracking}
\textit{Proof.} Motivation 
\begin{align*}
f(x) &= g(x)\\
                        &\leq r(x) &&\text{//$a_j \leq 1/16, \therefore e^{a_j} \leq 1 + a_j + a_j^2$}&\\
                        &\leq m(x) &&\text{//$a^2_j \leq g_j$} 
\end{align*}
Sum over all $j$, take logarithm, and use $\log (1+x)\leq x$.% To see the bounds on $a_j$ and $a^2_j$: 
\[a_j \stackrel{def1}{=} stuff \stackrel{def2}{\leq} stuff \stackrel{def3}{\leq} stuff \stackrel{def4}{\leq}stuff.\] 
\end{frame}


\end{document}

具体来说,我希望首先显示数学块 $f(x)\leq.... m(x)$,同时将其下方的链变灰。然后,我希望该块变灰,def1、def2 等中的每一个都以突出显示的形式显示在连续的幻灯片中,并能够在注释中写一点数学。谢谢!

答案1

我只是添加了\unvovers,\setbeamercovered{transparent}\stackrel用 overset 替换以获得

\documentclass{beamer}
\mode<presentation>
{
%  \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
%  \usecolortheme{default} % or try albatross, beaver, crane, ...
%  \usefonttheme{default}  % or try serif, structurebold, ...
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
}

\usepackage{verbatim}
\usepackage{tikz}
\usepackage{booktabs}
\usetikzlibrary{matrix,overlay-beamer-styles}

\definecolor{myorange}{rgb}{.98, .59, .01}
\definecolor{myyellow}{rgb}{1, .78, .33}
\definecolor{myblue}{rgb}{.18, .63, .78}
%%%%%%%%%
\usetikzlibrary{calc}
\definecolor{pbblue}{HTML}{0A75A8}% color for the progress bar and the circle

\makeatletter
\def\progressbar@progressbar{} % the progress bar
\newcount\progressbar@tmpcounta% auxiliary counter
\newcount\progressbar@tmpcountb% auxiliary counter
\newdimen\progressbar@pbht %progressbar height
\newdimen\progressbar@pbwd %progressbar width
\newdimen\progressbar@rcircle % radius for the circle
\newdimen\progressbar@tmpdim % auxiliary dimension

\progressbar@pbwd=\linewidth
\progressbar@pbht=1pt
\progressbar@rcircle=2.5pt

% the progress bar
\def\progressbar@progressbar{%

    \progressbar@tmpcounta=\insertframenumber
    \progressbar@tmpcountb=\inserttotalframenumber
    \progressbar@tmpdim=\progressbar@pbwd
    \multiply\progressbar@tmpdim by \progressbar@tmpcounta
    \divide\progressbar@tmpdim by \progressbar@tmpcountb

  \begin{tikzpicture}
    \draw[pbblue!30,line width=\progressbar@pbht]
      (0pt, 0pt) -- ++ (\progressbar@pbwd,0pt);

    \filldraw[pbblue!30] %
      (\the\dimexpr\progressbar@tmpdim-\progressbar@rcircle\relax, .5\progressbar@pbht) circle (\progressbar@rcircle);

    \node[draw=pbblue!30,text width=3.5em,align=center,inner sep=1pt,
      text=pbblue!70,anchor=east] at (0,0) {\insertframenumber/\inserttotalframenumber};
  \end{tikzpicture}%
}

\addtobeamertemplate{headline}{}
{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=4ex,center,dp=1ex]{white}%
    \progressbar@progressbar%
  \end{beamercolorbox}%
}
\makeatother
%%%%%%%%%%%
\begin{document}
\section{Proofs}
\begin{frame}[t]{Step 3: Packing Potential Tracking}
\setbeamercovered{transparent}%
\uncover<1>{\textit{Proof.} Motivation 
\begin{align*}
f(x) &= g(x)\\
     &\leq r(x) &&\text{//$a_j \leq 1/16, \therefore e^{a_j} \leq 1
 + a_j + a_j^2$}&\\
    &\leq m(x) &&\text{//$a^2_j \leq g_j$} 
\end{align*}
Sum over all $j$, take logarithm, and use $\log (1+x)\leq x$.}% To see the bounds on $a_j$ and $a^2_j$: 
\uncover<2->{\[a_j \overset{def1}{=} stuff 
\uncover<2,4->{\overset{def2}{\leq} stuff}
\uncover<2,5->{\overset{def3}{\leq} stuff}
\uncover<2,6->{\overset{def4}{\leq}stuff.}\]}
\end{frame}
\end{document}

在此处输入图片描述

附录

\documentclass{beamer}
\mode<presentation>
{
%  \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
%  \usecolortheme{default} % or try albatross, beaver, crane, ...
%  \usefonttheme{default}  % or try serif, structurebold, ...
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
}

\usepackage{verbatim}
\usepackage{tikz}
\usepackage{booktabs}
\usetikzlibrary{matrix,overlay-beamer-styles,tikzmark,fit}

\definecolor{myorange}{rgb}{.98, .59, .01}
\definecolor{myyellow}{rgb}{1, .78, .33}
\definecolor{myblue}{rgb}{.18, .63, .78}
%%%%%%%%%
\usetikzlibrary{calc}
\definecolor{pbblue}{HTML}{0A75A8}% color for the progress bar and the circle

\makeatletter
\def\progressbar@progressbar{} % the progress bar
\newcount\progressbar@tmpcounta% auxiliary counter
\newcount\progressbar@tmpcountb% auxiliary counter
\newdimen\progressbar@pbht %progressbar height
\newdimen\progressbar@pbwd %progressbar width
\newdimen\progressbar@rcircle % radius for the circle
\newdimen\progressbar@tmpdim % auxiliary dimension

\progressbar@pbwd=\linewidth
\progressbar@pbht=1pt
\progressbar@rcircle=2.5pt

% the progress bar
\def\progressbar@progressbar{%

    \progressbar@tmpcounta=\insertframenumber
    \progressbar@tmpcountb=\inserttotalframenumber
    \progressbar@tmpdim=\progressbar@pbwd
    \multiply\progressbar@tmpdim by \progressbar@tmpcounta
    \divide\progressbar@tmpdim by \progressbar@tmpcountb

  \begin{tikzpicture}
    \draw[pbblue!30,line width=\progressbar@pbht]
      (0pt, 0pt) -- ++ (\progressbar@pbwd,0pt);

    \filldraw[pbblue!30] %
      (\the\dimexpr\progressbar@tmpdim-\progressbar@rcircle\relax, .5\progressbar@pbht) circle (\progressbar@rcircle);

    \node[draw=pbblue!30,text width=3.5em,align=center,inner sep=1pt,
      text=pbblue!70,anchor=east] at (0,0) {\insertframenumber/\inserttotalframenumber};
  \end{tikzpicture}%
}

\addtobeamertemplate{headline}{}
{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=4ex,center,dp=1ex]{white}%
    \progressbar@progressbar%
  \end{beamercolorbox}%
}
\makeatother
%%%%%%%%%%%
\begin{document}
\section{Proofs}
\begin{frame}[t]{Step 3: Packing Potential Tracking}
\setbeamercovered{transparent}%
\uncover<1>{\textit{Proof.} Motivation 
\begin{align*}
f(x) &= g(x)\\
     &\leq r(x) &&\text{//$a_j \leq 1/16, \therefore e^{a_j} \leq 1
 + a_j + a_j^2$}&\\
    &\leq m(x) &&\text{//$a^2_j \leq g_j$} 
\end{align*}
Sum over all $j$, take logarithm, and use $\log (1+x)\leq x$.}% To see the bounds on $a_j$ and $a^2_j$: 
\uncover<2->{\[\tikzmarknode{aj}{a_j} 
    \tikzmarknode{stuff3}{\overset{def1}{=} stuff}
\uncover<2,4->{\tikzmarknode{stuff4}{\overset{def2}{\leq} stuff}}
\uncover<2,5->{\tikzmarknode{stuff5}{\overset{def3}{\leq} stuff}}
\uncover<2,6->{\tikzmarknode{stuff6}{\overset{def4}{\leq} stuff}.}
\begin{tikzpicture}[overlay,remember picture]
 \foreach \X in {3,...,6}
 {\node[visible on=<\X>,draw,fit=(aj)(stuff\X)] {};}
\end{tikzpicture}\]}
\end{frame}
\end{document}

在此处输入图片描述

相关内容