Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am importing a LaTeX code into LyX. This code has multiple uses of amsmath environments (lemma, theorem etc.). After importing, all theese environments turn into ERT boxes in LyX. I was wondering if there is any way to import LaTeX into LyX preserving the amsmath environments? I think there should be a way to do this as AMS modules exist in LyX.

To experiment a little bit, I tried to check if LyX can import its own LaTeX code properly. I first created a LyX document using Theorems (AMS) module. Then I exported the LyX document into LaTeX code (see below) and imported the code back into LyX. This produced a LyX document with ERT instead of the theorem environment. What can possibly go wrong?

%% LyX 1.6.7 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[letterpaper]{geometry}
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
  \theoremstyle{plain}
  \newtheorem*{thm*}{Theorem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\makeatother
\makeatother
\usepackage{babel}
\makeatother
\usepackage{babel}
\begin{document}
\begin{thm*}
Let $\theta$ be a real number, then\[
\sin^{2}\theta+\cos^{2}\theta=1.\]
\end{thm*}
\end{document}
share

migration rejected from stackoverflow.com Aug 4 '13 at 10:23

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by Joseph Wright Aug 4 '13 at 10:23

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

    
This issue has also been reported here. I am sure many people stumble upon this while collaborating with LaTeX users. It would be great to know if this problem persists in LyX 2.0. –  MHT Aug 23 '12 at 14:28
    
This issue still exists in LyX 2.0.4. –  Werner Aug 23 '12 at 16:35
    
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Aug 23 '12 at 16:36
    
This question appears to be off-topic because it is about a feature request or bug report for Lyx (depending on your point of view). –  Joseph Wright Aug 4 '13 at 10:23