0

I've tried to add \begin{align} ... \end{align} inside of my tabular. This is my reference align inside of tabular. But, when I try the code on that link in beamer, i get a message like this

Misplaced \omit.

\math@cr@@@ ...@ @ne \add@amps \maxfields@ \omit \kern -\alignsep@ \iftag@ ... l.187 \end{frame} I expect to see \omit only after tab marks or the \cr of an alignment. Proceed, and I'll ignore this case.

What's wrong with this code with Beamer?

This is a small sample of my work

\documentclass[aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[edges]{forest}
\usetikzlibrary{fit}
\usepackage{amsmath,mathtools,graphicx,lmodern,xcolor,tcolorbox,multirow,multicol,colortbl,lipsum}
\begin{document}
\begin{frame}
    \begin{tabular}{l|p{5cm}|}
      A & B \\
        & {\begin{align}
   \pmb{ 
    \begin{bmatrix}
    z\\ \gamma
    \end{bmatrix}}&=\pmb{\begin{bmatrix}
    C\\B
    \end{bmatrix}\gamma+\begin{bmatrix}
    \varepsilon\\ \zeta
    \end{bmatrix}}\\
    \pmb{\begin{bmatrix}
    z\\Wz
    \end{bmatrix}}&=\pmb{\begin{bmatrix}
    C\\B
    \end{bmatrix}Wz+\begin{bmatrix}
    \varepsilon\\ \zeta
    \end{bmatrix}}\nonumber\\
    \pmb{\begin{bmatrix}
    I\\W
    \end{bmatrix}z}&=\pmb{\begin{bmatrix}
    C\\B
    \end{bmatrix}Wz+\begin{bmatrix}
    \varepsilon\\ \zeta
    \end{bmatrix}}
\end{align}}
\end{tabular}
\end{frame}
\end{document}
6
  • Could you please post a complete short code reproducing your problem?
    – Bernard
    Jan 12, 2022 at 14:48
  • @Bernard I've edit my post
    – Ari
    Jan 12, 2022 at 14:59
  • @DavidCarlisle you can see, I've edit it
    – Ari
    Jan 12, 2022 at 15:00
  • not really related to beamer (as it works in beamer if you delete all the packages except amsmath) Jan 12, 2022 at 15:06
  • @DavidCarlisle, ok, I've tried to deleted some packages and the problem is colortbl package. But I need the package in another frame for coloring my tabular cell. Any suggestion?
    – Ari
    Jan 12, 2022 at 15:14

1 Answer 1

1

You can simplify the test to

\documentclass{article}
\usepackage{amsmath}


%\usepackage{colortbl}


\begin{document}

\begin{frame}

   \begin{tabular}{l|p{5cm}|}
      A & B \\
        & {\begin{align}
   \pmb{ 
    \begin{bmatrix}
    z\\ \gamma
    \end{bmatrix}}&=\pmb{\begin{bmatrix}
    C\\B
    \end{bmatrix}\gamma+\begin{bmatrix}
    \varepsilon\\ \zeta
    \end{bmatrix}}\\
    \pmb{\begin{bmatrix}
    z\\Wz
    \end{bmatrix}}&=\pmb{\begin{bmatrix}
    C\\B
    \end{bmatrix}Wz+\begin{bmatrix}
    \varepsilon\\ \zeta
    \end{bmatrix}}\nonumber\\
    \pmb{\begin{bmatrix}
    I\\W
    \end{bmatrix}z}&=\pmb{\begin{bmatrix}
    C\\B
    \end{bmatrix}Wz+\begin{bmatrix}
    \varepsilon\\ \zeta
    \end{bmatrix}}
\end{align}}
\end{tabular}
\end{frame}
\end{document}

which works, but fails if you uncomment colortbl

You can unnest the alignment by setting it in a box before the tabular:

enter image description here

\documentclass{beamer}
\usepackage{amsmath}


\usepackage{colortbl}

\newsavebox\asave

\begin{document}

\begin{frame}

\sbox\asave{\parbox{5cm}{%
\begin{align}
   \pmb{ 
    \begin{bmatrix}
    z\\ \gamma
    \end{bmatrix}}&=\pmb{\begin{bmatrix}
    C\\B
    \end{bmatrix}\gamma+\begin{bmatrix}
    \varepsilon\\ \zeta
    \end{bmatrix}}\\
    \pmb{\begin{bmatrix}
    z\\Wz
    \end{bmatrix}}&=\pmb{\begin{bmatrix}
    C\\B
    \end{bmatrix}Wz+\begin{bmatrix}
    \varepsilon\\ \zeta
    \end{bmatrix}}\nonumber\\
    \pmb{\begin{bmatrix}
    I\\W
    \end{bmatrix}z}&=\pmb{\begin{bmatrix}
    C\\B
    \end{bmatrix}Wz+\begin{bmatrix}
    \varepsilon\\ \zeta
    \end{bmatrix}}
\end{align}
}}

   \begin{tabular}{l|p{5cm}|}
      A & B \\
        & \usebox\asave
\end{tabular}
\end{frame}
\end{document}
1
  • Thanks, it worked. I really like the second one. The second one keeps me able to use colortbl.
    – Ari
    Jan 12, 2022 at 15:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .