0

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

enter image description here

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

4
  • 4
    I'd probably use psmallmatrix from mathtools, though it still takes up some space.
    – daleif
    Commented Jun 11 at 9:11
  • 4
    As @daleif writes, but if you do not care about meaning, then \binom{a}{b} will probably look OK, too.
    – mickep
    Commented Jun 11 at 9:12
  • 3
    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.
    – Sebastiano
    Commented 2 days ago

2 Answers 2

4

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.)

enter image description here

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

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}

enter image description here

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