Skip to content

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

Notifications You must be signed in to change notification settings

YijunYuan/diagmat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages