LaTeX forum ⇒ Math & ScienceImproving 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

Postby Lucasqcgroup » Fri Jan 04, 2013 5:15 pm

Dear all,

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


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


I used the following code:
  1. \renewcommand{\arraystretch}{2}
  2. \[
  3. g :=\left(
  4. \begin{array}{c|c}
  5. \mathbf{2^D} & \textbf{1} \\ \hline
  6. \textbf{1} & \begin{array}{cc}
  7. \boldsymbol{1^\alpha} & \textbf{0} \\
  8. \textbf{0} & \boldsymbol{1^\beta}
  9. \end{array} \\
  10. \end{array}
  11. \right)
  12. \]


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

Postby percusse » Sun Feb 10, 2013 4:00 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.

  1. \documentclass{article}
  2. \usepackage{amsmath,array,multirow}
  3.  
  4. \begin{document}
  5. \[
  6. g :=\left(
  7. \begin{array}{c|cc}
  8. 2^D & \multicolumn{2}{c}{1} \\ \hline
  9. \multirow{2}{*}{1} & 1^\alpha & 0 \\
  10. & 0 & 1^\beta
  11. \end{array}
  12. \right)
  13. \]
  14. \end{document}
Attachments
texse.png
texse.png (7.14 KiB) Viewed 1676 times


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 8 guests