From: Juergen Spitzmueller Date: Sun, 23 Jul 2017 11:19:59 +0000 (+0200) Subject: Properly import \newtheorem* X-Git-Tag: 2.2.4~94 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5eda278c807ac34d582438867bf5ab950dc8b335;p=features.git Properly import \newtheorem* Fixes: #10622 --- diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 24c403d23e..6dcbd5097c 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -1711,13 +1711,19 @@ void Preamble::parse(Parser & p, string const & forceclass, } else if (t.cs() == "newtheorem") { + bool star = false; + if (p.next_token().character() == '*') { + p.get_token(); + star = true; + } string const name = p.getArg('{', '}'); string const opt1 = p.getFullOpt(); string const opt2 = p.getFullOpt(); string const body = p.verbatim_item(); string const opt3 = p.getFullOpt(); + string const cmd = star ? "\\newtheorem*" : "\\newtheorem"; - string const complete = "\\newtheorem{" + name + '}' + + string const complete = cmd + "{" + name + '}' + opt1 + opt2 + '{' + body + '}' + opt3; add_known_theorem(name, opt1, !opt2.empty(), from_utf8(complete)); diff --git a/status.22x b/status.22x index eb891c81a5..3589c13658 100644 --- a/status.22x +++ b/status.22x @@ -119,6 +119,8 @@ What's new * TEX2LYX +- Fix import of \newtheorem* declarations (bug 10622). + * ADVANCED FIND AND REPLACE