[comp.text] Example Macro Package -- Input and Result repost

lee@anduk.co.uk (Liam R. Quin) (05/15/89)

[this is a repost -- 1st try was killed by a local uucp bug!]

A week or so ago I offered to post some annotated troff macro examples...
Several people have taken me up on this, so here goes!

Enclosed is an example of some input to a fairly typical modern troff
macro package, and the resulting (PostScript) output.  It's just a short
example to give some idea of some of the things I could cover.

If you don't have a PostScript printer, don't worry -- only one or two
of the remaining examples use it, the othersall work on an LN03, Imagen,
HP, APS5 or whatever....

Lee.


uucp:      {utzoo,uunet}!utai!anduk.uucp!lee
Internet   lee%anduk.uucp@ai.toronto.edu
JANET:     lee%uk.co.anduk@uk.ac.warwick.uu

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  example example.ps
# Wrapped by lee@anduk.co.uk on Sat May 13 22:31:13 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f example -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"example\"
else
echo shar: Extracting \"example\" \(918 characters\)
sed "s/^X//" >example <<'END_OF_example'
X.\" Use ts -mu %
X.nr size 12 \" larger than the default 11 point type
X.Page A4 \" I have European paper
X.Title "Using Troff"
X.Author "Liam R. Quin, Unixsys (UK) Ltd
X.HEAD T "HIS IS A SHORT"
Xdescription of what we will be covering today.  Actually, I have
Xdeleted most of this to save bytes on the net!
XThis isn't an exact list of the material I have to post, nor is it
Xnecessarily in the right order.
X.((list
X. Item
XIntroduction
X. Item
XCoffee
X. Item
XOverview of Troff's Programming Facilities
X. Item
XTricks With Names
X. Item
XData Structures
X. ((list
X.  Item
XStacks
X.  Item
XQueues
X.  Item
XCallout Lists
X. ))list
X. Item
XSyntax and Semantics
X. Item
XTea
X. Item
XTechniques and Idioms
X. ((list
X.  Item
XUsing Diversions
X.  Item
XPage Layout
X.  Item
XMultiple Column Work
X.  Item
XVertical Justification
X.  Item
XObjects and Attributes
X.  Item
XGetting Clever with the Pre-processors
X. ))list
X. Item
XSGML
X. Item
XEfficiency
X.))list
END_OF_example
if test 918 -ne `wc -c <example`; then
    echo shar: \"example\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f example.ps -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"example.ps\"
else
echo shar: Extracting \"example.ps\" \(4932 characters\)
sed "s/^X//" >example.ps <<'END_OF_example.ps'
X%!
X%%Creator: SoftQuad Troff
X%%Title: 01.context2
X%%CreationDate: Sat May 13 18:38:22 1989
X%%DocumentFonts: (atend)
X%%Pages: (atend)
X%%EndComments
Xsave
Xinitgraphics
X/FT 0 def/RES 300 def/GTP 72 RES div def/PTOG RES 72 div def GTP GTP
Xscale/pt{PTOG mul}def 70 45{dup mul exch dup mul add 1 sub}setscreen/sqtran[0
X0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 22 24 26 28 31 34 37 40 42
X44 46 48 49 51 52 54 55 57 59 60 62 63 65 66 68 69 71 72 72 73 74 75 76 77 78
X78 79 80 81 82 83 83 84 85 85 86 87 87 88 88 89 89 90 90 91 91 92 92 93 93 94
X94 95 95 96 96 97 97 97 97 98 98 98 98 99 99 99 99.5 100]def{100 mul round cvi
Xsqtran exch get 100 div}settransfer 0 setlinejoin 0 setlinecap/N{findfont exch 
Xscalefont setfont}def/hm{currentpoint exch pop moveto}def/s{exch currentpoint
Xexch pop moveto show}bind def/rm{rmoveto}def/vm{0 exch
Xrmoveto}def/M{currentpoint exch pop add
Xmoveto}def/cp{currentpoint}def/dl{rlineto stroke moveto}bind def/BOX{/dy exch
Xdef/dx exch def currentpoint gsave newpath moveto dx 0 rlineto 0 dy neg
Xrlineto dx neg 0 rlineto 0 dy rlineto dx 0 rlineto closepath FT 0
Xeq{stroke}{FT 1 eq{fill}{FT sqpat}ifelse}ifelse grestore}def/S{1 sub
Xsetlinewidth}def/PTYPE{/tpage 0 def/landscape exch def/pagey exch def/pagex
Xexch def/gtop pagey def landscape 0 eq{/gtop pagex def}if/clipy exch
Xdef/clipx exch def/dclipy exch def/dclipx exch def neg gtop add
Xtranslate/wanted exch def landscape 0 eq{90 neg rotate pagex pagey translate
X180 rotate/tpage pagey def}if/inmachine(legal)def statusdict begin pagetype
X2 lt{/inmachine(letter)def}{/inmachine(note)def}ifelse
Xend}def/patArray[[<00000000 00000000 00000000 00000000 00000000 00000000
X00000000 ffffffff ffffffff 00000000 00000000 00000000 00000000 00000000
X00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
X00000000 ffffffff ffffffff 00000000 00000000 00000000 00000000 00000000
X00000000 00000000>32 0]] def/PATMAX patArray length def/freq 72 300 32 div div
Xdef/sf{/y exch def/x exch def/xindex x 1 add 2 div Bsize mul cvi def/yindex y
X1 add 2 div Bsize mul cvi def/byte bitString yindex Bwid mul xindex 8 idiv
Xadd get def/mask 1 7 xindex 8 mod sub bitshift def byte mask and 0 ne{/On On 1
Xadd def 1}{/Off Off 1 add def 0}ifelse}def/g{setgray}def/sqpat{2 sub PATMAX
Xmod patArray exch get dup dup 2 get/angle exch def 1 get/Bsize exch def 0
Xget/bitString exch def/Bwid Bsize 8 idiv def/On 0 def/Off 0 def gsave
Xfreq angle/sf load setscreen{}settransfer Off Off On add div g fill
Xgrestore}def/A{M 0.8 g/FT 1 def 35 -35 BOX 0 g/FT 0 def 250 hm 35 -35
XBOX}def/B{M 0.8 g/FT 1 def 35 -35 BOX 150 10 M 1 g 35 -35 BOX 0 g/FT 0 def
X35 -35 BOX}def
X%%EndProlog
X%%BeginSetup
X(A4) 21 17 56 25 2480 3507 2480 3507 4 PTYPE
X%%EndSetup
X%%Page: 1 1
X%%PageFonts: (atend)
Xsave newpath 0 tpage moveto/FT 0 def 0 g
X150 -175 M
X1 S 0.8 g/HBO{/Helvetica-BoldOblique}def 18 pt HBO N 150(UNIXSYS)s
X500(UK)s 629(LTD)s 0 g/HB{/Helvetica-Bold}def 9 pt
XHB N 2209(Page)s 2309(1)s
X150 -25 M 0.9 g/FT 0 def 12 S cp 2180 0 dl
X0.8 g 2 S/FT 1 def 167 -194 M 61 -61 BOX
X150 15 M 1 g 61 -61 BOX 0 g/FT 0 def 150 hm 61 -61 BOX/HR{/Helvetica}def 19
Xpt HR N 248(Using)s 472(T)s 514(roff)s -255 vm 43 pt HB N
X150(T)s/TR{/Times-Roman}def 10 pt TR N 246(HIS)s 326(IS)s 376(A)s 419(SHORT)s
X12 pt TR N 570(description)s 807(of)s 864(what)s 976(we)s 1049(will)s
X1142(be)s 1204(covering)s 1394(today)s 1502(.)s 1541(Actually)s 1710(,)s
X1737(I)s 1769(have)s 1878(deleted)s 2037(most)s 2149(of)s 2205(this)s
X2291(to)s -60 vm 150(save)s 253(bytes)s 373(on)s 438(the)s 514(net!)s
X619(This)s 723(isn't)s 827(an)s 889(exact)s 1009(list)s 1085(of)s 1142(the)s
X1218(material)s 1397(I)s 1429(have)s 1538(to)s 1592(post,)s 1702(nor)s
X1783(is)s 1830(it)s 1872(necessarily)s 2107(in)s 2160(the)s 2235(right)s
X-60 vm 150(order)s 254(.)s
X161 -95 B
X250(Introduction)s
X161 -95 B
X250(Coffee)s
X161 -95 B
X250(Overview)s 459(of)s 513(T)s 540(roff's)s 664(Programming)s 952(Facilities)s
X161 -95 B
X250(T)s 277(ricks)s 386(With)s 498(Names)s
X161 -95 B
X250(Data)s 356(Structures)s
X250 -85 A
X350(Stacks)s
X250 -85 A
X350(Queues)s
X250 -85 A
X350(Callout)s 509(Lists)s
X161 -155 B
X250(Syntax)s 401(and)s 485(Semantics)s
X161 -95 B
X250(T)s 277(ea)s
X161 -95 B
X250(T)s 277(echniques)s 488(and)s 572(Idioms)s
X250 -85 A
X350(Using)s 481(Diversions)s
X250 -85 A
X350(Page)s 459(Layout)s
X250 -85 A
X350(Multiple)s 534(Column)s 707(W)s 750(ork)s
X250 -85 A
X350(V)s 383(ertical)s 520(Justi\256cation)s
X250 -85 A
X350(Objects)s 514(and)s 598(Attributes)s
X250 -85 A
X350(Getting)s 512(Clever)s 657(with)s 758(the)s 831(Pre-processors)s
X161 -155 B
X250(SGML)s
X161 -95 B
X250(Ef\256ciency)s
X150 -763 M 0.9 g 12 S cp 2180 0 dl -90 vm 0 g 9 pt HB N
X150(Liam)s 247(R.)s 294(Quin,)s 399(Unixsys)s 553(\(UK\))s 641(Ltd)s
X2134(Using)s 2248(T)s 2268(roff)s showpage
X%%PageFonts: Helvetica-Bold Helvetica-BoldOblique Helvetica Times-Roman
Xrestore
X%%Trailer
X%%Pages: 1
X%%DocumentFonts: Helvetica-Bold Helvetica-BoldOblique Helvetica Times-Roman
Xrestore
END_OF_example.ps
if test 4932 -ne `wc -c <example.ps`; then
    echo shar: \"example.ps\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0

-- 
Lee Russell Quin, Unixsys UK Ltd, The Genesis Centre, Birchwood,
Warrington, ENGLAND, WA3 7BH; Tel. +44 925 828181, Fax +44 925 827834
	lee%anduk.uucp@ai.toronto.edu;  {utzoo,uunet}!utai!anduk!lee
UK:	uu.warwick.ac.uk!anduk.co.uk!lee