11

I wish to create a matrix as displayed in the encircled region on the right (taken from here) enter image description here

However, the code on the left does not seem to be generating the vertical through the matrix. Instead I am only getting one horizontal bar through the matrix.

Can someone please provide a simple code that generates the block/partitioned matrix on the right?

Thanks!

13

Use a vertical bar in the format specification: c|c. A complete example:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
C=
\left[
\begin{array}{c|c}
M & N \\
\hline
R & S
\end{array}
\right]
\]

\end{document}

enter image description here

As a side note, don't use $$...$$ in modern LaTeX documents; use \[...\]. See Why is \[ ... \] preferable to $$ ... $$?.

  • Is there an easy way to use dotted or dashed lines instead of solid with \hline and {c|c}? – ja72 Aug 15 '18 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.