Tim Holy wrote:
> At least in the biological sciences, most journals can't accept LaTeX, and so
> it's important for us to be able to export to RTF format for final submission
> of papers.
Try exporting to OpenDocument. In my experience, oolatex tends to be
more reliable than latex2rtf, which hasn't seen an update in 2.5 years.
> In LyX 1.5.0beta3 (and also in the 1.4 series), exporting to RTF
> works well with a notable exception: super- and subscripts in text. The
> reason for this is that these text superscripts are handled as $^\text{some
> text}$, and latex2rtf doesn't recognize the \text command. Consequently, the
> super and subscripts simply get omitted, which is a problem especially in
> papers that are heavy on chemical formulas...
>
This seems to work with oolatex, though it does give you a formula
rather than a text superscript.
> However, latex2rtf does handle \textsuperscript and \textsubscript correctly.
> Would it be possible to have LyX implement things using these commands
> instead of using the math-mode commands?
>
Possible, yes, but sufficiently non-trivial that it won't happen by
1.5.0, as we're too close to release and are more or less at
feature-freeze. Please file a bugzilla enchancement request so we don't
lose track of the issue, though. I'd like to have this myself.
It would, by the way, be very, very easy to write a translating script
that would take a LaTeX file as export by LyX and convert the offending
material. I've attached a perl script that will do it. Ugly, but mostly
because of the need to escape $, {, etc. Without the escapes, it's just:
s/$^{\text{([^}]*)}}/\textsuperscript{$1}/g;
This will fail if you have "}" in your superscript. (You could obviously
do the same thing in Python.) Using this, you could write a simple
script to wrap oolatex (or latex2rtf). On *nix:
#!/bin/bash
file=$1;
cp $file $file.tmp
perl fixscripts.pl <$file.tmp >$file;
oolatex $file;
rm $file.tmp
Save that where you wish and then change the LaTeX to OpenDocument
converter, in Tools> Preferences> Converters, to call this rather than
oolatex directly. Voila.
Richard
--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto
test.pl
Description: Perl program
