[Tex/LaTex] Word-wrapping page-long polynomials in latex

equationsformatting

I know that you can enter multiline equations using the align environment and line breaks (\\).

I want to LaTeX multiple polynomials that are very long (up to a page in length, single-spaced and 12 point font) without having to manually insert each line break. Even if I went through the trouble once, I'd have to do it all over again just to reformat the document.

Is there a way to do this, or do I have to use something like the verbatim environment or the listings environment, where the polynomials just become text?

Best Answer

Displayed math can't be broken automatically, but in-line math can. So you can try something like

\newenvironment{polynomial}
  {\par\vspace{\abovedisplayskip}%
   \setlength{\leftskip}{\parindent}%
   \setlength{\rightskip}{\leftskip}%
   \medmuskip=4mu plus 2mu minus 2mu
   \binoppenalty=0
   \noindent$\displaystyle}
  {$\par\vspace{\belowdisplayskip}}

and put your long polynomial in the newly defined environment.

Related Question