6

I would like to right a column vector in plain TeX without using the \matrix command (it seems too wide otherwise). How can I do it?

6
  • $$\left[\vbox{\hbox{$a_1$}\hbox{$a_2$}}\right]$$ Commented Feb 13, 2014 at 4:28
  • Or maybe $${a_1\brack a_2}$$?
    – morbusg
    Commented Feb 13, 2014 at 8:55
  • 2
    I see nothing strange in the minimal example $$\left[\matrix{a\cr b\cr c\cr d}\right]$$\bye Can you add some more information?
    – egreg
    Commented Feb 13, 2014 at 10:48
  • @JohnKormylo Did you try? I guess not, or you'd have discovered that it does something not really expected.
    – egreg
    Commented Feb 13, 2014 at 10:50
  • If you mean the extra space at the bottom? I don't remember \vbox doing that back in my plain TeX days. I suspect it has to do with \usepackage{plain}. Commented Feb 13, 2014 at 17:19

2 Answers 2

7

I'm assuming that by wide you mean the spacing between the delimiters and inner content.

\matrix is defined with a \thinmuskip (that is, by default, 3 mu) around it with the macro \,.

Here's its definition in full:

\def\matrix#1{\null\,\vcenter{\normalbaselines\m@th
    \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
      \mathstrut\crcr\noalign{\kern-\baselineskip}
      #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,}

So you could make your own \tightmatrix by just copying the above without the \,'s, for example:

\def\tightmatrix#1{\null\vcenter{\normalbaselines\mathsurround=0pt
  \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
    \mathstrut\crcr\noalign{\kern-\baselineskip}
    #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}}
\def\bmatrix#1{\left[\tightmatrix{#1}\right]}

$$ A \left[ \matrix{a_1\cr a_2} \right] B $$
$$ A \bmatrix{a_1\cr a_2} B $$ % can have more than two rows
$$ A {a_1\atopwithdelims[] a_2} B $$ % aka \brack only two rows
\bye

One could perhaps consider wrapping the \vcenter inside a \mathinner.

Here's a comparison:

enter image description here

I like the overall spacing of the last one best, but for more than two rows, you need to start adding style changes and grouping, and it gets really messy really fast.

0
0

Here is my corrected answer with a LaTeX MWE:

\documentclass{article}
\usepackage{plain}
\begin{document}
\begin{plain}
$$\left[\vcenter{\hbox{$\mathstrut a_1$}\hbox{$\mathstrut a_2$}}\right]$$
\end{plain}
\end{document}

colunmn vector

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .