Re: 1.5 feature request: textsuperscript textsubscript

2007-05-25 Thread Charles de Miramon
Tim Holy wrote:

 
 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.
 

The TeX4ht package in Debian (and I guess in Ubuntu) was unmaintained and
quite broken. New versions are better.

Cheers,
Charles
-- 
http://www.kde-france.org



Re: 1.5 feature request: textsuperscript textsubscript

2007-05-25 Thread Tim Holy
Hi,

On Friday 25 May 2007, Charles de Miramon wrote:
 The TeX4ht package in Debian (and I guess in Ubuntu) was unmaintained and
 quite broken. New versions are better.

OK, thanks for this. I posted something yesterday on the Ubuntu forums. Since 
it seems to not just be me, I'll file it as a real bug report.

Thanks,
--Tim


 Cheers,
 Charles




Re: 1.5 feature request: textsuperscript textsubscript

2007-05-25 Thread Tim Holy
Dear Enrico,

On Thursday 24 May 2007, Enrico Forestieri wrote:
 Notice that OpenOffice is at fault here and not latex2rtf.
 By default, latex2rtf uses EQ field codes for translating math constructs
 (see http://office.microsoft.com/en-gb/word/HP051861481033.aspx)
 but OpenOffice is not able to interpret them.

 Your example works perfectly when I open the produced rtf in Word.
 Maybe you could file an enhancement request to the OO people.

I could have sworn I'd tested that, but I must have first saved as .doc in OO 
and then opened it in Word. Thanks for pointing this out!

The one thing that doesn't work right is the italicization of the 
superscript---I guess latex2rtf doesn't ignore the text within the \text 
command (which it doesn't understand), it just puts it in wholesale. 

Thanks,
--Tim



Re: 1.5 feature request: textsuperscript textsubscript

2007-05-25 Thread Richard Heck

Tim Holy wrote:

On Thursday 24 May 2007, Enrico Forestieri wrote:
  

Notice that OpenOffice is at fault here and not latex2rtf.
By default, latex2rtf uses EQ field codes for translating math constructs
(see http://office.microsoft.com/en-gb/word/HP051861481033.aspx)
but OpenOffice is not able to interpret them.

Your example works perfectly when I open the produced rtf in Word.
Maybe you could file an enhancement request to the OO people.

I could have sworn I'd tested that, but I must have first saved as .doc in OO 
and then opened it in Word. Thanks for pointing this out!


The one thing that doesn't work right is the italicization of the 
superscript---I guess latex2rtf doesn't ignore the text within the \text 
command (which it doesn't understand), it just puts it in wholesale. 
  
And here's something even more obvious that I forgot: CharStyles can be 
used to do \text*script. It won't look right on screen, but you'll get 
the right output.


rh


Re: 1.5 feature request: textsuperscript textsubscript

2007-05-25 Thread Charles de Miramon
Tim Holy wrote:

 
 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.
 

The TeX4ht package in Debian (and I guess in Ubuntu) was unmaintained and
quite broken. New versions are better.

Cheers,
Charles
-- 
http://www.kde-france.org



Re: 1.5 feature request: textsuperscript textsubscript

2007-05-25 Thread Tim Holy
Hi,

On Friday 25 May 2007, Charles de Miramon wrote:
 The TeX4ht package in Debian (and I guess in Ubuntu) was unmaintained and
 quite broken. New versions are better.

OK, thanks for this. I posted something yesterday on the Ubuntu forums. Since 
it seems to not just be me, I'll file it as a real bug report.

Thanks,
--Tim


 Cheers,
 Charles




Re: 1.5 feature request: textsuperscript textsubscript

2007-05-25 Thread Tim Holy
Dear Enrico,

On Thursday 24 May 2007, Enrico Forestieri wrote:
 Notice that OpenOffice is at fault here and not latex2rtf.
 By default, latex2rtf uses EQ field codes for translating math constructs
 (see http://office.microsoft.com/en-gb/word/HP051861481033.aspx)
 but OpenOffice is not able to interpret them.

 Your example works perfectly when I open the produced rtf in Word.
 Maybe you could file an enhancement request to the OO people.

I could have sworn I'd tested that, but I must have first saved as .doc in OO 
and then opened it in Word. Thanks for pointing this out!

The one thing that doesn't work right is the italicization of the 
superscript---I guess latex2rtf doesn't ignore the text within the \text 
command (which it doesn't understand), it just puts it in wholesale. 

Thanks,
--Tim



Re: 1.5 feature request: textsuperscript textsubscript

2007-05-25 Thread Richard Heck

Tim Holy wrote:

On Thursday 24 May 2007, Enrico Forestieri wrote:
  

Notice that OpenOffice is at fault here and not latex2rtf.
By default, latex2rtf uses EQ field codes for translating math constructs
(see http://office.microsoft.com/en-gb/word/HP051861481033.aspx)
but OpenOffice is not able to interpret them.

Your example works perfectly when I open the produced rtf in Word.
Maybe you could file an enhancement request to the OO people.

I could have sworn I'd tested that, but I must have first saved as .doc in OO 
and then opened it in Word. Thanks for pointing this out!


The one thing that doesn't work right is the italicization of the 
superscript---I guess latex2rtf doesn't ignore the text within the \text 
command (which it doesn't understand), it just puts it in wholesale. 
  
And here's something even more obvious that I forgot: CharStyles can be 
used to do \text*script. It won't look right on screen, but you'll get 
the right output.


rh


Re: 1.5 feature request: textsuperscript & textsubscript

2007-05-25 Thread Charles de Miramon
Tim Holy wrote:

 
> 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.
> 

The TeX4ht package in Debian (and I guess in Ubuntu) was unmaintained and
quite broken. New versions are better.

Cheers,
Charles
-- 
http://www.kde-france.org



Re: 1.5 feature request: textsuperscript & textsubscript

2007-05-25 Thread Tim Holy
Hi,

On Friday 25 May 2007, Charles de Miramon wrote:
> The TeX4ht package in Debian (and I guess in Ubuntu) was unmaintained and
> quite broken. New versions are better.

OK, thanks for this. I posted something yesterday on the Ubuntu forums. Since 
it seems to not just be me, I'll file it as a real bug report.

Thanks,
--Tim

>
> Cheers,
> Charles




Re: 1.5 feature request: textsuperscript & textsubscript

2007-05-25 Thread Tim Holy
Dear Enrico,

On Thursday 24 May 2007, Enrico Forestieri wrote:
> Notice that OpenOffice is at fault here and not latex2rtf.
> By default, latex2rtf uses EQ field codes for translating math constructs
> (see http://office.microsoft.com/en-gb/word/HP051861481033.aspx)
> but OpenOffice is not able to interpret them.
>
> Your example works perfectly when I open the produced rtf in Word.
> Maybe you could file an enhancement request to the OO people.

I could have sworn I'd tested that, but I must have first saved as .doc in OO 
and then opened it in Word. Thanks for pointing this out!

The one thing that doesn't work right is the italicization of the 
superscript---I guess latex2rtf doesn't ignore the text within the \text 
command (which it doesn't understand), it just puts it in wholesale. 

Thanks,
--Tim



Re: 1.5 feature request: textsuperscript & textsubscript

2007-05-25 Thread Richard Heck

Tim Holy wrote:

On Thursday 24 May 2007, Enrico Forestieri wrote:
  

Notice that OpenOffice is at fault here and not latex2rtf.
By default, latex2rtf uses EQ field codes for translating math constructs
(see http://office.microsoft.com/en-gb/word/HP051861481033.aspx)
but OpenOffice is not able to interpret them.

Your example works perfectly when I open the produced rtf in Word.
Maybe you could file an enhancement request to the OO people.

I could have sworn I'd tested that, but I must have first saved as .doc in OO 
and then opened it in Word. Thanks for pointing this out!


The one thing that doesn't work right is the italicization of the 
superscript---I guess latex2rtf doesn't ignore the text within the \text 
command (which it doesn't understand), it just puts it in wholesale. 
  
And here's something even more obvious that I forgot: CharStyles can be 
used to do \text*script. It won't look right on screen, but you'll get 
the right output.


rh


1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Tim Holy
Hello,

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. 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...

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?

An example document is attached. Under LyX 1.5.0beta3, one simply needs to 
export as Rich Text Format and then open the file with OpenOffice to see what 
I'm talking about.

Best,
--Tim


lyx_trial.lyx
Description: application/lyx


Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Andreas K .
Tim Holy [EMAIL PROTECTED] writes:

 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. 

[snip]

 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?


You'd probably rather send this to the developers list to get attention.

Regards,
Andreas






Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Abdelrazak Younes

Andreas K. wrote:

Tim Holy [EMAIL PROTECTED] writes:

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. 


[snip]

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?



You'd probably rather send this to the developers list to get attention.


And also create an enhancement entry in bugzilla.lyx.org

Abdel.



Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Richard Heck
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


Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Tim Holy
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

Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Richard Heck


 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.
   
It's not exactly got an obvious name.
 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.)
   
LyX is looking for oolatex in your path. If it's not there, configure.py
won't find it. If it is in your path, then configure.py should find it.
Try running LyX from the command line and then reconfiguring. Watch the
output for information about oolatex.
 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. 
Yes, it's part of the tex4ht package.
 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]
   
There's some configuration problem here. On Fedora 6, this just works.
Try asking about this on the Ubuntu list, or whatever there is along
those lines.

rh

-- 
==
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



Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Enrico Forestieri
Tim Holy writes:

 Hello,
 
 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. 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...

Notice that OpenOffice is at fault here and not latex2rtf.
By default, latex2rtf uses EQ field codes for translating math constructs
(see http://office.microsoft.com/en-gb/word/HP051861481033.aspx)
but OpenOffice is not able to interpret them.

 An example document is attached. Under LyX 1.5.0beta3, one simply needs to 
 export as Rich Text Format and then open the file with OpenOffice to see what 
 I'm talking about.

Your example works perfectly when I open the produced rtf in Word.
Maybe you could file an enhancement request to the OO people.

-- 
Enrico



1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Tim Holy
Hello,

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. 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...

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?

An example document is attached. Under LyX 1.5.0beta3, one simply needs to 
export as Rich Text Format and then open the file with OpenOffice to see what 
I'm talking about.

Best,
--Tim


lyx_trial.lyx
Description: application/lyx


Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Andreas K .
Tim Holy [EMAIL PROTECTED] writes:

 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. 

[snip]

 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?


You'd probably rather send this to the developers list to get attention.

Regards,
Andreas






Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Abdelrazak Younes

Andreas K. wrote:

Tim Holy [EMAIL PROTECTED] writes:

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. 


[snip]

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?



You'd probably rather send this to the developers list to get attention.


And also create an enhancement entry in bugzilla.lyx.org

Abdel.



Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Richard Heck
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


Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Tim Holy
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

Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Richard Heck


 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.
   
It's not exactly got an obvious name.
 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.)
   
LyX is looking for oolatex in your path. If it's not there, configure.py
won't find it. If it is in your path, then configure.py should find it.
Try running LyX from the command line and then reconfiguring. Watch the
output for information about oolatex.
 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. 
Yes, it's part of the tex4ht package.
 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]
   
There's some configuration problem here. On Fedora 6, this just works.
Try asking about this on the Ubuntu list, or whatever there is along
those lines.

rh

-- 
==
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



Re: 1.5 feature request: textsuperscript textsubscript

2007-05-24 Thread Enrico Forestieri
Tim Holy writes:

 Hello,
 
 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. 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...

Notice that OpenOffice is at fault here and not latex2rtf.
By default, latex2rtf uses EQ field codes for translating math constructs
(see http://office.microsoft.com/en-gb/word/HP051861481033.aspx)
but OpenOffice is not able to interpret them.

 An example document is attached. Under LyX 1.5.0beta3, one simply needs to 
 export as Rich Text Format and then open the file with OpenOffice to see what 
 I'm talking about.

Your example works perfectly when I open the produced rtf in Word.
Maybe you could file an enhancement request to the OO people.

-- 
Enrico



1.5 feature request: textsuperscript & textsubscript

2007-05-24 Thread Tim Holy
Hello,

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. 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...

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?

An example document is attached. Under LyX 1.5.0beta3, one simply needs to 
export as Rich Text Format and then open the file with OpenOffice to see what 
I'm talking about.

Best,
--Tim


lyx_trial.lyx
Description: application/lyx


Re: 1.5 feature request: textsuperscript & textsubscript

2007-05-24 Thread Andreas K .
Tim Holy <[EMAIL PROTECTED]> writes:

> 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. 

[snip]

> 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?


You'd probably rather send this to the developers list to get attention.

Regards,
Andreas






Re: 1.5 feature request: textsuperscript & textsubscript

2007-05-24 Thread Abdelrazak Younes

Andreas K. wrote:

Tim Holy <[EMAIL PROTECTED]> writes:

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. 


[snip]

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?



You'd probably rather send this to the developers list to get attention.


And also create an "enhancement" entry in bugzilla.lyx.org

Abdel.



Re: 1.5 feature request: textsuperscript & textsubscript

2007-05-24 Thread Richard Heck
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


Re: 1.5 feature request: textsuperscript & textsubscript

2007-05-24 Thread Tim Holy
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


<>

Re: 1.5 feature request: textsuperscript & textsubscript

2007-05-24 Thread Richard Heck


> 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."
>   
It's not exactly got an obvious name.
> 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.)
>   
LyX is looking for oolatex in your path. If it's not there, configure.py
won't find it. If it is in your path, then configure.py should find it.
Try running LyX from the command line and then reconfiguring. Watch the
output for information about oolatex.
> 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. 
Yes, it's part of the tex4ht package.
> 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]
>   
There's some configuration problem here. On Fedora 6, this just works.
Try asking about this on the Ubuntu list, or whatever there is along
those lines.

rh

-- 
==
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



Re: 1.5 feature request: textsuperscript & textsubscript

2007-05-24 Thread Enrico Forestieri
Tim Holy writes:

> Hello,
> 
> 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. 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...

Notice that OpenOffice is at fault here and not latex2rtf.
By default, latex2rtf uses EQ field codes for translating math constructs
(see http://office.microsoft.com/en-gb/word/HP051861481033.aspx)
but OpenOffice is not able to interpret them.

> An example document is attached. Under LyX 1.5.0beta3, one simply needs to 
> export as Rich Text Format and then open the file with OpenOffice to see what 
> I'm talking about.

Your example works perfectly when I open the produced rtf in Word.
Maybe you could file an enhancement request to the OO people.

-- 
Enrico