GeneralRight Justification

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
rameshsreekantan
Posts: 2
Joined: Sun Dec 02, 2007 6:14 pm

Right Justification

Post by rameshsreekantan »

Hi

I cant seem to figure out how to right justify in LaTeX without going over to the next line.

I want to get something like

blahblahblah (10)

i.e. (10) at the right end of the line with the blahs.( I think the word processor for this forum also ignores blank spaces, so while I have left spaces after the blahs and put (10) at the right extreme, it doesnt show up that way :( )

But when I use the command

blahblahblah \begin{flushright} (10) \end{flushright}

I end up with something like

blahblahblah
(10)

( that is, it comes on the next line ). And of course it wont work if I use the \begin{flushright} before the blahs.

In the math environment $$ \eqno(10)$$ does the trick for an equation but I cant figure out what to do for regular text. As one might imagine I want to use it to write the marks for a question after the question when I make an exam.

Any ideas ?

regards,

Ramesh

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Right Justification

Post by gmedina »

You can use the \hfill command:

Code: Select all

blah blah blah \hfill (10)
By the way, if you are using LaTeX, enclose your mathematical formulae using \[...\] instead of $$...$$. The latter is a TeX command that will produce inconsistencies in the vertical spacing. More reasons to avoid the use of $$...$$ can be found in this document.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
rameshsreekantan
Posts: 2
Joined: Sun Dec 02, 2007 6:14 pm

Re: Right Justification

Post by rameshsreekantan »

Hi

It works ! Thanks. I had tried it before but I think I used it in the math environment so it didn't work.

Ramesh
Post Reply