I am trying to resize the equation font size in math mode:

As This answer suggested :

\[y = \sin^2 x\]
\[\Scale[0.5]{y = \sin^2 x}\]
\[ \Resize{1cm}{y = \sin^2 x}\]

Where my equation look like this:

\mathbf{H_{2}^{(l+1)}=\sigma(\alpha_{22}^{(l)} H_{2}^{(l)} W^{(l)}+\alpha_{21}^{(l)} H_{1}^{(l)} W^{(l)}  \\
 +\alpha_{23}^{(l)} H_{3}^{(l)} W^{(l)}+\alpha_{24}^{(l)} H_{4}^{(l)} W^{(l)} )}

it's going outside of paper width.

How to reduce the font or use this code to reduce font of equation inside paper width?

Thank you !

enter image description here

  • 2
    Line breaking is preferred over shrinking the font size. Aug 6, 2019 at 8:19
  • If you want to have the whole equation in bold face you could use \boldmath\begin{equation}...\end{equation}\unboldmath, but I don't recommend that at all. Bold face usually carries special semantic meaning in math and therefore cannot be used for emphasis. Better use a different color or put a box around it, see the empheq package. Aug 6, 2019 at 8:31
  • The answer from David in the question you linked to is much better than using some scalebox. Aug 6, 2019 at 8:35

1 Answer 1


Instead of shrinking the font size, it is generally better to use a line break. For that purpose the amsmath package provides the multline environment. From the documentation:

The multline environment is a variation of the equation environment used for equations that don't fit on a single line. The first line of a multline will be at the left margin and the last line at the right margin, except for an indention on both sides in the amount of \multlinegap. Any additional lines in between will be centered independently within the display width (unless the fleqn option is in effect).

    = \sigma ( \alpha_{22}^{(l)} H_{2}^{(l)} W^{(l)} + \alpha_{21}^{(l)} H_{1}^{(l)} W^{(l)}  \\
    + \alpha_{23}^{(l)} H_{3}^{(l)} W^{(l)} + \alpha_{24}^{(l)} H_{4}^{(l)} W^{(l)} )

enter image description here

You must log in to answer this question.

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