Is there a way, in LaTeX, to automatically resize font of displayed equations to fit column width (241 pt
, here)?
Any ideas would be appreciated.
You can see my equation below; note that I use \fontsize{4pt}{4pt}\selectfont
to resize the font, but I need the font to be resized automatically every time.
{\fontsize{4pt}{4pt}\selectfont{\begin{gather}\begin{gathered}{\varphi
}_{ij}^{q}\left(t\right)=2\left[\dfrac{{S}_{a}}{{L}_{a}^{2}}{e}^{-({\Vert
{x}_{j}(t)-{x}_{i}(t)-{\Delta }_{ij}^{q}\Vert
}^{2}/{L}_{a}^{2})}-\dfrac{{S}_{r}}{{L}_{r}^{2}}{e}^{-({\Vert
{x}_{j}(t)-{x}_{i}(t)-{\Delta }_{ij}^{q}\Vert
}^{2}/{L}_{r}^{2})}+\left(\dfrac{{S}_{r}}{{L}_{r}^{2}}+\dfrac{{S}_{r}}{{L}_{a}^{2}}\right){e}^{(-1/{L}_{r}^{2}+1/{L}_{a}^{2})({\Vert
{x}_{j}(t)-{x}_{i}(t)-{\Delta }_{ij}^{q}\Vert
}^{2})}\right].\label{eq6}\end{gathered}\end{gather}}}
Best Answer
The
adjustbox
package is handy. You put the contents insideadjustbox
environment asthen if the contents are wider than 241pt, then only they are resized otherwise not.