[Tex/LaTex] Horizontal and vertical lines in pmatrix

horizontallinepsmatrixvertical

I am trying to replicate the following matrix in TeX:

enter image description here

So far, I have this (the elements in my TeX are supposed to stay in that way):

\documentclass[11pt,a4paper]{article}
\usepackage{amssymb, amsmath, bm}
\usepackage{float, booktabs, makecell, caption, tabularx}
\usepackage{siunitx}

\begin{document}

\begin{gather}
\centering
\boldsymbol{F} = 
\begin{pmatrix}
I_3 & \mathrm{Unrestricted} \\
0_{k \times k} & I_k \\
\end{pmatrix}
.
\end{gather}

\end{document} 

How can I add horizontal and vertical lines in my matrix such that it matches the one in the picture?

Thank you in advance.

Best Answer

Using array instead of pmatrix you can easily add vertical and horizontal lines:

enter image description here

\documentclass[11pt,a4paper]{article}
\usepackage{amssymb, amsmath, bm}

\begin{document}

\begin{gather}
\centering
\boldsymbol{F} = 
\left(
\begin{array}{c|c}
I_3 & \mathrm{Unrestricted} \\ \hline
0_{k \times k} & I_k \\
\end{array}
\right)
.
\end{gather}

\end{document} 

For a bit more vertical white space around the matrix entries, you can change the value of \arraystretch:

enter image description here

\documentclass[11pt,a4paper]{article}
\usepackage{amssymb, amsmath, bm}

\begin{document}
\renewcommand{\arraystretch}{1.5}
\begin{gather}
\centering
\boldsymbol{F} = 
\left(
\begin{array}{c|c}
I_3 & \mathrm{Unrestricted} \\ \hline
0_{k \times k} & I_k \\
\end{array}
\right)
.
\end{gather}

\end{document}