Math & Science\hfill doesn't work in align environment

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
jonty01
Posts: 2
Joined: Fri Dec 19, 2008 10:04 pm

\hfill doesn't work in align environment

Post by jonty01 »

Hello and thanks for reading this!
\hfill doesn't seem to work in the align environment. Can something else do the job? (I'd like to stick to the align environment if possible).
For example,

\begin{align*}
&longequation1\\
&=longequation2\\
&=longerequat-\\
&\hfill -ion3
\end{align*}

If I do this, the last line is not flushed right. \hfill is just ignored. The only thing I could think of is a bunch of \indent\indent\indent...\indent :cry:

I would appreciate your help!

John

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

\hfill doesn't work in align environment

Post by phi »

For this case, the multline environment seems to be better suited. It automatically aligns the first line to the left and the last one to the right.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10358
Joined: Mon Mar 10, 2008 9:44 pm

\hfill doesn't work in align environment

Post by Stefan Kottwitz »

Hi John,

welcome to the board!
You could use the flalign environment. Use an additional & seperator to push a formula to the right. flalign is described in the amsmath user's guide and in some other math tutorials and docs, you can find some of them listed here: Mathematics with LaTeX.

Stefan
LaTeX.org admin
jonty01
Posts: 2
Joined: Fri Dec 19, 2008 10:04 pm

Re: \hfill doesn't work in align environment

Post by jonty01 »

thank you :lol:
Post Reply