1

I´d like to use an environment from amsmath-package together with rowcolors from xcolor-package for an entry inside a tabu-environment.

Problem is: using \rowcolors the left bracket from Bmatrix is not shown.

I think it´s a kind of expanding-problem like in my post here.

Here is my MWE:

\documentclass{scrbook}
\usepackage{amsmath}
\usepackage{tabu}
\usepackage{longtable}
\usepackage[
table      % Load the colortbl package
]{xcolor}
% table colors 
\colorlet{tablebodycolor}{white!100}
\colorlet{tablerowcolor}{gray!10}
%
\begin{document}
%    
\begin{table}
    \rowcolors{2}{tablebodycolor}{tablerowcolor}
    \begin{longtabu}{|cc|}
        \hline
        \bfseries column1   &   \bfseries column2                   \\
        \hline
        working             &   not working                         \\
        a                   &   $\begin{Bmatrix}M_{ij}\end{Bmatrix}$\\
        \dots               &   \dots                               \\
        \dots               &   \dots                               \\
        \dots               &   \dots                               \\
        \hline
    \end{longtabu}
\end{table}
%
\end{document}
wabu
  • 55

1 Answers1

0

A quick hack to avoid the interference is to typeset the matrix outside in a box and to use the box instead of the matrix inside the table. Before the table:

\newsavebox\matrixbox
\setbox\matrixbox\hbox{$\begin{Bmatrix}M_{ij}\end{Bmatrix}$}

Inside the table:

    a                   &   \usebox\matrixbox \\

Another solution: Use plain TeX for the delimiters.

    a                   &   $\left\{M_{ij}\right\}$ \\

and use an array between them if you have several rows.

gernot
  • 49,614
  • thanks, but that´s not a solution for my usage because I have many of those expressions – wabu Sep 09 '16 at 11:48
  • How many rows do your matrices have? One can do the matrices the old-fashioned way using \left, \right and an array (with suitable adjustment of spacing). – gernot Sep 09 '16 at 12:23
  • ... and there is no solution for amsmath ? – wabu Sep 09 '16 at 14:57
  • There is a solution for everything ;-) It's just a matter of effort (which is too big in my case). – gernot Sep 09 '16 at 15:18