Math & ScienceHow to left-align and right-align different lines inside the same math block environment?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
user49915
Posts: 81
Joined: Wed Apr 17, 2019 12:51 pm

How to left-align and right-align different lines inside the same math block environment?

Post by user49915 »

Running pdflatex on the code

Code: Select all

\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1]

\vskip\topskip%
\noindent%
\begin{tabular}{@{}p{\linewidth}@{}}
		\(first\ formula\),\\
		\(long\ antecedent\ of\ the\ second\ formula\ \Rightarrow\)\\
		\multicolumn{1}{r}{\(long\ succedent\ of\ the\ second\ formula\)}
\end{tabular}%
\vskip\topskip%

\lipsum[2]
\end{document}
produces the following output:
screenshot.png
screenshot.png (106.12 KiB) Viewed 2341 times
As you see, we wish to align the first formula to the left, the first part of the second formula to the left and the second part of the second formula to the right.

Is there any way to get the same output in a cleaner way by using standard amsmath and mathtools environments? Don't tell me to add horizontal space manually: the page width is subject to change.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply