Is it possible to get multline like behavior within a gather environment? I have a set of equations in a gather environment, but one of them is too long, and I'd like to split it up onto two lines where the first line is left-aligned and the second line is right-aligned (just like multline). If there is a way of aligning individual lines within the gather or split environment (like flushleft or flushright but functional in mathmode) this would solve the problem.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The mathtools package has an inner multlined environment similar to gathered and the likes, but it required a small amount of manual tweaking:
\documentclass{article} \usepackage{amsmath} \usepackage{mathtools} \begin{document} % \begin{multline} % \framebox[0.65\linewidth]{\strut} \\ % \framebox[0.6\linewidth]{\strut} \\ % \framebox[0.65\linewidth]{\strut} \\ % \framebox[0.6\linewidth]{\strut} % \end{multline} \begin{gather} \framebox[0.8\linewidth]{\strut} \\ \begin{multlined}[b][\linewidth-3\multlinegap] \framebox[0.65\linewidth]{\strut} \\ \framebox[0.6\linewidth]{\strut} \\ \framebox[0.65\linewidth]{\strut} \\ \framebox[0.6\linewidth]{\strut} \end{multlined} \\ \framebox[0.4\linewidth]{\strut} \end{gather} \end{document} 回答2:
I haven't tested this, but you can try putting \hfill in front of the second line.
Having said that: IMHO, multline behavior inside a gather environment is undesirable. Especially if you have the fleqn option enabled, you should consider the following option: put the long equation inside a split, with alignment on the left side of the equality. Assuming the right hand side is too long, put its second part on a new line (still inside the split) and use \hspace{1cm} (or some other length) to indent the second part a bit further.
For an overview of all AMS multiline blocks, see the amsmath documentation.