Jean-Marc Lasgouttes wrote:

> Georg, I think we should add these as optargs in revtex4.layout. Then
> the question is whether tex2lyx is able to honor this and create
> optarg insets.

Yes, tex2lyx does create optarg insets if the style allows optional
arguments.

> Georg, are you sure that your patch creates correct code? I see
> -               else if (t.cs() == "i" || t.cs() == "j") {
> +               else if (t.cs() == "i" || t.cs() == "j" || t.cs() == "l"
> ||
> +                        t.cs() == "L") {
>                         context.check_layout(os);
>                         os << "\\" << t.cs() << ' ';
>                         skip_braces(p); // eat {}
> 
> I do not understand what these things do not output an
> insetlatexaccent. Actually, I am not sure the lyx syntax is correct.

You are right. That means that an invalid .lyx file was generated if the
document contained a dotless i or dotless j.

The attached patch (this time actually tested) fixes that and outputs
exactly what InsetLatexAccent::write does. You should never trust existing
code to do the right thing ;-(

I guess the two patches combined are  now really a candidate for 1.4?


Georg
Index: src/tex2lyx/text.C
===================================================================
--- src/tex2lyx/text.C	(Revision 16252)
+++ src/tex2lyx/text.C	(Arbeitskopie)
@@ -2102,7 +2102,7 @@ void parse_text(Parser & p, ostream & os
 		else if (t.cs() == "i" || t.cs() == "j" || t.cs() == "l" ||
 		         t.cs() == "L") {
 			context.check_layout(os);
-			os << "\\" << t.cs() << ' ';
+			os << "\\i \\" << t.cs() << "{}\n";
 			skip_braces(p); // eat {}
 		}
 

Reply via email to