LaTeX - Break in math

Viewed 168

I would like to be able to break lines in a math environment but in a way that keeps a symbol in front of the formula.

For example, the sum (sigma) followed by a long formula. So it goes out of the page but I would like to keep the formula next to the sigma even if there's a line break.

Here's a snippet so you can better reproduce it.

\documentclass{article}
\usepackage{amsmath,amsfonts,amssymb,mathtools}

% allows me to increase the font size of math blocks
\usepackage{graphicx} % \scalebox
\usepackage{environ}
\NewEnviron{mymath}{%
    \[
        \scalebox{1.3}{$\BODY$}
    \]
}

\begin{document}
    Lorem ipsum dolor sit amet
    \begin{mymath}
        \sum \limits _{\substack{
            yyyyyyy,\\
            zzzzzzzz,\\
            www
        }}
        (
            xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        ) + (
            xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        )
    \end{mymath}
\end{document}

And here's a screenshot of what I'm trying to achieve. enter image description here

So as you can see, I'm trying to keep the second parenthesis next to the sigma but under the first parenthesis.

1 Answers

First off: don't scale elements that contain text! If you don't like the size of your math block, use an appropriate font size instead.

You can use the split environment from amsmath :

\documentclass{article}
\usepackage{mathtools}

\begin{document}
    Lorem ipsum dolor sit amet
    \[
    \begin{split}
        \sum \limits_{\substack{
            yyyyyyy,\\
            zzzzzzzz,\\
            www
        }}
       & (
            xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        ) +\\
        &(
            xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        )
    \end{split}
    \]
\end{document}

enter image description here

Related