TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to put an address in my document as follows:

|                             |
|                     Name    |
|                     Street #|
|                     City    |
|                     ZIP     |
|                             |

where the | mark the left and right page borders. I would like the items of the address (Name, Street etc.) to be left-flushed, but the box right-flushed so that the longest item touches the right page border.

Is there a simple way to accomplish this?

share|improve this question
up vote 4 down vote accepted

Use a tabular for the left alignment and use \hfill to flush it to the right.



     Name \\
     Street \# \\
     City \\
     ZIP \\

\noindent\hrule% Show width of line

share|improve this answer
why do you have \null? – Herbert Mar 15 '11 at 18:57
@Herbert: You are right, it works without it. Sometimes it happened to me that the fill macros didn't work when there wasn't a \hbox{} or shorter \null at one side, so I just got used to adding them. – Martin Scharrer Mar 15 '11 at 19:27
It should be pointed out that this does not work if there is no empty line between Before and \hfill. – mschilli Oct 15 '13 at 9:00


\hfill \tikz
\node [align=left]{name\\Town\\ code postal};
share|improve this answer

\begin{flushright}\settowidth{\abc}{River Street}
Tom Robinson\\
River Street\\
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.