Jean-Marc Lasgouttes wrote:

> The 2236 part looks OK.

This is in.

> For 2234, are you sure that \tag* works?

I thought so, but obviously it does not work.

> Actually, is there a need to consider it separately?

Yes, otherwise the * will be parsed as argument of \tag. The attached patch
fixes also \tag*. Please test.


Georg
Index: src/mathed/ChangeLog
===================================================================
--- src/mathed/ChangeLog	(Revision 13316)
+++ src/mathed/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,7 @@
+2006-03-10  Georg Baum  <[EMAIL PROTECTED]>
+
+	* math_parser.C (parse1): Parse \tag and \tag* correctly
+
 2006-02-28  Martin Vermeer  <[EMAIL PROTECTED]>
 
 	* math_nestinset.C (doDispatch): fix (properly) insertion of
Index: src/mathed/math_parser.C
===================================================================
--- src/mathed/math_parser.C	(Revision 13316)
+++ src/mathed/math_parser.C	(Arbeitskopie)
@@ -1260,6 +1260,15 @@ void Parser::parse1(MathGridInset & grid
 			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;
Index: src/tex2lyx/ChangeLog
===================================================================
--- src/tex2lyx/ChangeLog	(Revision 13324)
+++ src/tex2lyx/ChangeLog	(Arbeitskopie)
@@ -1,6 +1,7 @@
 2006-03-10  Georg Baum  <[EMAIL PROTECTED]>
 
 	* text.C (parse_text): Handle \verb
+	* math.C (parse_math): Parse \tag and \tag* correctly
 
 2005-10-18  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
Index: src/tex2lyx/math.C
===================================================================
--- src/tex2lyx/math.C	(Revision 13316)
+++ src/tex2lyx/math.C	(Arbeitskopie)
@@ -185,6 +185,17 @@ void parse_math(Parser & p, ostream & os
 			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);
Index: lib/ChangeLog
===================================================================
--- lib/ChangeLog	(Revision 13316)
+++ lib/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,7 @@
+2006-03-10  Georg Baum  <[EMAIL PROTECTED]>
+
+	* symbols: Add \tag and \tag*
+
 2006-02-24  Enrico Forestieri  <[EMAIL PROTECTED]>
 
 	* scripts/legacy_lyxpreview2ppm.py (extract_metrics_info): 
Index: lib/symbols
===================================================================
--- lib/symbols	(Revision 13316)
+++ lib/symbols	(Arbeitskopie)
@@ -120,6 +120,8 @@ overset           overset     none
 parbox            parbox      none
 protect           protect     none
 mbox              mbox        forcetext
+tag               mbox        forcetext
+tag*              mbox        forcetext
 newcommand        newcommand  none
 label             label       none
 left              left        none

Reply via email to