Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!batcomputer!cornell!rochester!pt.cs.cmu.edu!andrew.cmu.edu!mc3i+ From: mc3i+@andrew.cmu.edu (Martin Costabel) Newsgroups: comp.text Subject: Re: tabstop according to longest line Message-ID: Date: 14 Mar 89 03:35:45 GMT References: <16709@cisunx.UUCP> Organization: Mathematics, Carnegie Mellon, Pittsburgh, PA Lines: 41 In-Reply-To: <16709@cisunx.UUCP> > *Excerpts from ext.nn.comp.text: 13-Mar-89 tabstop according to longes..* > *David Carson@cisunx.UUCP (1339)* > I need a little simple advice on alignment. I'm trying to make a letterhead > where the address appears on the right side of the page, but is not right- > justified. It should be left justified so that the longest line of the > address is flush with the right margin, like so: > John Doe | > 1600 Pennsylvania Ave| > Washington, D.C. | > 20002 | > margin^ [Unsatisfactory solutions deleted] Shortest answer: Use the LaTeX letter style. From letter.sty one finds the explicit LaTeX solution: {\raggedleft \begin{tabular}{l}\ignorespaces John Doe\\ 1600 Pennsylvania Ave\\ Washington, D.C.\\ 20002 \end{tabular}\par} A corresponding Plain TeX solution would be {\leftskip 0pt plus 1fill \parskip 0pt \def\\{\egroup\par\hbox\bgroup} \leavevmode \hbox{\vbox{{\\ John Doe\\ 1600 Pennsylvania Ave\\ Washington, D.C.\\ 20002 }}}\par} This solution leaves the computation of lengths of lines to TeX. --Martin Costabel