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.
This commit is contained in:
Uwe Stöhr 2015-05-25 17:49:54 +02:00
parent 6867277843
commit a06b3900d2
3 changed files with 3 additions and 10 deletions

View File

@ -1692,17 +1692,8 @@ void Preamble::parse(Parser & p, string const & forceclass,
add_known_theorem(name, opt1, !opt2.empty(), from_utf8(complete)); 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) if (!in_lyx_preamble)
h_preamble << "\\newtheorem{" << name << '}' h_preamble << complete;
<< opt1 << opt2 << '{' << body << '}' << opt3;
} }
else if (t.cs() == "def") { else if (t.cs() == "def") {

View File

@ -9,6 +9,7 @@
\numberwithin{figure}{section} %% Comment out for sequentially-numbered \numberwithin{figure}{section} %% Comment out for sequentially-numbered
\providecommand{\theoremname}{Theorem} \providecommand{\theoremname}{Theorem}
\theoremstyle{plain} \theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}\theoremstyle{plain}
\newtheorem{lem}[thm]{Lemma} \newtheorem{lem}[thm]{Lemma}
\usepackage{babel} \usepackage{babel}

View File

@ -38,6 +38,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\theoremstyle{plain} \theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}\theoremstyle{plain}
\newtheorem{lem}[thm]{\protect\lemmaname}\theoremstyle{plain} \newtheorem{lem}[thm]{\protect\lemmaname}\theoremstyle{plain}
\newtheorem{cor}[thm]{\protect\corollaryname}\theoremstyle{plain} \newtheorem{cor}[thm]{\protect\corollaryname}\theoremstyle{plain}
\newtheorem{prop}[thm]{\protect\propositionname}\theoremstyle{plain} \newtheorem{prop}[thm]{\protect\propositionname}\theoremstyle{plain}