From fad5cd6700b27f28a96d1590d053d7a582782b96 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Thu, 16 Mar 2006 15:05:47 +0000 Subject: [PATCH] fix bug 2234 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13399 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 4 ++++ lib/symbols | 2 ++ src/mathed/ChangeLog | 4 ++++ src/mathed/math_parser.C | 9 +++++++++ src/tex2lyx/ChangeLog | 4 ++++ src/tex2lyx/math.C | 11 +++++++++++ 6 files changed, 34 insertions(+) diff --git a/lib/ChangeLog b/lib/ChangeLog index bea669ea8c..771fea0db9 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2006-03-14 Georg Baum + + * symbols: Add \tag and \tag* + 2006-03-13 Georg Baum * symbols: Comment out unused insets diff --git a/lib/symbols b/lib/symbols index 41f6b2ac0d..4bc306d62f 100644 --- a/lib/symbols +++ b/lib/symbols @@ -122,6 +122,8 @@ underset underset none overset overset none #protect protect none mbox mbox forcetext +tag mbox forcetext +tag* mbox forcetext #newcommand newcommand none #label label none #left left none diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 2a8defab02..ebbccdb6ae 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,7 @@ +2006-03-14 Georg Baum + + * math_parser.C (parse1): Parse \tag and \tag* correctly + 2006-03-14 Martin Vermeer * math_data.C (x2pos): Fix to bug 2325: Mouse click to right of last diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index be12a451e5..275c9ee497 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -1260,6 +1260,15 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, parse(cell->back().nucleus()->cell(2), FLAG_ITEM, MathInset::TEXT_MODE); } + else if (t.cs() == "tag") { + if (nextToken().character() == '*') { + getToken(); + cell->push_back(createMathInset(t.cs() + '*')); + } else + cell->push_back(createMathInset(t.cs())); + parse(cell->back().nucleus()->cell(0), FLAG_ITEM, MathInset::TEXT_MODE); + } + #if 0 else if (t.cs() == "infer") { MathArray ar; diff --git a/src/tex2lyx/ChangeLog b/src/tex2lyx/ChangeLog index f4fb4db02c..eb9ac40e53 100644 --- a/src/tex2lyx/ChangeLog +++ b/src/tex2lyx/ChangeLog @@ -1,3 +1,7 @@ +2006-03-13 Georg Baum + + * math.C (parse_math): Parse \tag and \tag* correctly + 2006-03-10 Georg Baum * text.C (parse_text): Handle \verb diff --git a/src/tex2lyx/math.C b/src/tex2lyx/math.C index 7a883d928b..b4fcfd88c9 100644 --- a/src/tex2lyx/math.C +++ b/src/tex2lyx/math.C @@ -185,6 +185,17 @@ void parse_math(Parser & p, ostream & os, unsigned flags, const mode_type mode) os << '}'; } + else if (t.cs() == "tag") { + os << '\\' << t.cs(); + if (p.next_token().asInput() == "*") { + p.get_token(); + os << '*'; + } + os << '{'; + parse_math(p, os, FLAG_ITEM, MATHTEXT_MODE); + os << '}'; + } + else if (t.cs() == "mbox" || t.cs() == "fbox") { os << "\\" << t.cs() << '{'; parse_math(p, os, FLAG_ITEM, MATHTEXT_MODE); -- 2.39.2