Marius Ionescu wrote: > Hello everybody. > I am new to the list, but I have been using lyx since the 1.1.6 > version. Now I use 1.3.3 on a RedHat 9, Qt. I always had a problem > when I was exporting to latex and then reimporting to lyx a > particular thing. Namely, if I insert an inline equation (C-M) and > in the box I put just a * (for example *-homomoprhism), when I > export to latex and then import to lyx, it gives me an error. I > atach a test file. Can you help me with this, please. > Thank you, > Marius Ionescu
You want the bad news or the good news? Ok the bad news. This is exactly the sort of thing that reLyX can't handle properly. reLyX is the converter we use to generate a lyx file from a latex one. It is written in perl (which nobody here understands very well --- or likes) and is basically a set of very clever regular expressions. Clever, maybe, but not a proper TeX parser. So the route $ lyx_13x -e latex Test.lyx $ mv Test.tex Test_export.tex $ reLyX Test_export.tex $ mv Test_export.lyx Test_export_relyx.lyx $ lyx2lyx_13x Test_export_relyx.lyx > Test_export_relyx_lyx2lyx.lyx produces a file that is indeed garbage. Now the good news. reLyX is on the way out. Andr� P�nitz has written a new tex->lyx converter called (surprisingly ;-) tex2lyx. It has a proper TeX parser. It's limitation is simply that it doesn't know all of LyX's syntax. Nonetheless the route $ lyx_13x -e latex Test.lyx $ mv Test.tex Test_export.tex $ tex2lyx_14x Test_export.tex > Test_export_tex2lyx.lyx $ lyx2lyx_14x -t 221 Test_export_tex2lyx.lyx > Test_export_tex2lyx_lyx2lyx.lyx produces a perfectly good lyx file. (The last step takes the current lyx 225 format and generates the lyx 221 format understood by lyx 1.3.x.) I attach the sample Test_export_tex2lyx_lyx2lyx file. tex2lyx and the back-converting lyx2lyx are both part of the current development cycle. They haven't been released yet. Nonetheless, there is light at the end of this particular tunnel. Regards, Angus ps here is the diff too. As you can see, the round trip is pretty good. I have no idea why tex2lyx has inserted a Theorem thingy in the preamble however. Development gubbins ;-) A. -#LyX 1.3 created this file. For more info see http://www.lyx.org/ +#LyX 1.4.0cvs created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass amsart +\begin_preamble + + + + + +\makeatletter +\theoremstyle {plain} + \newtheorem {thm}{Theorem}[section] + \numberwithin {equation}{section} \numberwithin {figure}{section} + +\makeatother + +\end_preamble +\options oneside \language english \inputencoding latin1 \fontscheme ae \graphics default \paperfontsize default -\papersize Default -\paperpackage a4 +\spacing single +\papersize default +\paperpackage default \use_geometry 0 \use_amsmath 0 \use_natbib 0 @@ -29,6 +45,6 @@ \begin_inset Formula $*$ \end_inset --homomorphism. - +-homomorphism. + \the_end
Test_export_tex2lyx_lyx2lyx.lyx
Description: application/lyx
