3

I use the following code snippet to formulate a convolution operation:

\[
  \begin{bmatrix}
    a_{11} & a_{12} & a_{13} \\
    a_{21} & a_{22} & a_{23} \\
    a_{31} & a_{32} & a_{33} \\
  \end{bmatrix}
  * 
  \begin{bmatrix}
    b_{11} & b_{12} & b_{13} \\
    b_{21} & b_{22} & b_{23} \\
    b_{31} & b_{32} & b_{32} \\
  \end{bmatrix} = 
\begin{bmatrix}
  \sum_{\mathclap{m=1}}^{3} \sum_{\mathclap{n=1}}^{3}a_{n,m}b_{n,m}
\end{bmatrix}
\]

And this is what I get:

enter image description here

Why are the sum symbols squished together?

4
  • 1
    It's working exactly as you have told it to do...Ditch the \mathclap. That could only possibly make some sense in \displaystyle, but your matrix is in \textstyle. Apr 30, 2020 at 14:01
  • the \mathclap works normally outside of the matrix, the squishing only happens inside a matrix. I need the \mathclap because the matrix would be very wide (with a 3x3 matrix for example) @StevenB.Segletes Apr 30, 2020 at 14:02
  • One alternative is to try \sum\limits, but even then, you will need to eliminate the \mathclap. Perhaps you are looking for \displaystyle inside the matrix, to lead off the term. Apr 30, 2020 at 14:03
  • 2
    \sum and \mathclap are working exactly as designed in your example, you are hiding the width of the subscript so it is over-printing the base. Apr 30, 2020 at 14:11

1 Answer 1

7

The equation is setting exactly the way you told it to. Do not use \mathclap in \textstyle, since the limits are set to the right of the \sum. If you want limits above/below the \sum, you can either add \limits after \sum or else specify \displaystyle. While \mathclap can be useful sometimes in such cases, it would not help here, since you have two \sums, adjacent to each other...subscripts will collide.

These are your choices. None involve \mathclap.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
\begin{bmatrix}
  \sum_{m=1}^{3} \sum_{n=1}^{3}a_{n,m}b_{n,m}
\end{bmatrix}
\begin{bmatrix}
  \sum\limits_{m=1}^{3} \sum\limits_{n=1}^{3}a_{n,m}b_{n,m}
\end{bmatrix}
\begin{bmatrix}
  \displaystyle\sum_{{m=1}}^{3}\sum_{{n=1}}^{3}a_{n,m}b_{n,m}
\end{bmatrix}
\]
\end{document}

enter image description here

1
  • 2
    \displaystyle saved my day. Thank you very much Apr 30, 2020 at 14:38

You must log in to answer this question.

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