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
|
----------------------------
TeXPerfect Readme File
----------------------------
John Forkosh
forkosh@panix.com
INTRODUCTION
-----------------------------------------------------------------
TeXPerfect is yet another WordPerfect-to-LaTeX conversion program.
As WordPerfect is called wp, TeXPerfect is called tp (and, yes, I'm
aware of the double-entendre, and leave you to decide which meaning
best fits the acronym :).
TABLE-OF-CONTENTS
-----------------------------------------------------------------
texperf.zip gnu zipped distribution of TeXPerfect containing...
00README this file (no other documentation is available)
texperf.c TeXPerfect main()
wp2tex.c additional functions
tptools.c ditto
wptools.c ditto
texperf.h TeXPerfect header file
wpchrset.h ditto
texcmds.h ditto
eqnkwds.h ditto
Makefile.gcc Linux makefile (probably not necessary)
Makefile.ztc DOS makefile for Zortech C (probably not useful)
tp Linux a.out executable
tp.exe MS-DOS executable (won't run from a Windows DOS box)
lint.wpd Sample WP document (from C Users Journal, May 1991)
QUICK-START INSTRUCTIONS
-----------------------------------------------------------------
To convert the sample document, enter
tp lint.wpd
After several seconds (or less) tp will complete, creating file
lint.wpx as output. Run WordPerfect on lint.wpx, and use wp's
"DOS Text" option to create ascii file lint.tex for input to LaTeX.
Note that tp can't convert complicated documents (lint.wpd
included) completely automatically (see below). So don't actually
try to process lint.tex. But do compare lint.wpd and lint.wpx to
get a feel for the extent to which tp can help you prepare your
existing WordPerfect documents for LaTeX.
HISTORY
-----------------------------------------------------------------
TeXPerfect is provided as GPL/copylefted source, and released with
_no_ official support of any kind whatsoever. I wrote tp in 1992,
originally for my own internal purposes, and for the proprietary
use of some of my clients. As tp took shape, I considered the
possibility of releasing it as Shareware. That idea never
materialized because I couldn't find enough "spare" time to develop
the program sufficiently, nor to provide ongoing support for it.
So I'm now releasing tp as GPL/copylefted source, rather than
letting it fade away entirely.
Since I still have no spare time, anyone who finds tp's design
and/or implementation worth pursuing (under the GPL) is encouraged
to do so.
DISTRIBUTION AND SOURCE CODE
-----------------------------------------------------------------
I've comnpiled and run TeXPerfect under Linux using gcc, and under
DOS using an old Zortech compiler with a 32-bit DOS extender. The
same source compiles and executes under both environments without
any changes whatsoever (except, of course, for the cr/lf conversion
required for DOS/Unix -- all text files here are for Unix).
There are four C source files accompanied by another four header
files:
texperf.c texperf.h
wp2tex.c texcmds.h
wptools.c wpchrset.h
tptools.c eqnkwds.h
The very trivial Makefile.gcc and Makefile.ztc are also included,
although they're hardly necessary. Just enter
cc texperf.c wp2tex.c wptools.c tptools.c -o tp
to compile and link the program.
The Linux a.out executable, called tp, resulting from the above
step is also included, as is the MS-DOS executable, tp.exe. Note
that Zortech's extender won't run under a Windows DOS box, so
you'll need to re-compile to use it in that fashion.
USAGE
-----------------------------------------------------------------
Input to TeXPerfect is a wp5.1 file. Output is _another_ wp5.1
file (same filename, extension .wpx), with many LaTeX conversions
performed. To generate the ascii file needed for LaTeX, just run
WordPerfect on TeXPerfect's output, and then use the "DOS Text"
option (Ctrl-F5, 1, 1 on wp5.1 for DOS). This two-step procedure
lets you continue using wp as your text editor, if you want. The
overall edit cycle consists of the following five steps:
1 Run TeXPerfect on your existing WordPerfect 5.1 file. This is
done only once.
2 Since TeXPerfect can't recognize/convert all constructions,
you'll need to fix its output by hand. In principle, this is
done only once, too, but it might take several passes to get
it all right.
3 Save your wp5.1-formatted file, then use wp's "DOS Text"
option to generate an ascii file with a .tex extension, and
then exit wp. (Important: Once you use the "DOS Text" option,
wp can no longer save your file in WordPerfect format. So
_first_ save it in the usual way, making sure the "DOS Text"
option is the _very_last_ thing you do before exiting wp.)
4 Run TeX/LaTeX as usual.
5 For corrections or additional content editing, run wp, do your
editing, and then return to Step 3 above.
If you wish to abandon wp entirely, perform Steps 1-3 once. You'll
then have an ascii file which can be edited in any way you prefer.
CONVERSION FUNCTIONALITY
-----------------------------------------------------------------
Some of the LaTeX conversions performed by TeXPerfect are:
o Suppose your input contains a greek alpha from the WordPerfect
character set 8. The output will contain $\alpha$ instead.
Most of the other special character sets provided by
WordPerfect are similarly converted. (This conversion is
table-driven by the data in wpchrset.h, and can be easily
augmented or modified.)
o Superscripts, subscripts, bold, italics, etc, are all properly
interpreted and handled.
o "Hard" returns in WordPerfect _should_ generate an extra blank
line, so that LaTeX will see them as paragraphs. That
functionality is mostly programmed, but a last-minute
difficulty prevented me from completing it. Also, no attempt
is made to generate section/subsection/etc commands.
o If your running text contains an expression like f(x),
TeXPerfect will recognize it and surround it with $'s. A
variety of other ad hoc "rules" are hand-coded into the
program to decide when to enter/exit math mode. Needless to
say, the decision isn't always right. You'll need to correct
tp's mistakes in Step 2 above.
o Equations written with WordPerfect's equation editor will be
reproduced "verbatim" by TeXPerfect, surrounded by \[ and \].
The only correction applied is that 1 over 2 becomes
1 \over 2, and similarly for various other keywords. But no
serious attempt to interpret and translate your equation is
made. Matrices, etc, will require considerable hand-tweaking
on your part. But at least you'll have what you originally
wrote right in front of your eyes.
o A little LaTeX preamble, etc, is provided, primarily for
"cosmetic" purposes. WordPerfect's margin settings, etc, are
_not_ interpreted to construct this preamble. You'll have to
modify that information yourself.
WARNINGS
-----------------------------------------------------------------
TeXPerfect was written to interpret files formatted by WordPerfect
5.1 for DOS. When run against 5.1 files, TeXPerfect is pretty
robust. But, for this release, I commented out the lines that
check the version number. If you're using WP/Win, it can prepare
output in 5.1 format. I'd recommend you do that before using
TeXPerfect.
CONCLUDING REMARKS
-----------------------------------------------------------------
If you're a WordPerfect and LaTeX user, but not a programmer, then
all you can do is run tp against your wp files, and see whether or
not the results are useful to you. I hope that they are, and that
you find tp to be helpful. But I won't have time to tweak the
program to provide additional functionality.
If you're a programmer too, then you may wish to tweak it yourself.
Although the underlying design is pretty clean, there's a lot of
spaghetti on top of it. I would guess that if you can't make any
headway finding what you want in less than an hour, then you won't
find it in less than ten hours either.
====================== END-OF-FILE 00README =====================
|