🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #5978

tabstop according to longest line

#5978
From: David Carson
Date: Mon, 13 Mar 1989 20:59
36 lines
1853 bytes
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<dimen known larger than required> plus<some> minus<some>&\cr

and then setting the lines with a tab: \+&<text>\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<some> minus<some>").

Is there a way in TeX to measure text?  Then I could do something like:

\dimen1=\hsize
\advance\dimen1 by-\measure<longest line of addr> %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
Technical Details
Message-ID: <16709@cisunx.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!batcomputer!cornell!rochester!pt.cs.cmu.edu!cadre!pitt!cisunx!dcarson

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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