Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!batcomputer!cornell!rochester!pt.cs.cmu.edu!cadre!pitt!cisunx!dcarson From: dcarson@cisunx.UUCP (David Carson) Newsgroups: comp.text Subject: tabstop according to longest line Keywords: TeX, alignment Message-ID: <16709@cisunx.UUCP> Date: 13 Mar 89 20:59:36 GMT Reply-To: dcarson@cisunx.UUCP (David Carson) Distribution: na Organization: Univ. of Pittsburgh, Comp & Info Sys Lines: 36 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^ First I tried using \halign without success. Then I managed, I think, to get it with the following: \settabs\+\hskip plus minus&\cr and then setting the lines with a tab: \+&\cr This does not seem very elegant, and I'm not totally convinced that it works perfectly. One problem I am trying to avoid is the subtle problem of TeX pushing the lines (still left-justified) past the margin, without calling it an overfull box (this happened before I added "plus minus"). Is there a way in TeX to measure text? Then I could do something like: \dimen1=\hsize \advance\dimen1 by-\measure %subtract the length of text \settabs\+\hskip<\dimen1>&\cr If this question warrants an answer on the net, answer me there. Otherwise, just send me e-mail. Thank you. David Carson Internet: dcarson@unix.cis.pittsburgh.edu Bitnet: dcarson@PITTVMS