I am trying to re-create the letter format using just regular LaTex commands since the letter packages do not give me the desired effect.
In a standard US letter, my (the sender) address would be on the right side of the page, while every line of my address should be flush on the left end. I am wondering how I can achieve this?
Example:
Office 123
Some building
Some company that has a long name
Some city
some zip 12345
Some country
I want the right end of the longest line of my address block, “Some company that has a long name'' to align with the right edge of the body text of my letter, and at the same time, all lines within my block are flush left.
Any idea how I can do that in LaTex? Thanks!
— follow up —
\documentclass[10pt]{article}
%this is for setting up text fonts, pick one and comment out all others
%\usepackage{charter}
\usepackage{kpfonts}
%\usepackage{Times}
\usepackage{graphicx}
%\usepackage{showframe}
\usepackage{calc}
\usepackage{pbox}
% Text layout
\topmargin -2.0cm
\oddsidemargin 0.2 cm
\evensidemargin 0.4cm
\textwidth 15.5cm
\textheight 25cm
\setlength{\parindent}{0pt}
\begin{document}
\thispagestyle{empty}
\begin{minipage}[t]{\textwidth}
\includegraphics[width=3.5cm]{Olympics.jpg}
\hfill
\begin{tabular}{@{}l@{}}
Office 123 \\
Some building \\
Some company that has a long name\\
Some city, some zip 12345 \\
Some country
\end{tabular}
\end{minipage}
\end{document}
Best Answer
There are many ways … two of them:
(Instead of
\hfill
you can also use{\raggedright <stuff>}
.)Code
Output
Update
The
\hrulefill
should be substituted with\hfill
. It's only there to show the baseline.Code
Output