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

Code, edit and compile here:
\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}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
produces the following output:
screenshot.png
screenshot.png (106.12 KiB) Viewed 2384 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.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply