# How can I write $\begin{pmatrix}1 // 2\end{pmatrix}$ in the main text? [duplicate]

It occured to me that writing a 2x1 vector i.e (a "over" b) in Latex is not as easy as I thought. I use normally the form

$s=\begin{pmatrix} a\\ b \end{pmatrix}$


but this creates a large space between the two lines as can be seen here

Is there a better way than this, in order to avoid the expansion of the line-spacing?

• I'd probably use psmallmatrix from mathtools, though it still takes up some space. Commented Jun 11 at 9:11
• As @daleif writes, but if you do not care about meaning, then \binom{a}{b} will probably look OK, too. Commented Jun 11 at 9:12
• Write the transpose of the vector to get an horizontal layout? Commented Jun 11 at 9:14
• @daleif Excuse me very much. I have not seen your comment. I see your comment only now. Commented 2 days ago

The problem is exacerbated by the double spacing you're likely using.

You first of all need to reduce \arraystretch. Then, with double spacing a two-row matrix would fit.

\documentclass{article}
\usepackage{amsmath}
\usepackage{setspace}
\usepackage{braket}

\DeclareMathOperator{\Tr}{Tr}

\doublespacing
\renewcommand{\arraystretch}{0.6}

\begin{document}

\noindent
where $s=\begin{pmatrix} a \\ b \end{pmatrix}\begin{pmatrix} a & b \end{pmatrix}^*$
is the density matrix of the state $\ket{\psi}$ in the Bell-basis of the
eigenvectors $v_1$ and $v_2$. Then by defining $\Tr(\omega)=\Tr[s^*\tau s\tau^*]$,
(replacing $s$ with $\omega$), then

\end{document}


(Check the commas, there are some redundant ones.)

• Thanks egreg, that worked out great! Commented Jun 11 at 9:38

In this MWE I suggest to use psmallmatrix and pmatrix (It was a suggestion of the user @dailef that I have not seen) enviroments without an evident space between the rows.

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,braket}
\usepackage{parskip}
\begin{document}
where $s=\begin{psmallmatrix} a \\ b \end{psmallmatrix}\begin{pmatrix} a & b \end{pmatrix}^{*}$
is the density matrix of the state $\ket{\psi}$ in the Bell-basis of the
eigenvectors $v_1$ and $v_2$. Then by defining $\mathrm{Tr}(\omega)=\mathrm{Tr}[s^{*}\tau s\tau^{*}]$,
(replacing $s$ with $\omega$), then
\end{document}