1

There were many cases of how to write block diagonal matrix. However, how to write a pmatrix such that the line and column could be labeled?

enter image description here

6
  • Welcome to TSE. Did you try to do a searcho for matrix and label? Aug 8 '21 at 18:14
  • You can see the blkarray package.
    – Bernard
    Aug 8 '21 at 18:26
  • @Bernard is there a way to just use amsmath etc.? there's been to many packages and some of them were not quite compatible with each other. Aug 8 '21 at 18:30
  • 1
    It has no incompatibility I know of. It's a small package which loads array, and it works fine within amsmath.
    – Bernard
    Aug 8 '21 at 18:41
  • @Bernard blkarray isn't based on array package at all it is a completely separate tabular implementation (and 2227 lines long, although a lot comments of course) Aug 8 '21 at 20:40
5

This is very easy with nicematrix:

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

\[
\begin{pNiceMatrix}[last-col,last-row]
a_{1} & a_{2} & l_{1} \\
a_{3} & a_{4} & l_{2} \\
c_{1} & c_2
\end{pNiceMatrix}
\]

\end{document}

This requires several LaTeX runs at the beginning, but the typesetting will soon stabilize.

enter image description here

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.