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

  • Welcome to TeX.SX! Please help us help you by providing a minimal compilable code example (MWE). – TeXnician Oct 7 '18 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 '18 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 =. – marmot Oct 7 '18 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. – Edoardo Serra Oct 7 '18 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 '18 at 18:06
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.