Hello,
thanks for your help, I followed your advice and replaced theorem with
thm, corollary with cor etc.. . As for environments I use use for the moment
just enumerate instead of enumeratealpha etc. using for the moment emacs to
do these replacements I have something better in lyx now. For my real
conversion I still have a problem left, texmacs creates also some macros like
\newcommand{\nin}{\not\in}
\newcommand{\nni}{\not\ni}
\newcommand{\tmop}[1]{\ensuremath{\operatorname{#1}}}
\newcommand{\tmsamp}[1]{\textsf{#1}}
\newcommand{\tmtextbf}[1]{{\bfseries{#1}}}
\newcommand{\tmtextit}[1]{{\itshape{#1}}}
\newcommand{\tmtexttt}[1]{{\ttfamily{#1}}}
\newcommand{\um}{-}
that is not shown correctly in lyx once imported, can you give me some hints
how to solve this. Please not that I'm not a latex specialist (but I can
guess from the above that something like \tmop{and} should be expanded in
\ensuremath{\operatorname{and}} ). Does there exist some way that these
substitutions are made automatically or should I write code that does this
before doing the import in lyx.
Thanks a lot in advance
Marc
On Wednesday 27 August 2008 23:45, rgheck wrote:
> rgheck wrote:
> > Marc Mertens wrote:
> >> Hello,
> >>
> >> I'm considering to switch from texmacs to lyx but I don't want
> >> to loose my old documents, to this end I tried to export my documents
> >> from texmacs to latex format and use the import function of lyx to
> >> import it in .lyx format. I I do this then I see that macros that are
> >> added by texmacs to the latex file are not used in lyx, having as
> >> effect that texmacs theorem, proposition , enumerations etc .. are
> >> not rendered correctly when I view them in lyx. If I use 'latex' to
> >> generate a .dvi file from the exported .tex file from texmacs then
> >> everything is rendered in the correct way.
> >
> > Right. The conversion is done by a program tex2lyx that does not
> > recognize the environments you are using. The things it does recognize
> > are detailed in the manpage for the program.
> >
> >> Is there a way to import latex files containing macros in lyx
> >> (more specifically latex generated by texmacs).
> >
> > Yeah, improve tex2lyx. ;-)
> >
> > Seriously, the only way to do this (other than manually) would be to
> > write some kind of program that does the conversion.
>
> Actually, there is a bit more you can do here. If you change the
> document class from letter to amsbook, say, then LyX will convert the
> proof environment: This is because amsbook defines that environment, so
> LyX knows about it. Similarly, if you change "theorem" to "thm"---which
> is how it is done in amsmath.inc---then LyX will also convert that. Same
> goes for proposition --> prop. So that's another option.
>
> rh