summaryrefslogtreecommitdiff
path: root/support/tr2latex/testfile
blob: 909b6c83eb564bc7ec7733f352a76a2334486ca4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
.ds AA Test Troff String
.nr VS 12p
.DA
.ND
.EQ
delim $$
gsize 11
define dC "delta C"
define xx 'x sup x'
define B 'bold B'
define (( 'left ('
define )) 'right )'
define ov 'over'
.EN
.ds CF %
.ds LH Al-Yahya
.ds RH troff to LaTeX translator
.TL
Testing the troff-to-LaTeX translator
.AU
Kamal Al-Yahya
.AI
Stanford University
.AB
This file demonstrates the use of \fBtr2latex\fR which translates
documents written in troff to a LaTeX style.
Examples are given to show what the translator can do.
.AE
.TS
allbox;
cfI s s
c cw(1i) cw(1i)
lp9 lp9 lp9.
New York \
Area Rocks
Era	Formation	Age (years)
Precambrian	Reading Prong	>1 billion
Paleozoic	Manhattan Prong	400 million
Mesozoic	T{
.na
Newark Basin, incl.
Stockton, Lockatong, and Brunswick formations; also Watchungsand Palisades.
T}	200 million
Cenozoic	Coastal Plain	T{
On Long Island 30,000 years;Cretaceous sediments redepositedby recent glaciation.
.ad
T}
.TE
.NH 1
Section
may be several lines
.LP
Li Eur\*Cop\*`an \*:A\*~z \*(AA lingu\*^es es mem\(embres del sam famili\*'e.
Lor separat existentie es un myth.
Por scientie, musica, sport etc, litot Europa usa li sam vocabular.
Li lingues differe solmen in li grammati\*,Ca, li pronunciation e li plu commun vocabules.
Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores.
At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.
Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues.
Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues.
.PP
.NH 2
SubSection
.LD
.TS
tab(&);
l l.
T{
It va esser tam simplic quam Occidental in fact, it va esser Occidental.
A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es.
Li Europan lingues es membres del sam familie.
Lor separat existentie es un myth.
T} & T{
Por scientie, musica, sport etc, litot Europa usa li sam vocabular.
Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules.
Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores.
At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.
T}
.TE
Por scientie, musica, sport etc, litot Europa usa li sam vocabular.
Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules.
.DE
Adjust right
.LP
.\"ad r
Omnicos directe al desirabilite de un nov lingua franca:
On refusa continuar payar custosi traductores.
At solmen va esser necessi far uniform grammatica,
pronunciation e plu sommun paroles.
.\"ad
.LP
.NH 2
Special Characters
.TS
tab(,),center box linesize(2);
l l l l l l l l l l l.
\(em,   \e(em,  ,   \(sc,   \e(sc,  ,   \(ib,   \e(ib,  ,   \(hy,   \e(hy
\(ul,   \e(ul,  ,   \(ip,   \e(ip,  ,   \(bu,   \e(bu,  ,   \(sl,   \e(sl
\(if,   \e(if,  ,   \e(sq,  \e(sq,  ,   \(ts,   \e(ts,  ,   \(pd,   \e(pd
\(ru,   \e(ru,  ,   \(sr,   \e(sr,  ,   \(gr,   \e(gr,  ,   \(14,   \e(14
\(rn,   \e(rn,  ,   \(no,   \e(no,  ,   \(12,   \e(12,  ,   \(>=,   \e(>=
\(is,   \e(is,  ,   \(34,   \e(34,  ,   \(<=,   \e(<=,  ,   \(pt,   \e(pt
\(fi,   \e(fi,  ,   \(==,   \e(==,  ,   \(es,   \e(es,  ,   \(fl,   \e(fl
\(|=,   \e(|=,  ,   \(mo,   \e(mo,  ,   \(ff,   \e(ff,  ,   \(ap,   \e(ap
\(br,   \e(br,  ,   \(Fi,   \e(Fi,  ,   \(!=,   \e(!=,  ,   \(dd,   \e(dd
\(Fl,   \e(Fl,  ,   \(->,   \e(->,  ,   \(rh,   \e(rh,  ,   \(de,   \e(de
\(<-,   \e(<-,  ,   \(lh,   \e(lh,  ,   \(dg,   \e(dg,  ,   \(ua,   \e(ua
\(bs,   \e(bs,  ,   \(fm,   \e(fm,  ,   \(da,   \e(da,  ,   \(or,   \e(or
\(ct,   \e(ct,  ,   \(mu,   \e(mu,  ,   \(ci,   \e(ci,  ,   \(rg,   \e(rg
\(di,   \e(di,  ,   \(bv,   \e(bv,  ,   \(co,   \e(co,  ,   \(+-,   \e(+-
\(lf,   \e(lf,  ,   \(pl,   \e(pl,  ,   \(cu,   \e(cu,  ,   \(rf,   \e(rf
\(mi,   \e(mi,  ,   \(ca,   \e(ca,  ,   \(lc,   \e(lc,  ,   \(eq,   \e(eq
\(sb,   \e(sb,  ,   \(rc,   \e(rc,  ,   \(**,   \e(**,  ,   \(sp,   \e(sp
.TE
.sp
The Macros \e(*a - \e(*w for small greek letters and \e(*A - \e(*W for upper greek letters.
.TS
tab(,);
l l l l l l l l l l l l l l l l l l l l l l l l.
   a,   b,   g,   d,   e,   z,   y,   h,   i,   k,   l,   m,   n,   c,   o,   p,   r,   s,   t,   u,   f,   x,   q,   w
\(*a,\(*b,\(*g,\(*d,\(*e,\(*z,\(*y,\(*h,\(*i,\(*k,\(*l,\(*m,\(*n,\(*c,\(*o,\(*p,\(*r,\(*s,\(*t,\(*u,\(*f,\(*x,\(*q,\(*w
.sp
   A,   B,   G,   D,   E,   Z,   Y,   H,   I,   K,   L,   M,   N,   C,   O,   P,   R,   S,   T,   U,   F,   X,   Q,   W
 \(*A,\(*B,\(*G,\(*D,\(*E,\(*Z,\(*Y,\(*H,\(*I,\(*K,\(*L,\(*M,\(*N,\(*C,\(*O,\(*P,\(*R,\(*S,\(*T,\(*U,\(*F,\(*X,\(*Q,\(*W
.TE
.PP
First let's test some equation written for the
.B eqn
preprocessor:
.EQ (1)
2 left ( 1 ~+~ sqrt{omega sub i+1 + zeta -{x+1} over {THETA +1} y + 1} right )
~~~=~~~ half
.EN
.EQ
X + a >= a SIGMA
.EN
.EQ
left [
matrix {
   ccol { e sub 1 above . above . above e sub i above . above . above e sub N }
}
right ] sub n+1 ~~=~~ y + 1
.EN
.EQ
bold X + roman a ~>=~
a under hat fwd 20 sum from i to N lim from {x -> k} dC
.EN
.EQ
(( "speed" times "time" = "distance travelled" ))
.EN
.EQ
beta tilde i >= zeta dC
.EN
.EQ
GAMMA == PI -> upsilon fat xi
.EN
.EQ
G(z) ~=~ e sup { ln ~ G(z) }
    ~=~ exp left ( sum from k>=1 { S sub k z sup k } over k right )
    ~=~ prod from k>=1 e sup { S sub k z sup k /k }
.EN
.IP "" 10
In-line math like $beta +1$ which is surrounded by math delimiters, as
defined by
.I delim
is also translated.
.R
.PP
Only simple tables are translated. Translation of more complicated tables
is painful and I won't do it now. Here is an example:
.TS
tab(&),allbox;
l rc n.
name & type	& color	& value
_
$alpha$	& real	& red	& 2.3
$x$	& imaginary	& green	& -1.2
$a + 2$	& real	& white	& 0.0
.TE
\" this is a commented text
.PP
Now we start a figure.
.Is
.sp 3i
.Ic 1
This is the caption of the figure.
.Ie
.PP
Try some floating objects.
.br
.KS
This text should be kept in one page. i.e. a page break is discouraged here.
.KE
.br
Now a floating text.
.KF
This text should be kept in one page even if we had to move it around,
since it is a
.I floating
object. This is a boxed
.BX word.
.KE
.br
These characters are special in TeX, so they need to be escaped
in the translation % & # _, while these characters have to be
printed in math mode < > |.
.FS
This is a footnote
.FE
.PP
.Ac
Thanks to all of those who contributed by reporting bugs and suggesting
some improvements. Special thanks go to Nelson Beebe for all of his valuable
contributions and suggestions. He is responsible for making the translator
portable to other computers. He also made significant improvements to
the translation of manuals.
.Re
Knuth, D.E., 1984, The TeXBook, Addison-Wesley Publishing Company.
.Re
Lamprt, L., 1986, LaTeX: user's guide & reference manual, Addison-Wesley
Publishing Company.
.Re
Lesk, M.E., 1978, Typing documents on the UNIX
system: using the -ms macros
with troff and nroff, UNIX programmer's manual, v. 2B, sec. 3.
.Re
McGilton, H. and Morgan, R., 1983, Introducing the UNIX system, McGraw-Hill
Book Company.
.bp
.PX