1

This code

\begin{multline*}
hello\\
dear\\
\shoveright{how\ are\ you}\\
\shoveleft{thanks\ man}
\end{multline*}

is displayed as

enter image description here

My question is why not thanks man both words are shoved on left like how are you are all shoved right?

2

The documentation amsldoc.pdf says:

It's possible to force one of the middle lines to the left or right with commands \shoveleft, \shoveright.

However, the command \shoveleft is used in the last line. The documentation says about the last line:

The first line of a multline will be at the left margin and the last line at the right margin, except for an indention on both sides in the amount of \multlinegap.

Nevertheless, as workaround, \hfill at the end of the argument of \shoveleft fixes the issue:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{multline*}
hello\\
dear\\
\shoveright{how\ are\ you}\\
\shoveleft{thanks\ man\hfill}
\end{multline*}
\end{document}

Result

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.