# Problem with vertical alignmentof in table's environment “Tabu”

I need your help for this problem. Since a year ago, I'm using LaTeX for wirite a math handbook. From them until now, I've had a few problems but with this forum i have solve them. But now, I can't solve my lastest problem.

Recently, I bought a new computer and I reinstalled the lastest MiKTeX full installation and TexMaker. And when I added new code and I've compiled for my handbook, I obtained the next unpleasant result.

The code compilated are the following:

\begin{table}[H]
\begin{tabu}{cX[m]}
$\mathbf{C}=\begin{pmatrix} a_{11}&a_{12}&\cdots&a_{1n}\\ a_{21}&a_{22}&\cdots&a_{2n}\\ \vdots&\vdots&\ddots&\vdots\\ a_{n1}&a_{n2}&\cdots&a_{nn}\\ \end{pmatrix}$&La dimensión de una matriz cuadrada es, por tanto, $n\times n$.
Sin embargo, es mucho más usual decir que una matriz cuadrada \textbf{es de orden $n$}.
Por ejemplo, la matriz $\bf C$ es de orden $n$ (${\bf C}\in\mathbb{M}_{\,n\times n\,}$)
y la matriz $\bf D$ es de orden $4$ (${\bf D}\in\mathbb{M}_{\,4\times 4\,}$).
Dentro de este tipo de matrices cabe destacar dos elementos
\underline{exclusivos de las matrices cuadradas}: las \textbf{diagonales}.\\
\end{tabu}
\end{table}


As you can see, the text and the mathematical environment (the matrix) are not aligned and not centered, too. Which is what I want to achieve.

Also, this problem happens to me when I changed the computer: with my old notebook, the matrix and the text are perfectly aligned. The result was similar to the following:

This I have achieved with the following code:

\begin{table}[H]
\begin{tabular}{cm{\linewidth}}
$\mathbf{C}=\begin{pmatrix} a_{11}&a_{12}&\cdots&a_{1n}\\ a_{21}&a_{22}&\cdots&a_{2n}\\ \vdots&\vdots&\ddots&\vdots\\ a_{n1}&a_{n2}&\cdots&a_{nn}\\ \end{pmatrix}$&La dimensión de una matriz cuadrada es, por tanto, $n\times n$.
Sin embargo, es mucho más usual decir que una matriz cuadrada \textbf{es de orden $n$}.
Por ejemplo, la matriz $\bf C$ es de orden $n$ (${\bf C}\in\mathbb{M}_{\,n\times n\,}$)
y la matriz $\bf D$ es de orden $4$ (${\bf D}\in\mathbb{M}_{\,4\times 4\,}$).
Dentro de este tipo de matrices cabe destacar dos elementos
\underline{exclusivos de las matrices cuadradas}: las \textbf{diagonales}.\\
\end{tabular}
\end{table}


But the text overflows from the page. Is there any order, command or package to adjust the m type column to the end the page and avoid the overflow?

Thanks! And sorry for my horrific english!

• Where are the results? – albert Jul 23 '18 at 16:12
• Sorry! I cant upload the peictures. I'm modifying the post. Wait a moment, please. Thanks! – user167186 Jul 23 '18 at 16:16

## 1 Answer

i would not use tabu ... after recent changes in the package array is has one "bug" more: columns of the type m doesn't work anymore as expected.

better is used tabularx:

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath, amssymb}
\usepackage{tabularx}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
\begin{table}[htb]
\renewcommand\tabularxcolumn[1]{m{#1}}
\begin{tabularx}{ \linewidth}{@{}
>{\hsize=0.8\hsize}X
>{\hsize=1.2\hsize}X
@{}
}
$\mathbf{C}=\begin{pmatrix} a_{11} & a_{12} &\cdots & a_{1n}\\ a_{21} & a_{22} &\cdots & a_{2n}\\ \vdots & \vdots &\ddots & \vdots\\ a_{n1} & a_{n2} &\cdots & a_{nn}\\ \end{pmatrix}$
& La dimensión de una matriz cuadrada es, por tanto, $n\times n$.
Sin embargo, es mucho más usual decir que una matriz cuadrada \textbf{es de orden $n$}.
Por ejemplo, la matriz $\mathbf{C}$ es de orden $n$ ($\mathbf{C}\in\mathbb{M}_{\,n\times n\,}$)
y la matriz $\mathbf{D}$ es de orden $4$ ($\mathbf{D}\in\mathbb{M}_{\,4\times 4\,}$).
Dentro de este tipo de matrices cabe destacar dos elementos
\underline{exclusivos de las matrices cuadradas}: las \textbf{diagonales}.\\
\end{tabularx}
\end{table}
\end{document}


(red lines indicate text border)

• The problem is the package array: it has been updated and it has completely changed my layout. Someone knows where I can obtain the old version of array pakcage? The original code it was less cumbersome. But, thank you very much @Zarko for your solution! I will definitely choose your code. – user167186 Jul 23 '18 at 17:32
• @DavidGordo98, yes, this is problem. about his has been recently discusion here. search tabu tags. as i remember you need to load array with option containing date of old array. since i mostly discourage people to use non maintained packages, i don't remember more :-(. – Zarko Jul 23 '18 at 18:17
• Yes, I've found the array-2016-10-06 package. But... I have a lot of compilation errors, i don't know why. :-( – user167186 Jul 23 '18 at 18:21
• @DavidGordo98, it seems that you should change all your tabu tables to tabularx or ltablex` ones :-). i worth to send a letter with ask to package author if he is willing to make (just this) fix for the package. it is worth to try. – Zarko Jul 23 '18 at 18:55
• Oh! Good idea! Thank you! But, finally, when the package array-2016-10-6 AND new package multicol-2017-04-11, everything works like before. – user167186 Jul 23 '18 at 18:58