1

I have a problem while inserting a Matrix. I did it a couple of times and i had no error before. Here is the code:

$$
\left[
\begin{array}{cc}
[RGA]_{11} & [RGA]_{12} \\ 
[RGA]_{21} & [RGA]_{22}
\end{array} 
\right] 
\text{  becomes  }
\left[
\begin{array}{cc}
[RGA]_{11} & 1-[RGA]_{11} \\ 
1-[RGA]_{11} & [RGA]_{11}
\end{array} 
\right]
$$

This doesn't compile, getting errors on line 5, while if I write:

$\left[
\begin{array}{cc}
[RGA]_{11} & [RGA]_{12} \\ 
a [RGA]_{21} & [RGA]_{22}
\end{array} 
\right] 
\text{  becomes  }
\left[
\begin{array}{cc}
[RGA]_{11} & 1-[RGA]_{11} \\ 
1-[RGA]_{11} & [RGA]_{11}
\end{array} 
\right]
$

As a stupid example, it compiles! Any idea of what is wrong?

1 Answers1

1

In line with David's comments.... Also, avoid $$ and RGA should presumably not look like a product of three variables.

\documentclass{article}

\usepackage{amsmath}
\newcommand{\rga}{\text{[RGA]}}

\begin{document}
\[
\begin{bmatrix}
\rga_{11} & \rga_{12} \\ 
\rga_{21} & \rga_{22}
\end{bmatrix} 
\text{  becomes  }
\begin{bmatrix}
\rga_{11} & 1-\rga_{11} \\ 
1-\rga_{11} & \rga_{11}
\end{bmatrix}
\]
\end{document}
JPi
  • 13,595