Hi,
I would like a little portion of my text containing very short lines to be \raggedleft while that portion is positioned so as its longest line touches the right border of the page.
for example:
THE PAGE
_______________________
| TextTextTextTextText |
| TextTextTextTextTextx |
| |
| PortionBegin |
| TextTextTextte | <--Longest line touches the right border
| TextText |
| Text |
| Text |
| PortionEnd |
| |
| TextTextTextTextText |
| TextTextTextTextTextx |
|_______________________ |
Text Formatting ⇒ Ragged left Alignment on the right
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Ragged left Alignment on the right
For positioning blocks of text,
For simply aligning lines, a
Stefan
\parbox
or a minipage
environment are useful. However, they require specifying a width.For simply aligning lines, a
tabbing
or a tabular
environment could be used. For example, a tabular
environment just has a natural width, you don't need to know that before. So, here we use- a
tabular
environment - a left aligned column
-
@{}
for removing the default space before and after the column -
\hfill
to push the table to the right
Code: Select all
\hfill\begin{tabular}{@{}l@{}}
Small\\
portion of\\
text
\end{tabular}
LaTeX.org admin
Re: Ragged left Alignment on the right
your solution works fine.
I'm actually replying because I just found that \hfill had no effect after a \\ or \newline. It works only straight after some text of after a \par.
Does anyone know why?
I'm actually replying because I just found that \hfill had no effect after a \\ or \newline. It works only straight after some text of after a \par.
Does anyone know why?