]> git.lyx.org Git - features.git/commitdiff
Properly import \newtheorem*
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 23 Jul 2017 11:19:59 +0000 (13:19 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 25 Jul 2017 16:28:47 +0000 (18:28 +0200)
Fixes: #10622
src/tex2lyx/Preamble.cpp
status.22x

index 24c403d23ee770431d048e4b88c9856c2357933b..6dcbd5097c6ee4204a7c68b34d9515760c48aaf8 100644 (file)
@@ -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));
index eb891c81a5e8efd641d1650667a9dd155fa4fe0d..3589c136580da7a2f8c9e9b86ff1db8289d22510 100644 (file)
@@ -119,6 +119,8 @@ What's new
 
 * TEX2LYX
 
+- Fix import of \newtheorem* declarations (bug 10622).
+
 
 * ADVANCED FIND AND REPLACE