🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.text
Article #366

Re: troff problems with \h

#366
From: hansen
Date: Wed, 14 Nov 1984 16:12
26 lines
1451 bytes
Thank you to everyone who responded to my question on troff. My question had
to do with using the width of a string within a \h construct to do
horizontal movement, as in:

	\h'0-\w'foo'/2u+14n'

The trouble boils down to the fact that the \w construct returns a number,
scaled in units, for the width. The fact that scaling has already occurred
is not returned. Then \h takes that number and scales it AGAIN with the
default scaling of an em. The solution is to add a 'u' after the \w to
indicate to troff that the number is already scaled, as in:

	\h'0-\w'foo'u/2u+14n'
		    ^
		    |

As one person put it,

< The key here is that troff is incredibly stupid about units.
< It is safest to always put a units specifier on everything.

Thanks again. I hope that this short note will save someone else grief at
some time in the future.

					Tony Hansen
					pegasus!hansen
Technical Details
Message-ID: <1909@pegasus.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxj!houxm!hogpc!pegasus!hansen
References: <1891@pegasus.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site pegasus.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxj!houxm!hogpc!pegasus!hansen
From: hansen@pegasus.UUCP
Newsgroups: net.text
Subject: Re: troff problems with \h
Message-ID: <1909@pegasus.UUCP>
Date: Wed, 14-Nov-84 11:12:34 EST
Article-I.D.: pegasus.1909
Posted: Wed Nov 14 11:12:34 1984
Date-Received: Thu, 15-Nov-84 03:20:57 EST
References: <1891@pegasus.UUCP>
Organization: AT&T Information Systems, Lincroft NJ
Lines: 26