1

I'm having some problems with the vertical size of these two matrices, as shown with the following MWE code:

\documentclass[11pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{microtype}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{upgreek}

\begin{document}

%\setlength{\abovedisplayskip}{1em}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayskip}{\abovedisplayskip}
\setlength{\belowdisplayshortskip}{\belowdisplayskip}
\setlength{\jot}{3ex}

\begin{align}
    A &=
    \left[ \begin{array}{c}
        \phi \\[3ex]
        \displaystyle{\frac{\boldsymbol{\upsigma} \cdot \mathbf{p}}{E + m}} \: \phi
    \end{array} \right]
    \\
    B &=
    \left[ \begin{array}{c}
        \displaystyle{\frac{\boldsymbol{\upsigma} \cdot \mathbf{p}}{E - m}} \: \chi \\[3ex]
        \chi
    \end{array} \right]
\end{align}

\end{document}

Preview:

enter image description here

Matrice B is shorter than A, why? I would like to make both matrices of exactly the same size. How?

Using the bmatrix environment doesn't help.

8
  • 1
    Add a \mathstrut to each of the single char cells
    – daleif
    Jul 7, 2020 at 16:49
  • What is this? Could you be more specific?
    – Cham
    Jul 7, 2020 at 16:53
  • 1
    It is basically a symbol with zero width but the height and depth of a (, phi and xi does not have the same depth
    – daleif
    Jul 7, 2020 at 16:59
  • I've found that adding that command inside the fractions (top part only) solves the issue.
    – Cham
    Jul 7, 2020 at 17:04
  • So it's the same as \vphantom{(}, right?
    – Cham
    Jul 7, 2020 at 17:05

1 Answer 1

1

With tabularray you can set row height:

\documentclass[11pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{microtype}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{upgreek}

\usepackage{tabularray}
\UseTblrLibrary{amsmath}
\NewDocumentEnvironment{amatrix}{+b}{
    \begin{+bmatrix}[
        rowsep=0pt,
        rows={ht=6ex},
        column{1}={leftsep=4pt},
        column{Z}={rightsep=4pt}
        ]
        #1
    \end{+bmatrix}%
}{}  


\begin{document}
    
    %\setlength{\abovedisplayskip}{1em}
    \setlength{\abovedisplayshortskip}{0pt}
    \setlength{\belowdisplayskip}{\abovedisplayskip}
    \setlength{\belowdisplayshortskip}{\belowdisplayskip}
    \setlength{\jot}{3ex}
    

\begin{align}
    A &=
    \begin{amatrix}
        \phi \\
        \displaystyle{\frac{\boldsymbol{\upsigma} \cdot \mathbf{p}}{E + m}} \: \phi
    \end{amatrix} 
    \\
    B &=
    \begin{amatrix}
        \displaystyle{\frac{\boldsymbol{\upsigma} \cdot \mathbf{p}}{E - m}} \: \chi \\
        \chi
    \end{amatrix} 
\end{align}

\end{document}

enter image description here

You must log in to answer this question.

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