commit a06b3900d2518eef984f651099cbb068aead4ffb
Author: Uwe Stöhr <[email protected]>
Date: Mon May 25 17:49:54 2015 +0200
tex2lyx/Preamble.cpp: revert a part of [041a3add/lyxgit]
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.
diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index d1733dd..f5316bc 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -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") {
diff --git a/src/tex2lyx/test/test-modules.lyx.lyx
b/src/tex2lyx/test/test-modules.lyx.lyx
index 35f5837..872c0fc 100644
--- a/src/tex2lyx/test/test-modules.lyx.lyx
+++ b/src/tex2lyx/test/test-modules.lyx.lyx
@@ -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}
diff --git a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
index 2c55b76..3578e44 100644
--- a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
+++ b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
@@ -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}