8

When I try next code

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage{blkarray}

\begin{document}
        \begin{frame}{Title}

            \[
            \begin{blockarray}{c|c}
            A & B 
            \end{blockarray}
            \]      
        \end{frame} 
\end{document}

pdflatex finishes with

 ! Incompatible list can't be unboxed. <argument> \BA@first@box 
                           l.15         \end{frame}

If I replace beamer with article there is no problem. Do you know why?

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
Ignasi
  • 136,588

2 Answers2

8

You need a block environment within your blkarray environment, similar to the one given in Error with blkarray: Misplaced \noalign:

\documentclass{beamer}
\usepackage{blkarray}

\begin{document}
\begin{frame}{Title}

\[
\begin{blockarray}{cc}
A & B \\
\begin{block}{c[c]}
1 & 2 \\
\end{block}
\end{blockarray}
\]      
\end{frame} 
\end{document}

enter image description here

Mike Renfro
  • 20,550
  • 1
    How did you spot that:-) To be more exact you just need to force blkarray to avoid its "quick" code. See my answer below, but +1 from me as the hint saved a fair bit of debugging time. – David Carlisle May 08 '12 at 21:46
  • 1
    The actual thought process was: first, read the other comment's linked answer, and write a long (unposted) comment about how the OP probably needed to update their TeX system, and not to take the posted solution so literally. Second, see that the MWE didn't work in my updated TeX Live, and cancel the previous comment. Third, Googled 'beamer blkarray' in case someone else had a similar problem, and found Stefan's answer. Fourth, verified Stefan's answer worked in the MWE, and happily avoided thinking about other methods. – Mike Renfro May 08 '12 at 23:48
  • Of course, not knowing blkarray or what the OP was really trying to accomplish, my answer may miss the point entirely. – Mike Renfro May 08 '12 at 23:51
  • @MikeRenfro: I wanted to write an answer to using multiple brace in array environment with blkarray. The OP used beamer so I did the same and found the problem. I also googled and found Stefan`s answer but I didn't related with my error. – Ignasi May 09 '12 at 07:14
5

blkarray has two implementations a "quick" version for simple arrays and the full version if you want to do all the weird things that the package allows. For some reason eluding me at present beamer doesn't like the quick version so you can add to the document preamble after loading blkarray.

\makeatletter
\let\BA@quicktrue\BA@quickfalse
\makeatother

then it seems to work OK. Even the slow version is a lot quicker than the quick version was in 1992:-)

David Carlisle
  • 757,742