# [Tex/LaTex] bmatrix in beamer not working

beamermatrices

I'm unable to use the flags to center the column and add a dashed vertical line in the bmatrix environment. This code was working on another LaTeX file but somehow I can't make it work with beamer:

\documentclass[xcolor=dvipsnames, fleqn]{beamer}

\usepackage{arydshln} % for cdashline

\begin{document}

\begin{frame}
\begin{align*}
\begin{bmatrix}{c:cc}
\phantom{+}1 & -1 & \phantom{+}1 \\ \cdashline{1-3}
-1 & \phantom{+}1 & -1 \\
\phantom{+}1 & -1 & 1 \\
\end{bmatrix}
\end{align*}
\end{frame}

\end{document}


By following a suggestion to show a MWE where it DOES work, I found the problem. In the preamble there's a new command that's created, but I don't understand what it's doing.

\documentclass[times]{nmeauth}
\usepackage{arydshln} % for cdashline

% choose the typewriter font used in algorithms
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother

\begin{document}

{\renewcommand{\arraystretch}{2}
\begin{align*}
\newcommand*{\tmp}{\multicolumn{1}{r|}{}}
\begin{bmatrix}[c:cc]
\phantom{+}1 & -1 & \phantom{+}1 \\ \cdashline{1-3}
-1 & \phantom{+}1 & -1 \\
\phantom{+}1 & -1 & 1 \\
\end{bmatrix}
\end{align*}
}

\end{document}


arydshln doesn't mention bmatrix environment, so I've tested your code with array and it worked.

\documentclass[xcolor=dvipsnames, fleqn]{beamer}

\usepackage{arydshln} % for cdashline

\begin{document}

\begin{frame}
\begin{align*}
\left[\begin{array}{c:cc}
\phantom{+}1 & -1 & \phantom{+}1 \\ \cdashline{1-3}
-1 & \phantom{+}1 & -1 \\
\phantom{+}1 & -1 & \phantom{+}1 \\
\end{array}\right]
\end{align*}
\end{frame}

\end{document}