YijunYuan / diagmat

A latex package to generate (anti-)diagonal matrices easily.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

diagmat

A latex package to generate (anti)-diagonal matrices easily. Based on Enrico Gregorio's answer on tex.stackexchange.com

Example

\documentclass{article}
\usepackage{diagmat}
\begin{document}
$\diagmat{1,2,3,4}$
$\diagmat[fences=b]{1,2,3,4}$
$\diagmat[mask=0]{1,2,3,4}$
$\diagmat[fences=v,mask=\cdot]{1,2,3,4}$

$\antidiagmat{1,2,3,4}$
$\antidiagmat[fences=b]{1,2,3,4}$
$\antidiagmat[mask=0]{1,2,3,4}$
$\antidiagmat[fences=v,mask=\cdot]{1,2,3,4}$
\end{document}

Effect

image

Options

  • fences: accept one of the following value: p,b,v,B, which corresponds to pmatrix,bmatrix,vmatrix,Bmatrix in amsmath. Default: p.
  • mask: entries which are not on the (anti-)diagonal line. Default: empty.

Credits

All credits are Enrico Gregorio's. All bugs are mine.

About

A latex package to generate (anti-)diagonal matrices easily.


Languages

Language:TeX 100.0%