Dear Richard, Thanks very much for your response.
On Thursday 24 May 2007, Richard Heck wrote: > 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. That sounds like a good answer to my problem; I'd actually never heard of oolatex before. I had even spent some time googling for "latex2odf." However, I'm having an unexpected degree of trouble getting oolatex to work. First, for me neither LyX 1.4.3 nor LyX 1.5.0beta3 gives an OpenDoc option under its list of export formats. (See the attached screen shot of the export menu on my machine.) So I figured I'd have to export to LaTeX and then run oolatex from the command line. Next problem: oolatex does not seem to have a clear "home" on the net, and doing an "apt-cache search oolatex" under Kubuntu Feisty (even with universe & multiverse enabled) doesn't come up with anything. I guessed that under Kubuntu one needs to install tex4ht. I then found the oolatex executable in /usr/share/tex4ht/ (it wasn't placed on the global path). I added this directory to my path. But then running oolatex resulted in the following output (note: 29 pages of output! For 2 lines of text?): [snip] Output written on lyx_trial.dvi (29 pages, 54456 bytes). Transcript written on lyx_trial.log. ---------------------------- tex4ht.c (2006-09-13-14:27 kpathsea) tex4ht -f/lyx_trial.tex -i/usr/share/texmf/tex4ht/ht-fonts/ -cmozhtf --- warning --- Can't find/open file `tex4ht.env | .tex4ht' --- error --- Illegal storage address ---------------------------- t4ht.c (2006-09-13-14:28 kpathsea) t4ht -f/lyx_trial.tex -coo --- warning --- Can't find/open file `tex4ht.env | .tex4ht' --- warning --- Can't find/open file `lyx_trial.lg' And, of course, no lyx_trial.odt file. I even did an updatedb and found the tex4ht.env file (in two places). Finally, executing the following command: tex4ht oolatex -e/etc/tex4ht/tex4ht.env lyx_trial appeared to be successful. It created a whole heap of files, but none of them looked like OpenDoc files. The closest was an XML file with the extension .4oo, but opening this will oowriter did not yield anything that looked like a normal document. I also tried redoing ./configure, make clean, make for LyX 1.5.0beta3 to see if, after installing tex4ht, it would present me with an OpenDocument export option. No dice. Searching the LyX wiki for oolatex yields 0 documents. However, one can find http://wiki.lyx.org/Tools/LyX2OpenOffice, which recommends ConvLaTeX. Which I then downloaded and installed. After reading the documentation and configuring it (it's a bit non-standard...), I finally got it to output a file, but it was a .sxw (not OpenDoc) and it didn't handle the subscripts and superscripts correctly anyway. (I even asked OO to save as a .doc file and opened it in MSWord under Wine, but that didn't show anything useful, either.) At this point I'm suspecting there's a really simple answer that I'm missing. Or there's some weird use-case bug (or Ubuntu-specific issue?) that's causing me all this grief. I'd be happy to file a bug report, but it seems like I'm running up against so much weirdness that I hardly know where to start. > 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 like that solution, I was considering it myself, and was about to start writing one when I got your email. Many thanks! Best, --Tim > 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
<<attachment: export_options.png>>