[Tex/LaTex] Horizontal line in Matrix

matricestikz-matrix

This question is building from the post found here. How to move the horizontal dashed line so that it is slightly further away from the superscript "T"? Also, when this horizontal line is moved, how to then horizontally align all the three horizontal dashed lines? Here is the solution code found from the original link:

\documentclass{article}
\usepackage{amsmath}
\usepackage{arydshln}


\begin{document}

\begin{equation}
\left[
    \begin{array}{c;{2pt/2pt}c}
        N & B_i \\ \hdashline[2pt/2pt]
        B_i^T & 0 
    \end{array}
\right]
\left[
    \begin{array}{c}
        x_i \\ \hdashline[2pt/2pt]
        k
    \end{array}
\right]
=\left[
    \begin{array}{c}
        n \\ \hdashline[2pt/2pt]
        0
    \end{array}
\right]
\text{ with } n = A^TPl
\end{equation}

\end{document}

Best Answer

Change \arraystretch:

\renewcommand{\arraystretch}{1.4}   %% adjsut as you wish

Code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{arydshln}


\begin{document}

\begin{equation}
\renewcommand{\arraystretch}{1.4}
\left[
    \begin{array}{c;{2pt/2pt}c}
        N & B_i \\ \hdashline[2pt/2pt]
        B_i^T & 0
    \end{array}
\right]
\left[
    \begin{array}{c}
        x_i \\ \hdashline[2pt/2pt]
        k
    \end{array}
\right]
=\left[
    \begin{array}{c}
        n \\ \hdashline[2pt/2pt]
        0
    \end{array}
\right]
\text{ with } n = A^TPl
\end{equation}

\end{document}

enter image description here

You can also define a \strut of your own

\newcommand{\mystrut}{\rule{0pt}{2.5ex}}

and use it like

\documentclass{article}
\usepackage{amsmath}
\usepackage{arydshln}
\newcommand{\mystrut}{\rule{0pt}{2.5ex}}

\begin{document}

\begin{equation}
%\renewcommand{\arraystretch}{1.4}
\left[
    \begin{array}{c;{2pt/2pt}c}
        N & B_i \\ \hdashline[2pt/2pt]
        \mystrut B_i^T & 0
    \end{array}
\right]
\left[
    \begin{array}{c}
        x_i \\ \hdashline[2pt/2pt]
        \mystrut k
    \end{array}
\right]
=\left[
    \begin{array}{c}
        n \\ \hdashline[2pt/2pt]
       \mystrut 0
    \end{array}
\right]
\text{ with } n = A^TPl
\end{equation}

\end{document}
Related Question