no problem I thought---just define it yourself. I like the narrow line
spacing. alas, this is not as obvious as I thought:
\documentclass{article}
\usepackage{setspace}
\begin{document}
\newcommand{\shortstackthree}[1]{\begin{spacing}{0.6}\begin{tabular}{l}#1\end{tabular}\end{spacing}}
ok: \shortstackthree{a\\b\\c}
fails: $\shortstackthree{a\\b\\c}$
fails: $\mbox{\shortstackthree{a\\b\\c}}$
\end{document}
how should I define this?
sincerely,
/iaw
If you need to reduce the leading between the stacked lines, you can
act on the \arraystretch parameter:
\newcommand{\newshortstack}[1]
{\begingroup\renewcommand{\arraystretch}{.8}% <- adjust to suit
\ifmmode
\begin{array}{c}#1\end{array}%
\else
\begin{tabular}{c}#1\end{tabular}%
\fi
\endgroup}
Thus you have a stack in math form when in math, in text form otherwise.
Ciao
Enrico
> thank you, enrico. is there a reason why this is not the standard
> shortstack definition?
Please, don't top post.
I don't know the real reason. The \shortstack command was devised
for use in picture mode and much more optimized than the one I showed
you.
A definition more in line with the original \shortstack command
could be
\makeatletter
\def\cvb@x{$\vcenter} \def\ecvb@x{$}
\let\tvb@x\vtop \let\etvb@x\relax
\let\bvb@x\vbox \let\ebvb@x\relax
\newcommand\newshortstack[1][b]{%
\leavevmode
\csname #1vb@x\endcsname\bgroup
\baselineskip-\p@\lineskip 2\p@
\let\\\@stackcr
\@inewshortstack{#1}}
\def\@inewshortstack#1#2{\ialign{\hss\vphantom{ly}{##}\unskip\hss\cr
#2\crcr}%
\egroup\csname e#1vb@x\endcsname}
\makeatother
So you say \newshortstack{a\\b\\c} for bottom alignment,
\newshortstack[c]{a\\b\\c} for center alignment and
\newshortstack[t]{a\\b\\c} for top alignment. But you lose the
automatic recognition of math mode.
Ciao
Enrico