[Tex/LaTex] Matrices with same height in keynote

equationsmatrices

I am trying to write some matrices with latex in Keynote and I cant make them the same height. There are some answers to this problem but can't make them work in Keynote.

The equation looks like this:

 \begin{pmatrix}
 X'\hat R^{-1}X & X'\hat R^{-1}Z_1 & X'\hat R^{-1}Z_2 & X'\hat R^{-1}Z_3 \\
 Z'_1\hat R^{-1}X & Z'_1\hat R^{-1}Z_1 + G^{-1}_1& Z'_1\hat R^{-1}Z_2 & Z'_1\hat R^{-1}Z_3 \\
 Z'_2\hat R^{-1}X & Z'_2\hat R^{-1}Z_1 & Z'_2\hat R^{-1}Z_2 + G^{-1}_2& Z'_2\hat R^{-1}Z_3 \\
 Z'_3\hat R^{-1}X & Z'_3\hat R^{-1}Z_1 & Z'_3\hat R^{-1}Z_2 & Z'_3\hat R^{-1}Z_3 + G^{-1}_3
 \end{pmatrix} 
 \begin{pmatrix}
 \alpha \\ 
 \gamma \\ 
 \delta \\ 
 \epsilon 
 \end{pmatrix} 
 =  
 \begin{pmatrix}
 X'\hat R^{-1}y \\
 Z'_1\hat R^{-1}y \\
 Z'_2\hat R^{-1}y \\
 Z'_3\hat R^{-1}y
 \end{pmatrix}

And I get:
enter image description here

Best Answer

As Keynote.app uses a limited set of LaTeX commands (see this page), we cannot have a perfect result. In particular, there's not a \vphantom command available. But with \phantom{\hat{I}_{.}} before \alpha etc., we obtain a not so bad result.

\begin{pmatrix}
 X'\hat R^{-1}X & X'\hat R^{-1}Z_1 & X'\hat R^{-1}Z_2 & X'\hat R^{-1}Z_3 \\
 Z'_1\hat R^{-1}X & Z'_1\hat R^{-1}Z_1 + G^{-1}_1& Z'_1\hat R^{-1}Z_2 & Z'_1\hat R^{-1}Z_3 \\
 Z'_2\hat R^{-1}X & Z'_2\hat R^{-1}Z_1 & Z'_2\hat R^{-1}Z_2 + G^{-1}_2& Z'_2\hat R^{-1}Z_3 \\
 Z'_3\hat R^{-1}X & Z'_3\hat R^{-1}Z_1 & Z'_3\hat R^{-1}Z_2 & Z'_3\hat R^{-1}Z_3 + G^{-1}_3
 \end{pmatrix} 
 \begin{pmatrix}
 \phantom{\hat{I}_{.}}\alpha \\ 
 \phantom{\hat{I}_{.}}\gamma \\ 
 \phantom{\hat{I}_{.}}\delta \\ 
 \phantom{\hat{I}_{.}}\epsilon 
 \end{pmatrix} 
 =  
 \begin{pmatrix}
 X'\hat R^{-1}y \\
 Z'_1\hat R^{-1}y \\
 Z'_2\hat R^{-1}y \\
 Z'_3\hat R^{-1}y
 \end{pmatrix}

enter image description here

For better result, and true LaTeX output, I suggest the use of the app LaTeXit, which is installed by a default MacTeX distribution. With this app, you can export transparent vectoriel images of equations to Keynote.app, and modify it later if needed.