2

I am trying to align several vectors of different height at the bottom. I am aware that this is not the typical convention, but I would like to have vector-entries with same index at same height to pronounce that some vectors start with a lower index than others. In each vector, the last index is the same, sucht that the vectors should be aligned to their bottom.

Consider the MWE:

\documentclass[10pt,a4paper]{article}
\usepackage{amsmath}
\begin{document}
    \begin{align}
        \tilde a = \begin{bmatrix} a_1\\ a_2 \\ \vdots \\ a_{10}\end{bmatrix},\quad
        \tilde b = \begin{bmatrix} b_{-4} \\ \vdots  \\ \vdots  \\ b_1\\ b_2 \\ \vdots \\ b_{10}\end{bmatrix},\quad
        \tilde c = \begin{bmatrix} b_{-3} \\ \vdots  \\ c_1\\ c_2 \\ \vdots \\ c_{10}\end{bmatrix}
    \end{align}
\end{document}

I would like to get the following output: enter image description here

Any idea if this i possible?

1
  • Welcome to TeX.SE!
    – Mensch
    Dec 7, 2022 at 10:13

2 Answers 2

4

With the package nicematrix and \renewcommand{\arraystretch}{1.8} 1.8 found by trying. Is it sufficient for you?

    \documentclass[10pt,a4paper]{article}
    \usepackage{amsmath}
    \usepackage{nicematrix}
    \begin{document}
    \renewcommand{\arraystretch}{1.8}
    $\tilde a =\begin{bNiceMatrix}
            a_1 \\ a_2 \\ \vdots \\ a_{10}
        \end{bNiceMatrix}$,\quad%
    $\tilde b =\begin{bNiceMatrix}[baseline=line-6]
            b_{-4} \\ \vdots  \\ \vdots  \\ b_1\\ b_2 \\ \vdots \\ b_{10}
        \end{bNiceMatrix}$,\quad%
    $\tilde c = \begin{bNiceMatrix}[baseline=line-5] b_{-3} \\ \vdots  \\ c_1\\ c_2 \\ \vdots \\ c_{10}\end{bNiceMatrix}$
    \end{document}

enter image description here

2
  • Thanks, this works well in my case even without any \arraystretching. I appreciate the clean solution.
    – Jannik
    Dec 7, 2022 at 12:11
  • @Jannik, Thanks, this solution may help out, but it's not accurate, Celdor's proposal will work in any case
    – pascal974
    Dec 7, 2022 at 12:19
3

The easiest way is to apply \raisebox{v-len}{$math content$}. v-len is a unit length the content is risen by; it can also be negative in order to lower boxes.

v-len can also be calculated but the first equation has to be to put in a saved box to measure its height. Then, the other equations can be risen by the difference between heights of two boxes.

\documentclass[10pt,a4paper]{article}
\usepackage{amsmath}
\newsavebox\firsteq
\newlength\eqth
\begin{document}
\sbox\firsteq{%
    \ensuremath{
        \begin{bmatrix}
            a_1 \\
            a_2 \\
            \vdots \\
            a_{10}
        \end{bmatrix}}}
\setlength\eqth{\dimexpr\ht\firsteq+\dp\firsteq}

\begin{align}
    \tilde a = \raisebox{1pt}{\usebox\firsteq},\quad
    \tilde b = \raisebox{\dimexpr0.5\totalheight-0.5\eqth}{$
        \begin{bmatrix}
            b_{-4} \\
            \vdots \\
            \vdots \\
            b_1 \\
            b_2 \\
            \vdots \\
            b_{10}
        \end{bmatrix}$},\quad
    \tilde c = \raisebox{\dimexpr0.5\totalheight-0.5\eqth}{$
        \begin{bmatrix}
            b_{-3} \\
            \vdots \\
            c_1 \\
            c_2 \\
            \vdots \\
            c_{10}
        \end{bmatrix}$}, \quad
    \tilde c = \raisebox{\dimexpr0.5\totalheight-0.5\eqth}{$
        \begin{bmatrix}
            b_{-3} \\
            c_1 \\
        \end{bmatrix}$}
\end{align}
\end{document}

enter image description here

2
  • Thank you very much for your qucik reply. The solution works and even provides more flexibility than required in my case. I appreciate this, but I chose pascal974's solution because it is a more compact.
    – Jannik
    Dec 7, 2022 at 12:18
  • No worries. This is how the site works, you accept the answer that suits you the most. It's your privilege and everyone understands or should understand it.
    – Celdor
    Dec 7, 2022 at 12:34

You must log in to answer this question.

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