# [Tex/LaTex] vertical and horizontal line in a matrix

math-modematricesrules

I want to create a bmatrix on the right

\documentclass[10pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\begin{document}
$$\begin{bmatrix}[c|c] _B[T]_B & * \\ 0 & _{\overline{B'}} [\overline{T}] _{\overline{B'}} \end{bmatrix}$$
\end{document}


gives me

How do I make verticle line work? and how do I insert horizontal line?

thanks

You could use an array instead; in this way, the standard | for the vertical rule and \hline (for the horizontal rule) will give you the desired result. The brackets can be obtained using \mleft, \mright from the mleftright package:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mleftright}

\begin{document}

$\renewcommand\arraystretch{1.3} \mleft[ \begin{array}{c|c} \epsilon' [T|_A]\epsilon & \ast \\ \hline 0 & _{\overline{B}'} [\overline{T}] _{\overline{B}\vphantom{\overline{B}'}} \end{array} \mright]$

\end{document}