I'd like to write the matrix equation A = (x y) B (x y)^T, where (x y)^T is written as a column vector and B is a 2x2 matrix written as such. I can (almost) do this by, for example, the following:

A = (x \ y) \begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix}

But I'd like the row vector (x y) to be aligned with the first row of the matrix B. How do I do this?

1 Answer 1


For consistency's sake, I would also use a pmatrix for the first matrix; then you can wrap the first pmatrix inside a matrix with an empty second row:



A = 
  \begin{matrix}\begin{pmatrix}x & y\end{pmatrix}\\\mbox{}\end{matrix}
  \begin{pmatrix} a & b \\ c & d \end{pmatrix} 
  \begin{pmatrix} x \\ y \end{pmatrix}


enter image description here

  • Come to think of it, is this type of equation typically formatted to have the row vector in line with the first row of the matrix?
    – Matt
    Commented Jan 6, 2012 at 15:46
  • 1
    @Matt: No. I have never seen it like that at least. Row vectors are usually just set in the same way as scalars. Commented Jan 6, 2012 at 15:55
  • Funny, I always do it this way by hand, but never considered typesetting it like this.
    – qubyte
    Commented Jan 6, 2012 at 16:06
  • @Matt This would be mistaken for a kind of exponent; leave it in the middle. What would you do for the product of a 2x4 matrix by a 4x3 one?
    – egreg
    Commented Jan 6, 2012 at 16:12
  • @MarkS.Everitt, I always do it that way by hand too, but it just doesn't look right when typesetting. Sorry!
    – Matt
    Commented Jan 6, 2012 at 16:13

You must log in to answer this question.

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