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

math-modematricesrules

I want to create a bmatrix on the right

enter image description here

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

gives me

enter image description here

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

thanks

Best Answer

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}

enter image description here