From: Georg Baum Date: Fri, 7 Jan 2011 20:21:10 +0000 (+0000) Subject: math macros do not understand \newcommand* and \renewcommand* X-Git-Tag: 2.0.0~1156 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f8f69ca92082156151d0a0e337ca7b2d58679825;p=features.git math macros do not understand \newcommand* and \renewcommand* git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37148 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/tex2lyx/test/test-insets.tex b/src/tex2lyx/test/test-insets.tex index e59e32d882..a8fad94a34 100644 --- a/src/tex2lyx/test/test-insets.tex +++ b/src/tex2lyx/test/test-insets.tex @@ -246,9 +246,11 @@ global long def \global\long\def\macrod#1{d #1 d} providecommand \providecommand{\macroe}[1]{e #1 e} newcommand \newcommand{\macrof}[1]{f #1 f} renewcommand \renewcommand{\macrof}[1]{g #1 g} +newcommand* \newcommand*{\macroh}[1]{h #1 h} +renewcommand* \renewcommand*{\macroh}[1]{i #1 i} Now use them all: -\macroa{x} \macrob{x} \macroc{x} \macrod{x} \macroe{x} \macrof{x} +\macroa{x} \macrob{x} \macroc{x} \macrod{x} \macroe{x} \macrof{x} \macroh{x} \section{Special formattings\index{Special formattings}} diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 37c4fcd3b9..be604629b3 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -2828,7 +2828,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, opt1 + opt2 + '{' + p.verbatim_item() + '}'; - if (t.cs() == "providecommand") + if (t.cs() == "providecommand" || + name[name.length()-1] == '*') handle_ert(os, ert, context); else { context.check_layout(os);