投影机中的跳跃符号

投影机中的跳跃符号

我用一组方程式和一些颜色效果制作了下面的幻灯片,以突出显示单个符号。它基本上可以正常工作,但不知何故,符号在某些转换中会跳跃,例如 1 -> 2 或 4 -> 5。我认为这\textcolor就是问题所在。这里,提到\textcolor在数学模式下有一些副作用,但是给出的宏并没有解决问题。

代码看起来相当混乱。这主要是由于个别情况和我试图修复问题所致。例如,我添加了\textcolor{black}所有不应突出显示的符号。

非常欢迎任何建议。

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{color}
\usepackage{tikz}

\begin{document}

\begin{frame}
\frametitle{Some title}
\begin{itemize}
\item Some text
{\footnotesize
\begin{align*}
% First equation
\only<2>{\textcolor{blue}{\hat{\boldsymbol{x}}}(t) &= \textcolor{black}{f \left( \textcolor{blue}{\boldsymbol{x}}(t - 1) \right)} & \\}
\only<3>{\textcolor{black}{\hat{\boldsymbol{x}}}(t) &= \textcolor{blue}{f \left( \boldsymbol{x}(t - 1) \right)} & \\}
\only<1,4->{\textcolor{black}{\hat{\boldsymbol{x}}}(t) &= \textcolor{black}{f \left( \boldsymbol{x}(t - 1) \right)} & \\}
% Second equation
\only<2>{\textcolor{blue}{\tilde{\boldsymbol{x}}}(t) &= \textcolor{blue}{\hat{\boldsymbol{x}}}(t) + \textcolor{black}{\boldsymbol{K}_f}(t) \left[ \textcolor{black}{\boldsymbol{z}}(t) - \textcolor{black}{h \left( \textcolor{blue}{\hat{\boldsymbol{x}}}(t) \right)} \right] & \\}
\only<4>{\textcolor{black}{\tilde{\boldsymbol{x}}}(t) &= \textcolor{black}{\hat{\boldsymbol{x}}}(t) + \textcolor{black}{\boldsymbol{K}_f}(t) \left[ \textcolor{blue}{\boldsymbol{z}}(t) - \textcolor{black}{h \left( \hat{\boldsymbol{x}}(t) \right)} \right] & \\}
\only<5>{\textcolor{black}{\tilde{\boldsymbol{x}}}(t) &= \textcolor{black}{\hat{\boldsymbol{x}}}(t) + \textcolor{black}{\boldsymbol{K}_f}(t) \left[ \textcolor{black}{\boldsymbol{z}}(t) - \textcolor{blue}{h \left( \hat{\boldsymbol{x}}(t) \right)} \right] & \\}
\only<6>{\textcolor{black}{\tilde{\boldsymbol{x}}(t)} &= \textcolor{black}{\hat{\boldsymbol{x}}(t)} + \textcolor{blue}{\boldsymbol{K}_f}(t) \left[ \textcolor{black}{\boldsymbol{z}(t)} - \textcolor{black}{h \left( \hat{\boldsymbol{x}}(t) \right)} \right] & \\}
\only<1,3,7->{\textcolor{black}{\tilde{\boldsymbol{x}}}(t) &= \textcolor{black}{\hat{\boldsymbol{x}}}(t) + \textcolor{black}{\boldsymbol{K}_f}(t) \left[ \textcolor{black}{\boldsymbol{z}}(t) - \textcolor{black}{h \left( \hat{\boldsymbol{x}}(t) \right)} \right] & \\}
% Third equation
\only<2>{\textcolor{blue}{\boldsymbol{x}}(t) &= \textcolor{blue}{\tilde{\boldsymbol{x}}}(t) + \textcolor{black}{\boldsymbol{K}_s}(t) \left[ \textcolor{blue}{\boldsymbol{x}}(t + 1) - \textcolor{black}{f \left( \textcolor{blue}{\tilde{\boldsymbol{x}}}(t) \right)} \right]}
\only<3>{\textcolor{black}{\boldsymbol{x}}(t) &= \textcolor{black}{\tilde{\boldsymbol{x}}}(t) + \textcolor{black}{\boldsymbol{K}_s}(t) \left[ \textcolor{black}{\boldsymbol{x}}(t + 1) - \textcolor{blue}{f \left( \tilde{\boldsymbol{x}}(t) \right)} \right]}
\only<6>{\textcolor{black}{\boldsymbol{x}}(t) &= \textcolor{black}{\tilde{\boldsymbol{x}}}(t) + \textcolor{blue}{\boldsymbol{K}_s}(t) \left[ \textcolor{black}{\boldsymbol{x}}(t + 1) - \textcolor{black}{f \left( \tilde{\boldsymbol{x}}(t) \right)} \right]}
\only<1,4-5,7->{\textcolor{black}{\boldsymbol{x}}(t) &= \textcolor{black}{\tilde{\boldsymbol{x}}}(t) + \textcolor{black}{\boldsymbol{K}_s}(t) \left[ \textcolor{black}{\boldsymbol{x}}(t + 1) - \textcolor{black}{f \left( \tilde{\boldsymbol{x}}(t) \right)} \right]}
\end{align*}
\def\arraystretch{1.1}
\begin{tabular}{@{}ll@{}}
\only<2>{\\[-\normalbaselineskip]\textcolor{blue}{$\boldsymbol{x}$} & \textcolor{blue}{state vector (joint trajectories)} \\}
\only<1,3->{\\[-\normalbaselineskip]$\boldsymbol{x}$ & state vector (joint trajectories) \\}
\only<4>{\\[-\normalbaselineskip]\textcolor{blue}{$\boldsymbol{z}$} & \textcolor{blue}{measurement vector (marker trajectories)} \\}
\only<1-3,5->{\\[-\normalbaselineskip]$\boldsymbol{z}$ & measurement vector (marker trajectories) \\}
\only<3>{\\[-\normalbaselineskip]\textcolor{blue}{$f(\boldsymbol{x})$} & \textcolor{blue}{process model (constant jerk)} \\}
\only<1-2,4->{\\[-\normalbaselineskip]$f(\boldsymbol{x})$ & process model (constant jerk) \\}
\only<5>{\\[-\normalbaselineskip]\textcolor{blue}{$h(\boldsymbol{x})$} & \textcolor{blue}{measurement model (forward kinematics)} \\}
\only<1-4,6->{\\[-\normalbaselineskip]$h(\boldsymbol{x})$ & measurement model (forward kinematics) \\}
\only<6>{\\[-\normalbaselineskip]\textcolor{blue}{$\boldsymbol{K}_f$, $\boldsymbol{K}_s$} & \textcolor{blue}{filter and smoother gains}}
\only<1-5,7->{\\[-\normalbaselineskip]$\boldsymbol{K}_f$, $\boldsymbol{K}_s$ & filter and smoother gains}
\end{tabular}
}
\end{itemize}

\begin{tikzpicture}[remember picture, overlay]
\node[anchor=north east, align=left] at (current page.north east) {
\scriptsize
$\begin{aligned}
\only<2>{\textcolor{blue}{\boldsymbol{x}}_i(t) &= \begin{bmatrix} q_i(t) & \dot{q}_i(t) & \ddot{q}_i(t) & \dddot{q}_i(t) \end{bmatrix}^T \\}
\only<1,3->{\boldsymbol{x}_i(t) &= \begin{bmatrix} q_i(t) & \dot{q}_i(t) & \ddot{q}_i(t) & \dddot{q}_i(t) \end{bmatrix}^T \\}
\only<3>{\textcolor{blue}{f_i \left( \boldsymbol{x}_i(t) \right)} &= \begin{bmatrix}
1 & \Delta t & \frac{\Delta t^2}{2} & \frac{\Delta t^3}{6}\\
0 & 1 & \Delta t & \frac{\Delta t^2}{2}\\
0 & 0 & 1 & \Delta t\\
0 & 0 & 0 & 1\\
\end{bmatrix} \boldsymbol{x}_i(t) \\}
\only<1-2,4->{f_i \left( \boldsymbol{x}_i(t) \right) &= \begin{bmatrix}
1 & \Delta t & \frac{\Delta t^2}{2} & \frac{\Delta t^3}{6}\\
0 & 1 & \Delta t & \frac{\Delta t^2}{2}\\
0 & 0 & 1 & \Delta t\\
0 & 0 & 0 & 1\\
\end{bmatrix} \boldsymbol{x}_i(t) \\}
i &= 1 \dots 36
\end{aligned}$
};
\end{tikzpicture}
\end{frame}

\end{document}

答案1

如果我从你的代码中删除所有\left内容,则不会跳跃。\right

他们除了制造问题之外,真的没有做任何好事。

答案2

像这样在数学模式和文本模式之间切换,会让你的生活变得太复杂。请尝试这样做。

\documentclass{beamer}

\usepackage{amsmath}
\usepackage{xcolor}


\newcommand{\blubold}[1]{{\color{blue}\boldsymbol{#1}}}


\begin{document}

    \begin{frame}
        \frametitle{Some title}
        \begin{itemize}
            \item $\blubold{x}$
        \end{itemize}
        \end{frame}

\end{document}

相关内容