Source code example for matrix with alignment

This is a small compilable example belonging tho the blog post Matrices with alignment:

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\makeatletter
\renewcommand*\env@matrix[1][c]{\hskip -\arraycolsep
  \let\@ifnextchar\new@ifnextchar
  \array{*\c@MaxMatrixCols #1}}
\makeatother
\begin{document}
\[
  \begin{pmatrix}[r]
    1 &  2 &  1 \\
    0 & -2 & -3 \\
    0 & 3 &  -2
  \end{pmatrix}
\]
\end{document}

One Comment

  1. Pingback: Matrices with alignment - TeXblog - Typography with TeX and LaTeX

Leave a Reply

Required fields are marked *