From 3c7b75c5bcb20dbc9bbb6e5d711212a47548d213 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 23 Jul 2017 13:19:59 +0200 Subject: [PATCH] Properly import \newtheorem* Fixes: #10622 --- src/tex2lyx/Preamble.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index b3f7b1efc8..b383793cf0 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -1790,13 +1790,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)); -- 2.39.5