
$\sm{1 & 0 \\ 1 & 0}\quad\psm{1 & 0 \\ 1 & 0}\quad\bsm{1 & 0 \\ 1 & 0}$

\end{document}


Of course, if you save the file Commons.sty in a convenient place (your local tree, for example) where TeX can find it, you can load the package and directly use the commands, as in:

\documentclass{article}
\usepackage{Commons}

\begin{document}

$\pfrac{1}{2}\quad \bfrac{1}{2}\quad \psfrac{1}{2}\quad \bsfrac{1}{2}\quad \mat{1 & 0 & 1 \\ 0 & 0 & 1 \\ 1 & 1 & 0}\quad \pmat{1 & 0 & 1 \\ 0 & 0 & 1 \\ 1 & 1 & 0}\quad \bmat{1 & 0 & 1 \\ 0 & 0 & 1 \\ 1 & 1 & 0}\quad$

$\sm{1 & 0 \\ 1 & 0}\quad\psm{1 & 0 \\ 1 & 0}\quad\bsm{1 & 0 \\ 1 & 0}$

\end{document}


As a side note, I would have defined \pmat and \bmat using directly bmatrix and pmatrix as provided by amsmath.

-
@hhh he saves a few keystrokes; instead of, for example, \begin{matrix} 1 & 0 \\ 0 & 1 \end{matrix}, he can write \mat{1 & 0 \\ 0 & 1}. –  Gonzalo Medina Oct 3 '12 at 3:31
How to read this "\newcommand{\mat}[1]{\begin{matrix}#1\end{matrix}}"? "[1]"? 3 blocks: \mat is the command, [1] is a divider and the last part is the new -command with place-holder? –  hhh Oct 3 '12 at 3:32
@hhh maybe I don't understand you. Are you familiar with the use of \newcommand or is that precisely what you are asking? –  Gonzalo Medina Oct 3 '12 at 3:34
Yes after thinking a bit, [n] is the amount of parameters where n is the amount. \[p][s][frac|mat], is this some Regex? | is XOR? [p] means at least one p or no p? This is confusing notation, 3 blocks with no specifiers. [...][...][...], what does this mean? –  hhh Oct 3 '12 at 3:37
@hhh \mat is the command that will be defined; [1] declares that it has one argument (mandatory in this case); the next part: {\begin{matrix}#1\end{matrix}} is the definition of the command; it indicates that the argument will be typeset inside a matrix environment. –  Gonzalo Medina Oct 3 '12 at 3:37