8

I would like to typeset a partitioned matrix in LaTeX with dashed lines. After a quick search on TeX.SE, I found this post with a nice example of such matrices. I tried it on my computer and the result looks "flat". By "flat", I mean that the matrix doesn't look square.

Here is my example :

\documentclass[a4paper,10pt]{article}
\usepackage{arydshln}
\setlength{\dashlinegap}{2pt}

\begin{document}
\[ \Gamma = \left(\begin{array}{c:c} \Gamma_{A} & \Gamma_{AB} \\ \hdashline (\Gamma_{AB})^\top & \Gamma_{B} \end{array} \right) \]
\end{document}

Here is the result of the previous code :

enter image description here

How can I make the matrix look square ?

10

You can move the lines further apart by specifying arraystretch:

Sample output

\documentclass[a4paper,10pt]{article}
\usepackage{arydshln}
\setlength{\dashlinegap}{2pt}

\begin{document}

\[
  \Gamma = \left({\renewcommand*{\arraystretch}{1.5}
    \begin{array}{c:c}
      \Gamma_{A} & \Gamma_{AB} \\
      \hdashline
      (\Gamma_{AB})^\top & \Gamma_{B}
    \end{array}}
  \right)
\]

\end{document}

Here I have localised the change to a group containing the array.

An alternative way to tweak this, avoid the delimiters increasing too much is to add inisible vertical rules of appropiate height / depth:

Second sample

\documentclass[a4paper,10pt]{article}
\usepackage{arydshln}
\setlength{\dashlinegap}{2pt}

\begin{document}

\[
  \Gamma = \left(
    \begin{array}{c:c}
      \vrule width 0pt depth 6pt \Gamma_A & \Gamma_{AB} \\
      \hdashline
      \vrule width 0pt height 12pt (\Gamma_{AB})^\top & \Gamma_{B}
    \end{array}
  \right)
\]

\end{document}

but choosing the correct values here is rather more ad hoc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.