This small patch translates \thanks in title layouts.
I found out that it was not enough to check for
t.cs() == "thanks" && context.layout->intitle
because output_command_layout() destroyed the context. The reason was that 
ti called parse_text_snippet() (which creates a new context) rather than 
parse_text().
Ok to apply?


Georg
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/tex2lyx/ChangeLog lyx-1.4-cvs/src/tex2lyx/ChangeLog
--- lyx-1.4-clean/src/tex2lyx/ChangeLog	2005-02-26 15:52:21.000000000 +0100
+++ lyx-1.4-cvs/src/tex2lyx/ChangeLog	2005-03-05 16:45:51.000000000 +0100
@@ -1,3 +1,9 @@
+2005-03-05  Georg Baum  <[EMAIL PROTECTED]>
+
+	* text.C (output_command_layout): Use parse_text instead of
+	parse_text_in_inset to avoid creating a new context
+	* text.C (parse_text): translate \thanks to footnote in title layouts
+
 2005-02-25  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* context.h: declare as "class Font" rather than "struct Font".
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/tex2lyx/text.C lyx-1.4-cvs/src/tex2lyx/text.C
--- lyx-1.4-clean/src/tex2lyx/text.C	2005-02-06 10:31:00.000000000 +0100
+++ lyx-1.4-cvs/src/tex2lyx/text.C	2005-03-05 16:24:22.000000000 +0100
@@ -447,7 +453,7 @@ void output_command_layout(ostream & os,
 			eat_whitespace(p, os, context, false);
 		}
 	}
-	parse_text_snippet(p, os, FLAG_ITEM, outer, context);
+	parse_text(p, os, FLAG_ITEM, outer, context);
 	context.check_end_layout(os);
 	if (parent_context.deeper_paragraph) {
 		// We must suppress the "end deeper" because we
@@ -1310,7 +1662,8 @@ void parse_text(Parser & p, ostream & os
 			end_inset(os);
 		}
 
-		else if (t.cs() == "footnote") {
+		else if (t.cs() == "footnote" ||
+		         (t.cs() == "thanks" && context.layout->intitle)) {
 			p.skip_spaces();
 			context.check_layout(os);
 			begin_inset(os, "Foot\n");

Reply via email to