]> git.lyx.org Git - features.git/commitdiff
tex2lyx/Preamble.cpp: revert a part of [041a3add/lyxgit]
authorUwe Stöhr <uwestoehr@lyx.org>
Mon, 25 May 2015 15:49:54 +0000 (17:49 +0200)
committerUwe Stöhr <uwestoehr@lyx.org>
Mon, 25 May 2015 15:49:54 +0000 (17:49 +0200)
There is a general problem of tex2lyx handling theorems. it is not sufficient to cure only one instance as I did. For more info see bug #9561.

Update the references accordingly.

src/tex2lyx/Preamble.cpp
src/tex2lyx/test/test-modules.lyx.lyx
src/tex2lyx/test/test-refstyle-theorems.lyx.lyx

index d1733dd7256fd9a60ba5e06965cb31e84172024b..f5316bca131fa89efd2670904e9b23bf4bbaa9b3 100644 (file)
@@ -1692,17 +1692,8 @@ void Preamble::parse(Parser & p, string const & forceclass,
 
                        add_known_theorem(name, opt1, !opt2.empty(), from_utf8(complete));
 
-                       // we know that our theorem module already add automatically some
-                       // theorem definition. They must not be output in the preamble to
-                       // avoid LaTeX errors about redefinitions
-                       if (complete == "\\newtheorem{thm}{\\protect\\theoremname}")
-                               in_lyx_preamble = true;
-                       else
-                               in_lyx_preamble = false;
-
                        if (!in_lyx_preamble)
-                               h_preamble << "\\newtheorem{" << name << '}'
-                                          << opt1 << opt2 << '{' << body << '}' << opt3;
+                               h_preamble << complete;
                }
 
                else if (t.cs() == "def") {
index 35f583759b10368f049bea733f5f5f54253bf58f..872c0fce1fc4d6d64e8ba428fe3efa138c130e3c 100644 (file)
@@ -9,6 +9,7 @@
 \numberwithin{figure}{section} %% Comment out for sequentially-numbered
 \providecommand{\theoremname}{Theorem}
 \theoremstyle{plain}
+\newtheorem{thm}{\protect\theoremname}\theoremstyle{plain}
 \newtheorem{lem}[thm]{Lemma}
 
 \usepackage{babel}
index 2c55b76924530da6f389b888c8bf3707d3c20451..3578e44457dca87ca2ff501fda27ac85fc29b872 100644 (file)
@@ -38,6 +38,7 @@
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
 \theoremstyle{plain}
+\newtheorem{thm}{\protect\theoremname}\theoremstyle{plain}
 \newtheorem{lem}[thm]{\protect\lemmaname}\theoremstyle{plain}
 \newtheorem{cor}[thm]{\protect\corollaryname}\theoremstyle{plain}
 \newtheorem{prop}[thm]{\protect\propositionname}\theoremstyle{plain}