2

I would like to achieve:

  • the multline equation spans horizontally .7\textwidth
  • the first line is aligned to the left side
  • the second line is aligned to the right side

So far I have:

enter image description here

Could you explain me how to fix the problem of stretching the equations?

Code:

\documentclass[a4paper]{article}

\usepackage{mathtools}
\usepackage{lipsum}

\begin{document}

\lipsum*[2]

\begin{equation}
  \begin{multlined}[.7\textwidth]
    \shoveleft{a = b + }\\
    \shoveright{+ c}
  \end{multlined}
\end{equation}

\lipsum*[2]

\end{document}

The closest question that I found does not have this problem...

3

You just don't want to use \shoveleft and \shoveright.

\documentclass[a4paper]{article}

\usepackage{mathtools}
\usepackage{lipsum}

\begin{document}

\lipsum*[2]
\begin{equation}
  \begin{multlined}[.7\textwidth]
  a = b +{}\\
  {}+c
  \end{multlined}
\end{equation}
\lipsum*[2]

\end{document}

The empty atoms {} are needed for getting the right spacing.

enter image description here

  • Then what is a use case of using shoveleft and shoveright? From the documentation I was sure it is made for such things. – desa Mar 26 '17 at 13:22
  • @desa The documentation is quite unclear indeed. – egreg Mar 26 '17 at 13:29
  • 1
    @desa - \shoveleft and \shoveright start to become useful once the multline and multlined environments contain three or more rows. – Mico Mar 26 '17 at 14:39

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.