# Is there any way to force the equation of text line to fit textwidth? [duplicate]

How can I force the equation of text line to fit \textwidth? Here is the demo code:

\documentclass{article}

\begin{document}
\section{Width of equation in text line}
text text text text text text text text text text text text text text text text text text text text\,\,\,
This model $\sum\limits_{i=1}^N a_i^2$ looks not good. \,\,text text text text text text text text text texttext text text text text text text
\begin{enumerate}
\item text text text text text text text text text text text text
\item It's not good in enumerate environment like $\sum\limits_{i=1}^N a_i^2$. text text
\item text text text text text text text text text text text text
\end{enumerate}
\end{document}


## marked as duplicate by Mico, Jesse, egreg, user11232, Svend TveskægSep 21 '15 at 10:24

• If you mean height of the expression, then suppress \limits. – Gonzalo Medina Sep 21 '15 at 1:49

As Gonzalo Medina commented, if you are concerned about the height - as opposed to the width - of the inline maths, you might use \nolimits rather than \limits. This doesn't suppress the limits, which you obviously need, but it puts them to the right of the summation sign, so that they do not take up additional vertical space.

As Au101 points out, though, \nolimits is the default in inline maths, so \limits can simply be omitted:

\documentclass{article}

\begin{document}
\section{Width of equation in text line}
text text text text text text text text text text text text text text text text text text text text\,\,\,
This model $\sum_{i=1}^N a_i^2$ looks not good. \,\,text text text text text text text text text texttext text text text text text text
\begin{enumerate}
\item text text text text text text text text text text text text
\item It's not good in enumerate environment like $\sum_{i=1}^N a_i^2$. text text
\item text text text text text text text text text text text text
\end{enumerate}
\end{document}

• Is an explicit \nolimits really necessary in inline math mode? :S – Au101 Sep 21 '15 at 2:14
• @Au101 Apparently not ;). It just never occurred to me to try without it. Thanks. – cfr Sep 21 '15 at 2:19