I am trying to resize the equation font size in math mode:
As This answer suggested :
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\newcommand*{\Scale}[2][4]{\scalebox{#1}{$#2$}}%
\newcommand*{\Resize}[2]{\resizebox{#1}{!}{$#2$}}%
\begin{document}
\[y = \sin^2 x\]
%
\[\Scale[0.5]{y = \sin^2 x}\]
%
\[ \Resize{1cm}{y = \sin^2 x}\]
\end{document}
Where my equation look like this:
\begin{equation}
\begin{aligned}
\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)} )}
\end{aligned}
\end{equation}
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 !
\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 theempheq
package.