Sigue apareciendo el error $ faltante en el proyector usando código que funcionó bien en otros lugares

Sigue apareciendo el error $ faltante en el proyector usando código que funcionó bien en otros lugares

Recibo errores como falta $ insertado o extra u olvidado} al intentar compilar el siguiente código usando la clase beamer.

\documentclass{beamer}
\newcommand*{\theorembreak}{\usebeamertemplate{theorem end}\framebreak\usebeamertemplate{theorem begin}}
\usepackage{mathtools}
\allowdisplaybreaks
\usepackage{tikz-cd}

\usetheme{Warsaw}``
\begin{frame}
\begin{equation}
    \begin{tikzcd}[font=\small]
0 \ar{r} & \frac{E'(K)}{\phi(E(K))} \ar{r}{\delta} \ar{d} 
    & H^{1}(G_K, E[\phi]) \ar{r} \ar{d}{Res_v} & WC(E/K)[\phi] \ar{r} \ar{d} & 0 \\
0 \ar{r} & \frac{E'(K_v)}{\phi(E(K_v))} \ar{r}{\delta_{v}} \ar{d} 
    & H^{1}(G_{v}, E[\phi]) \ar{r} \ar{d} & WC(E/K_{v})[\phi] \ar{r} \ar{d} & 0 \\
0 \ar{r} & \prod\limits_{\mathclap{v \in M_K}} \frac{E'(K_v)}{\phi(E(K_v))} 
            \ar{r}{\prod\limits_{\mathclap{v \in M_K}}\delta_{v}} 
    &
\prod\limits_{\mathclap{v \in M_K}} H^{1}(G_{v}, E[\phi]) \ar{r} &
\prod\limits_{\mathclap{v \in M_K}} WC(E/K_{v})[\phi] \ar{r} & 0
\end{tikzcd}  
    \end{equation}   
\end{frame}
\end{document}

Específicamente, recibo el siguiente mensaje:

! Undefined control sequence.
<argument> \pgf@matrix@last@nextcell@options 

l.23 \end{frame}

Si escribo ry presiono regresar, LaTeX informa muchos errores y dice "Eso genera 100 errores; inténtelo de nuevo". y se estrella.

Utilicé el mismo código en otro documento de LaTeX donde funcionó bien. Pero creo que el error podría deberse a que falta algún paquete. No sé..

¿Puede alguien ayudarme a resolver esto?

Gracias.

Respuesta1

El error desaparece si uno agrega fragilemás frameopciones. Pero todavía hay que ajustar algunos anchos para que encaje en un marco. Una forma posible es establecer el column seppero 1emaumentar la distancia entre la segunda y la tercera columna 2emagregando [2em]la tercera columna. (También agregué la topción porque me gusta más y eliminé el número de ecuación para ahorrar algo de espacio y ya que en las presentaciones en general no es muy útil tenerlas, pero como todo aquí, estas son solo sugerencias).

\documentclass{beamer}
\newcommand*{\theorembreak}{\usebeamertemplate{theorem end}\framebreak\usebeamertemplate{theorem begin}}
\usepackage{mathtools}
\allowdisplaybreaks
\usepackage{tikz-cd}

\usetheme{Warsaw}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{A commutative diagram}
\[
    \begin{tikzcd}[font=\small,column sep=1em]
0 \ar{r} &\frac{E'(K)}{\phi(E(K))} \ar{r}{\delta} \ar{d} 
    &[2em]  H^{1}(G_K, E[\phi]) \ar{r} \ar{d}{Res_v} & WC(E/K)[\phi] \ar{r} \ar{d} & 0 \\
0 \ar{r} & \frac{E'(K_v)}{\phi(E(K_v))} \ar{r}{\delta_{v}} \ar{d} 
    & H^{1}(G_{v}, E[\phi]) \ar{r} \ar{d} & WC(E/K_{v})[\phi] \ar{r} \ar{d} & 0 \\
0 \ar{r} & \prod\limits_{\mathclap{v \in M_K}} \frac{E'(K_v)}{\phi(E(K_v))} 
            \ar{r}{\prod\limits_{\mathclap{v \in M_K}}\delta_{v}} 
    &
\prod\limits_{\mathclap{v \in M_K}} H^{1}(G_{v}, E[\phi]) \ar{r} &
\prod\limits_{\mathclap{v \in M_K}} WC(E/K_{v})[\phi] \ar{r} & 0
\end{tikzcd}  
\]
\end{frame}
\end{document}

ingrese la descripción de la imagen aquí

En lugar de agregar, fragilepuede agregar un archivo ampersand replacement.

\documentclass{beamer}
\newcommand*{\theorembreak}{\usebeamertemplate{theorem end}\framebreak\usebeamertemplate{theorem begin}}
\usepackage{mathtools}
\allowdisplaybreaks
\usepackage{tikz-cd}

\usetheme{Warsaw}
\begin{document}
\begin{frame}[t]
\frametitle{A commutative diagram}
\[
    \begin{tikzcd}[font=\small,column sep=1em,ampersand replacement=\&]
0 \ar{r} \&\frac{E'(K)}{\phi(E(K))} \ar{r}{\delta} \ar{d} 
    \&[2em]  H^{1}(G_K, E[\phi]) \ar{r} \ar{d}{Res_v} \& WC(E/K)[\phi] \ar{r} \ar{d} \& 0 \\
0 \ar{r} \& \frac{E'(K_v)}{\phi(E(K_v))} \ar{r}{\delta_{v}} \ar{d} 
    \& H^{1}(G_{v}, E[\phi]) \ar{r} \ar{d} \& WC(E/K_{v})[\phi] \ar{r} \ar{d} \& 0 \\
0 \ar{r} \& \prod\limits_{\mathclap{v \in M_K}} \frac{E'(K_v)}{\phi(E(K_v))} 
            \ar{r}{\prod\limits_{\mathclap{v \in M_K}}\delta_{v}} 
    \&
\prod\limits_{\mathclap{v \in M_K}} H^{1}(G_{v}, E[\phi]) \ar{r} \&
\prod\limits_{\mathclap{v \in M_K}} WC(E/K_{v})[\phi] \ar{r} \& 0
\end{tikzcd}  
\]
\end{frame}
\end{document}

Tanto las opciones fragilecomo ampersand replacementse han propuesto en muchas publicaciones, como las respuestas aesta pregunta.

información relacionada