## LaTeX forum ⇒ Math & Science ⇒ Improving a Matrix

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Lucasqcgroup
Posts: 1
Joined: Fri Jan 04, 2013 4:32 pm

### Improving a Matrix

Dear all,

I'm trying to type the following matrix:
matrixf.png (3.24 KiB) Viewed 1802 times

But I could only get this:
mymatrix.png (10.32 KiB) Viewed 1802 times

I used the following code:
\renewcommand{\arraystretch}{2}$g :=\left(\begin{array}{c|c}\mathbf{2^D} & \textbf{1} \\ \hline\textbf{1} & \begin{array}{cc}\boldsymbol{1^\alpha} & \textbf{0} \\\textbf{0} & \boldsymbol{1^\beta}\end{array} \\ \end{array}\right)$

There is too much space between the entries of the matrix and the vertical and horizontal lines.

How could I improve my matrix [typeset it correctly] ?

Any help would be greatly appreciated.

Tags:

percusse
Posts: 3
Joined: Mon Nov 12, 2012 11:24 pm
You might better avoid the nesting of arrays as much as you can in order to avoid such spacing and padding problems.

Here is something that comes to close to the given example. You can still modify the array stretch to 1.3 or higher, alternatively add some \mathstruts etc. I recommend reading Hendrik Vogt's nice answer on TeX.sx.

\documentclass{article}\usepackage{amsmath,array,multirow} \begin{document}     $g :=\left( \begin{array}{c|cc} 2^D & \multicolumn{2}{c}{1} \\ \hline \multirow{2}{*}{1} & 1^\alpha & 0 \\ & 0 & 1^\beta \end{array} \right)$   \end{document}
Attachments
texse.png (7.14 KiB) Viewed 1804 times