1

There's a million of these kinds of questions, but none of the answers I found gave exactly what I wanted. Basically I've got a really long equation (long on both sides), and I want to do line breaks on both sides with each subsequent line being indented from the last. Something like:

dkajd;fkasdjf;fd
          + lkdfj;asdkfjad
                  + asdkl;fjas;dj;jk = adlkfj;djkdadf;
                                                + asdlfkjdkfja;dal;j
                                                              + alkjf;alkdjfdklf;

I've tried using the alignedat command, but when I try subsequent indents on the right side, everything on the right side gets shifted:

    \begin{equation}
    \begin{alignedat}{2}
        &\epsilon_{npi} \partial_p \big(
        \partial_j Q_{jm} \partial_m Q_{kl} \partial_i Q_{kl} {}& \\
        &\hspace{2cm}+ Q_{jm} \partial_j \partial_m Q_{kl} \partial_i Q_{kl} {}& \\
        &\hspace{3cm}+ Q_{jm} \partial_m Q_{kl} \partial_i \partial_j Q_{kl}
        \big)
        {}&= \epsilon_{npi} \partial_p \partial_j Q_{jm} \partial_m Q_{kl} \partial_i Q_{kl} \\
        &{}&\hspace{1cm}+ \epsilon_{npi} \partial_j Q_{jm} \partial_p \partial_m Q_{kl} \partial_i Q_{kl} \\
        &{}&\hspace{2cm}+ \epsilon_{npi} \partial_j Q_{jm} \partial_m Q_{kl} \partial_p \partial_i Q_{kl} \\
        &{}&\hspace{3cm}+ \epsilon_{npi} \partial_p Q_{jm} \partial_j \partial_m Q_{kl} \partial_i Q_{kl} \\
        &{}&\hspace{4cm}+ \epsilon_{npi} Q_{jm} \partial_p \partial_j \partial_m Q_{kl} \partial_i Q_{kl} \\
        &{}&\hspace{5cm}+ \epsilon_{npi} Q_{jm} \partial_j \partial_m Q_{kl} \partial_p \partial_i Q_{kl}
    \end{alignedat}
    \end{equation}

This gives: Poorly aligned code The left side is exactly what I want, but I would like no space before the equal sign, and more space after each subsequent line on the right side.

1 Answer 1

0

this actually uses

left
  centre
     right = left
                 centre
                     right

rather than the strictly indented form you suggest, but uses much simpler markup.

enter image description here

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{equation}
\begin{multlined}[b]
        \epsilon_{npi} \partial_p \bigl(% not \big
        \partial_j Q_{jm} \partial_m Q_{kl} \partial_i Q_{kl} {} \\
        + Q_{jm} \partial_j \partial_m Q_{kl} \partial_i Q_{kl} {} \\
        + Q_{jm} \partial_m Q_{kl} \partial_i \partial_j Q_{kl}
        \bigr)
\end{multlined}
        = 
\begin{multlined}[t]
\epsilon_{npi} \partial_p \partial_j Q_{jm} \partial_m Q_{kl} \partial_i Q_{kl} \\
        {}+ \epsilon_{npi} \partial_j Q_{jm} \partial_p \partial_m Q_{kl} \partial_i Q_{kl} \\
        {}+ \epsilon_{npi} \partial_j Q_{jm} \partial_m Q_{kl} \partial_p \partial_i Q_{kl} \\
        {}+ \epsilon_{npi} \partial_p Q_{jm} \partial_j \partial_m Q_{kl} \partial_i Q_{kl} \\
        {}+ \epsilon_{npi} Q_{jm} \partial_p \partial_j \partial_m Q_{kl} \partial_i Q_{kl} \\
        {}+ \epsilon_{npi} Q_{jm} \partial_j \partial_m Q_{kl} \partial_p \partial_i Q_{kl}
\end{multlined}
    \end{equation}
\end{document}
2
  • Is that the typical approach in textbooks and papers? Not really sure what the standard is... Oct 6, 2020 at 18:32
  • @LucasMyers well I'd prefer to write it as A=.... B=... then A=B rather than have long expressions on both sides, but otherwise this layout seems perfectly OK to me. Oct 6, 2020 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .