[OS X TeX] latex2rtf: A developer's perspective
Scott Prahl
prahl at bme.ogi.edu
Wed Apr 21 20:25:46 CEST 2004
I keep an eye of this mailing list primarily to make sure that I can
help people who are having problems with latex2rtf or rtf2latex2e.
As everyone realizes, the issue of living in a world dominated by
Microsoft Word makes these types of conversions mandatory from time
to time.
The first thing that you must accept when converting from latex to
RTF is that the document will not be as nice as the latex document.
RTF is a limited mark-up language and Word has some pretty horrible
typesetting limitations. If you wanted fidelity, you would have
opted to convert to PDF in the first place, right?
Now, not infrequently on this list, someone writes that latex2rtf
worked horribly. Most recently, this occurs because I changed
latex2rtf output so that it could be opened with TextEdit.
Unfortunately
TextEdit does a poor job rendering anything but the simplest RTF
files, and someone who double clicks on an RTF file will view the
file with TextEdit.
People's poor perception of latex2rtf may be based on having tested
an old version. More recent versions suck much less than the old
versions. The current version is 1.9.15 and can be downloaded at
http://prdownloads.sourceforge.net/latex2rtf/latex2rtf-1.9.15.tar.gz
The advantages and disadvantages of latex2rtf stem from the level at
which conversions are performed. The latex command \section gets
mapped directly into a series of rtf commands in latex2rtf. The proper
style sheet is used which can then be tweaked in Word. Similarly,
bibliographic references (e.g. \label) refer get bookmark fields
inserted into the RTF so that the converted document can use Word's
cross-referencing features. Finally, equations are converted to
Word fields and can be edited within Word.
One disadvantage to this process is obvious when tables
are translated. Since there is not table command in RTF the high
level conversion does not work so nicely. For example,
\begin{tabular}{c|c}
\multicolumn{2}{c}{example}\\
A & B \\
\hline
C & D
\end{tabular}
is translated into a table with the proper lines and entries in Word,
but
has two columns that span the entire width of the page. These can be
resized in Word but it is a nuisance. The problem is that latex2rtf
has no way to measure the size of each table cell and then automatically
adjust the table as TeX can. Perhaps the next version of latex2rtf
will have some better heuristics to figure out column size.
Another disadvantage of trying to convert high level latex commands
is when someone (or some package) tries to change low level latex
or tex commands. Something like TeX4ht is perfectly suited for this
since it works at a very low level and can handle redefinitions quite
well. On the other hand, if you want editable equations in Word,
then the latex -> html -> word process will only leave you with
images of your equations.
Now for some specifics. Thomas Schröder provided his test document
and said that latex2rtf failed. The conversion was OK except that (1)
\fbox has a bug and the figure was lost and (2) \centering doesn't
work properly.
I mention this not to defend latex2rtf so much as to point out that
without his simple test document, I would never have known about the
\fbox bug (since I do not use that particular latex command). I would
also not have known that I need to revisit the handling of \centering
in a figure environment. latex2rtf is open source and will only get
better through feedback like this --- nice simple examples showing the
problems.
Finally, Thomas Schröder wrote
> If I still have to adjust a few things manually than that's OK, and I
> can also live with having to replace all of the images with better
> quality ones. But all the other things like table of contents,
> references, bibliography, footnotes, math, greek symbols, German
> language, figures, tables, tabulars, index, nomenclature should work
> automatically because if they don't than I guess I'd be faster doing
> it by hand.
For what it is worth, everything above works with the except of the
table of contents, index and (the nomenclature package?). Image
translation
is as good a you want by selecting the DPI in the converted image. If
you want to insert EPS file into an RTF document, then please, please
show me how! FWIW, I am working on producing table of contents in
the translated document.
Enough! Sorry about the long rant.
Scott Prahl
-----------------------------------------------------
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.
More information about the macostex-archives
mailing list