# smallmatrix with vertical line as column separator, how to do it

Since this
\begin{smallmatrix}[cc|cc] ... \end{smallmatrix}
is not possible with smallmatrix, I am wondering how can I get a vertical line as column separator in the smallmatrix environment? (smallmatrix does not support alignment parameters like [c|c])
I know the vertical line will probably touch the matrix entries, but that's something I can tolerate.

-
Welcome to TeX.sx! –  mafp Apr 16 '13 at 17:15

smallmatrix is carefully not built on the array environment, but directly on lower level primitives and macros. So my best advice is to combine two smallmatrix environments

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$\left[\begin{smallmatrix} a & -b \\ -c & d \end{smallmatrix}\middle| \begin{smallmatrix} a & -b \\ -c & d \end{smallmatrix}\right]$

\end{document}


-

write your own environment based on array:

\documentclass{article}
\newenvironment{Smallmatrix}[1]
{\arraycolsep=3pt\def\arraystretch{0.75}\footnotesize% change to whatever you need
\array{#1}}
{\endarray}
\begin{document}

foo $\left(\begin{Smallmatrix}{c|c} a & -b \\ -c & d \end{Smallmatrix}\right)$ bar

\end{document}


-
this would look nicer if the minus signs were not included in the centering. but more important, the gap between content and parentheses is too large (it's wider than the surrounding word spaces). –  barbara beeton Apr 16 '13 at 17:53
then use {@{}c|c@{}} ... You already know that ... ;-) –  Herbert Apr 16 '13 at 17:58
yes, i know that, but i'm not sure the person who asked the question knows it. –  barbara beeton Apr 16 '13 at 18:07