TransWikia.com

Create two vectors in the same row

TeX - LaTeX Asked by Gianni Spear on August 4, 2021

I have two vectors y and b one over the other. I wish to have the two vectors on the some row, in order to save pages in my document.

        begin{align*}
            y = begin{pmatrix}
                a_{0} 
                a_{1} 
                a_{2} 
                vdots  
                a_{p}
                c_{1}
                c_{2}
                vdots 
                c_{m}
                end{pmatrix} in mathbb{R}^{(m+p+1)}
    end{align*}

    begin{align*}
            b = begin{pmatrix}
                f_{0} 
                f_{1} 
                f_{2} 
                vdots  
                f_{n}
                end{pmatrix} in mathbb{R}^{(n+1)}
    end{align*}

enter image description here

2 Answers

Something like this?

documentclass[a4paper,12pt]{article}
usepackage{amsmath,amssymb}


begin{document}
begin{equation*}
            mathbf{y} = begin{pmatrix}
                a_{0} 
                a_{1} 
                a_{2} 
                vdots  
                a_{p}
                c_{1}
                c_{2}
                vdots 
                c_{m}
                end{pmatrix} in mathbb{R}^{(m+p+1)}, qquad 
            mathbf{b} = begin{pmatrix}
                f_{0} 
                f_{1} 
                f_{2} 
                vdots  
                f_{n}
                end{pmatrix} in mathbb{R}^{(n+1)}
    end{equation*}
end{document}

enter image description here

Answered by Sebastiano on August 4, 2021

You should use a single equation* environment (use align only when an alignment is concerned), as already suggested.

There are other space saving options, though.

documentclass{article}
usepackage{amsmath,amssymb}

begin{document}


begin{equation*}
  y =
  begin{pmatrix}
  a_{0} 
  a_{1} 
  a_{2} 
  vdots  
  a_{p}
  c_{1}
  c_{2}
  vdots 
  c_{m}
  end{pmatrix} in mathbb{R}^{(m+p+1)}
quadtext{and}quad
  b =
  begin{pmatrix}
  f_{0} 
  f_{1} 
  f_{2} 
  vdots  
  f_{n}
  end{pmatrix} in mathbb{R}^{(n+1)}
end{equation*}
But, if you really want to save space, you can use an alignment
begin{align*}
  y &=
  begin{pmatrix}
  a_{0} & 
  a_{1} & 
  a_{2} & 
  cdots & 
  a_{p} &
  c_{1} &
  c_{2} &
  cdots &
  c_{m}
  end{pmatrix}^{T} in mathbb{R}^{(m+p+1)}

  b &=
  begin{pmatrix}
  f_{0} & 
  f_{1} & 
  f_{2} & 
  cdots & 
  f_{n} 
  end{pmatrix}^T in mathbb{R}^{(n+1)}
end{align*}
or center both vectors
begin{gather*}
  y =
  begin{pmatrix}
  a_{0} & 
  a_{1} & 
  a_{2} & 
  cdots & 
  a_{p} &
  c_{1} &
  c_{2} &
  cdots &
  c_{m}
  end{pmatrix}^{T} in mathbb{R}^{(m+p+1)}

  b =
  begin{pmatrix}
  f_{0} & 
  f_{1} & 
  f_{2} & 
  cdots & 
  f_{n} 
  end{pmatrix}^T in mathbb{R}^{(n+1)}
end{gather*}

end{document}

enter image description here

Answered by egreg on August 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP