3

How to break a number of equations like in the following example?

\begin{align}
     \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda\\
     \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta
\end{align}

Given that both equation lines are too long to fit into one line, how can I break them such that

  1. the remainders are right aligned and
  2. no further breakage marker is needed.

Note: I read about 20 seemingly similar questions, but most deal with only one line or require additional markup/tags to get the split position.

3

It's not really clear what you're about, but this seems to fulfill your wish.

\documentclass{article}
\usepackage{amsmath,environ,xparse}

\usepackage{lipsum} % just for the example

\ExplSyntaxOn
\NewEnviron{splitalign}[1][.9\displaywidth]
 {
  \seq_set_split:NnV \l_drahnr_mysplit_input_seq { \\ } \BODY
  \seq_clear:N \l_drahnr_mysplit_output_seq
  \seq_map_inline:Nn \l_drahnr_mysplit_input_seq
   {
    \seq_put_right:Nn \l_drahnr_mysplit_output_seq
     {
      \parbox{#1}{\raggedleft$\displaystyle##1$}
     }
   }
  \begin{align}
  \seq_use:Nn \l_drahnr_mysplit_output_seq { \\[1ex] }
  \end{align}
 }
\seq_new:N \l_drahnr_mysplit_input_seq
\seq_new:N \l_drahnr_mysplit_output_seq
\cs_generate_variant:Nn \seq_set_split:Nnn { NnV }
\ExplSyntaxOff

\begin{document}

\lipsum*[2]
\begin{splitalign}
\lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot
\lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot
\lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot
\lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda
\\
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta
\end{splitalign}
\lipsum*[3]
\begin{splitalign}[.5\textwidth]
\lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot
\lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot
\lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot
\lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda \cdot \lambda
\\
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot
\beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta \cdot \beta
\end{splitalign}

\end{document}

I split the input at \\, then package each chunk in a \parbox of the stated width (default 0.9\displaywidth) with right alignment and using inline math mode, where breaks are allowed after binary operation symbols.

enter image description here

  • Does not work exactly well. For \begin{splitalign} \int\limits_0^{\gamma} (1-r)^{\frac{n-6}{2}} \cdot r^3 dr =\\ = \frac{-2}{n+2} \cdot \left(\left[ r^3 \cdot (1-r)^{\frac{n-4}{2}}) \right]_0^{\gamma} - 3 \cdot \frac{-1}{n} \cdot \left(\left[ r^2 \cdot (1-r)^{\frac{n-4}{2}} \right]_0^{\gamma} - 2 \cdot \frac{-1}{n-2} \cdot \left(\left[ r^1 \cdot (1-r)^{\frac{n-4}{2}} \right]_0^{\gamma} - 1 \cdot \left[ \frac{-2}{n-4} \cdot (1-r)^{\frac{n-4}{2}} \right]_0^{\gamma} \right) \right) \right)\\ = \dots \end{splitalign} does break properly. – drahnr Dec 30 '14 at 15:32
  • @drahnr TeX will never split a math formula between \left and \right. Use \bigl, \bigr and friends. – egreg Dec 30 '14 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.