
Estou recebendo erros como falta $ inserido ou extra ou esquecido } ao tentar compilar o código a seguir usando a classe 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}
Especificamente, recebo a seguinte mensagem:
! Undefined control sequence.
<argument> \pgf@matrix@last@nextcell@options
l.23 \end{frame}
Se eu digitar r
e pressionar Enter, o LaTeX reportará muitos erros e dirá "Isso gera 100 erros; tente novamente." e falhas.
Usei o mesmo código em outro documento LaTeX onde funcionou bem. Mas acho que o erro pode ser algum pacote faltando. Não sei..
Alguém pode me ajudar a descobrir isso?
Obrigado.
Responder1
O erro desaparece se alguém adicionar fragile
opções frame
. Mas ainda é preciso ajustar algumas larguras para caber na moldura. Uma maneira possível é definir to, column sep
mas 1em
aumentar a distância entre a segunda e a terceira coluna, 2em
adicionando [2em]
a terceira coluna. (Também adicionei a t
opção porque gosto mais disso e eliminei o número da equação para economizar espaço e como em apresentações geralmente não é muito útil tê-los, mas como tudo aqui são apenas sugestões.)
\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}
Em vez de adicionar fragile
você pode adicionar um arquivo 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}
Ambas as opções fragile
e ampersand replacement
foram propostas em muitas postagens, como as respostas paraessa questão.