一个接一个地显示向量的条目

Showing entries of a vector one after another

溢出社区!我正在研究 Latex Beamer - Document,我想不出一个漂亮的解决方案来解决我打算做的事情。

所以我有一个矢量,我想一个接一个地显示这些条目。但是当我在我的等式中使用 \pause 时,在第一步中右括号丢失了,这看起来很丑陋。所以我想要的是两个括号都可见,而向量条目则不可见。你们有解决办法吗?

\documentclass[mathserif, 10pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,bm,amsthm,graphicx,skmath}
\begin{document}
\begin{frame}
    \frametitle{Function $g$}
\[
g(x)=\begin{pmatrix} 
g_1(x)\ \vdots \ g_n(x) \ g_{n+1}(x) \ \vdots \ g_{2n}(x) \ g_{2n+1}(x)\ \vdots \ g_{3n}(x) 
\end{pmatrix} 
\pause = \begin{pmatrix} 
x_1^2 + x_{n+1}^2 - 1 \ \vdots \ x_n^2 + x_{2n}^2 - 1\ \pause -x_{2n+1}\ \vdots \ -x_{3n} \ \pause x_{2n+1}-L \ \vdots \x_{3n}-L
\end{pmatrix}
\]
\end{frame}
\end{document}

\pause是一个非常粗略的命令,为了更精细的控制你可以使用像\visible<...>{...}.

这样的命令

请注意,使用 beamer 不需要 graphicxamsmathamsthm,并且 mathserif 选项已过时。这应该会导致一个警告,其中详细描述了如何替换此选项,请不要忽略此类警告。

\documentclass[10pt]{beamer}
\usepackage[utf8]{inputenc}
\usefonttheme[onlymath]{serif}
\usepackage{amsmath,bm,amsthm,
%graphicx,
skmath}
\begin{document}
\begin{frame}
    \frametitle{Function $g$}
\[
g(x)=\begin{pmatrix} 
g_1(x)\ \vdots \ g_n(x) \ g_{n+1}(x) \ \vdots \ g_{2n}(x) \ g_{2n+1}(x)\ \vdots \ g_{3n}(x) 
\end{pmatrix} 
\visible<2->{ = \begin{pmatrix} 
x_1^2 + x_{n+1}^2 - 1 \ \vdots \ x_n^2 + x_{2n}^2 - 1\ \visible<3->{ -x_{2n+1}}\ \visible<3->{\vdots} \ \visible<3->{-x_{3n}} \ \visible<4->{x_{2n+1}-L} \ \visible<4->{\vdots} \\visible<4->{x_{3n}-L}
\end{pmatrix}}
\]
\end{frame}
\end{document}

你会想要 Beamer 的 \uncover 命令,它隐藏了它的参数但仍然让它占用 space:

\[
g(x)=\begin{pmatrix} 
g_1(x)\ \vdots \ g_n(x) \ g_{n+1}(x) \ \vdots \ g_{2n}(x) \ g_{2n+1}(x)\ \vdots \ g_{3n}(x) 
\end{pmatrix} 
\pause = \begin{pmatrix} 
x_1^2 + x_{n+1}^2 - 1 \ \vdots \ x_n^2 + x_{2n}^2 - 1\ \uncover<3->{-x_{2n+1} \ \vdots \ -x_{3n}} \ \uncover<4->{x_{2n+1}-L \ \vdots \x_{3n}-L}
\end{pmatrix}
\]

尖括号中的位(例如 <3->)表示参数应该在第 3 帧之后被覆盖(可见)。

您也可以使用 \visible 代替,区别在于:

The \visible command does nearly the same as \uncover. However one difference occurs if the command \setbeamercovered{transparent} has been used to make covered text “transparent” instead, \visible still makes the text completely “invisible” on non-specified slides.