Fabio Stumbo <f.stu...@...> writes:

> 
> >> Hi all,
> >> 
> >> I know that exporting to latex and then reimporting to lyx is not that 
> >> smooth, but I made a simple try which surpise me:
> >> 
> >> - create a new lyx file, - in Document -> Settings -> Document class 
> >> choose 
> >> "article (AMS)"
> >> - insert a theorem (even just a word after it, no math nor images)
> >> - export it to latex
> >> 
> >> This way you get a very simple and clean tex file. Now, in lyx create a 
> >> new 
> >> file and import the saved tex file: instead of seeing
> >> "Theorem 1. etc."
> >> you see
> >> the ert
> >> \begin{thm} etc. \end{thm}
> >> 
> >> and it doesn't even compile!
> >> 
> >> Am I missing something? If not, how is it possible that the conversion 
> >> fails even on a such simple and basic example?
> >> 
> > Hmm. I think this is a consequence of modularization of the AMS files. You 
> > did this in 1.6.x, yes?
> 
> Sorry, I forgot to give my settings:
> lyx 1.6.1 installed in ubuntu 8.10 via backport repository, with no 
> customization and a freshly created default ~/.lyx
> 
> > We'll have to fix this, if so.
> 
> If you do, please let me know what I should do while waiting for the fix 
> in the repository.
> 
> Thanks
> 
> Fabio
> 
> 
Hi

I also stumbled upon this problem. Here are two workarounds that will at least
get things to compile correctly:
1. After importing add to the latex preamble in lyx (under Document-Setting) the
following  :
\theoremstyle{plain}
\newtheorem{thm}{Theorem}
  \theoremstyle{plain}
  \newtheorem{lem}[thm]{Lemma}

This is an example for theorem and lemma. You will find the right things to add
in the latex file your are importing so its really just cut and paste

2. Insert text with whatever paragraph style you are missing . Doing this once
for every style is enough. For example, go to the first lemma, delete the latex
code and mark it as a lemma in lyx. All lemmas will now compile correctly.

Hope it helps
Guy



Reply via email to