[Tex/LaTex] How to add dash lines in Matrix

commentsmatrices

I would like to know how to add dash lines in Matrix (see figuge)

Cheers

S.L.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
\begin{bmatrix}
N & B_i \\
B_i^T & 0
\end{bmatrix}
\begin{bmatrix}
x_i\\
k
\end{bmatrix}
=\begin{bmatrix}
n\\
0
\end{bmatrix}
\text{ with } n = A^TPl
\end{equation}
\end{document}

Best Answer

If using array instead of bmatrix is possible, you can use arydshln package:

enter image description here

\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}

you can of course, modify options to achieve the look that you desire.