amsmath
defines \substack
for a very tight vertical stacking of elements (typically used as indices under operators like \sum
. It's definition in amsmath.sty
is:
\newenvironment{subarray}[1]{%
\vcenter\bgroup
\Let@ \restore@math@cr \default@tag
\baselineskip\fontdimen10 \scriptfont\tw@
\advance\baselineskip\fontdimen12 \scriptfont\tw@
\lineskip\thr@@\fontdimen8 \scriptfont\thr@@
\lineskiplimit\lineskip
\ialign\bgroup\ifx c#1\hfil\fi
$\m@th\scriptstyle##$\hfil\crcr
}{%
\crcr\egroup\egroup
}
\newcommand{\substack}[1]{\subarray{c}#1\endsubarray}
Also, with \scriptsize
being roughly 70% of \normalsize
(in a 10pt
base font), scaling at 80% is somewhere in between and might be useful. This requires graphicx
. \colvec[<scale>]{<vector>}
captures this (with a default <scale>
of .8
or 80%):
\newcommand{\colvec}[2][.8]{%
\scalebox{#1}{$\begin{array}{@{}c@{}}#2\end{array}$}}%
Here's a small example showing some comparison, plus a modification to \substack
:
\documentclass{article}
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\setlength{\parindent}{0pt}% Just for this example
\begin{document}
\verb|pmatrix|:
\[
\begin{pmatrix}1\\2\end{pmatrix} \quad
\begin{pmatrix}x_11\\2\end{pmatrix}
\]
\verb|smallmatrix|:
\[
\left(\begin{smallmatrix}1\\2\end{smallmatrix}\right) \quad
\left(\begin{smallmatrix}x_1\\2\end{smallmatrix}\right)
\]
\verb|\substack|:
\[
\left(\substack{1\\2}\right) \quad
\left(\substack{x_1\\2}\right)
\]
\makeatletter
\renewenvironment{subarray}[1]{%
\vcenter\bgroup
\Let@ \restore@math@cr \default@tag
\baselineskip\fontdimen10 \scriptfont\tw@
\advance\baselineskip\fontdimen12 \scriptfont\tw@
\lineskip7\fontdimen8 \scriptfont\thr@@
\lineskiplimit\lineskip
\ialign\bgroup\ifx c#1\hfil\fi
$\m@th##$\hfil\crcr
}{%
\crcr\egroup\egroup
}
\makeatother
Updated \verb|\substack|:
\[
\left(\substack{1\\2}\right) \quad
\left(\substack{x_1\\2}\right)
\]
\newcommand{\colvec}[2][.8]{%
\scalebox{#1}{$\begin{array}{@{}c@{}}#2\end{array}$}}%
\verb|\colvec|:
\[
\Big(\colvec{1\\2}\Big) \quad
\Big(\colvec{x_1\\2}\Big) \quad
\bigg(\colvec{a\\b\\c}\bigg) \quad
\bigg(\colvec[.7]{x_1\\x_2\\x_3}\bigg)
\]
\end{document}
This hasn't been extensively tested, since I'm not sure in which contexts it might fail or not.