Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
Welcome to TeX.sx! –  mafp Apr 16 '13 at 17:15
add comment

2 Answers

up vote 7 down vote accepted

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}

enter image description here

share|improve this answer
add comment

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}

enter image description here

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.