0

For a simple matrix equation as the one below, I get the matrix entries bottom-aligned instead of center-aligned. I found some fancy row editing on StackExchange that use arraystretch, vphantom, struts, etc. Mine is a simple equation that I'd like to have vertically centered with the equal sign. This is for an IEEE paper, so I'm using IEEEtran.cls in case that matters. I'd appreciate any suggestions.

\begin{equation}
z =& \begin{bmatrix}  H & \vdots & M \end{bmatrix}\begin{bmatrix} x \\ \cdots 
\\ f\end{bmatrix} + e\\
\end{equation}

enter image description here

5
  • Welcome to TeX.SX! Please help us help you by providing a minimal compilable code example (MWE).
    – TeXnician
    Oct 7, 2018 at 15:41
  • You're mixing up the dots: they should be centered in the row and vertical in the column. Anyway, you can get the vertical ones not taking too much space with \smash{\vdots}
    – egreg
    Oct 7, 2018 at 15:43
  • You could also do \begin{bmatrix} H & \vdots & M\\[-8pt] \\ \end{bmatrix} to make the matrix more symmetric. BTW, in an equation you are not to put alignment characters, i.e. remove the & after =.
    – user121799
    Oct 7, 2018 at 15:47
  • I think you are referring to the horizontal matrix, try to use the \vspace{} with some negative number, like -3pt in it. You'll have to adjust it manually but it works. Oct 7, 2018 at 16:03
  • @egreg \smash worked fine, as well as the version @marmot suggested. The spacing looks a little better using marmot's suggestion.
    – Bil
    Oct 7, 2018 at 18:06

1 Answer 1

0

You've not provided a MWE so I'm assuming you are using the standard 10pt article class.

As egreg correctly said you're mixing up vertical and horizontal dots, but still here is a solution for your problem:

\documentclass[10pt]{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
z = \begin{bmatrix}  \vspace{1.5pt}H & \vdots & \vspace{1.5pt}M \end{bmatrix}\begin{bmatrix} x \\ \cdots 
\\ f\end{bmatrix} + e\\
\end{equation}
\end{document}

I've also removed the & after the equal sign, the output is this:

enter image description here

You must log in to answer this question.

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