Extra curly braces in latex() command?

asked 2011-08-03 05:25:55 -0500

joon gravatar image


I am trying to copy latex code generated by Sage to Lyx. It seems Sage generates additional curly braces around (). For example, with:

sage: latex((alpha^2-alpha)*theta)

I get:

{\left(\alpha^{2} - \alpha\right)} \theta

If I paste this code to Lyx math, then there are unnecessary {} around the () showing. Maybe it's LyX's problem since if I paste it to an .tex source and compile it then it does not show. However I already have a long document in LyX so it would be great if there is any way to get rid of {}.

Thank you!

edit retag flag offensive close merge delete


I think you may be right about it being LyX's problem. We recently removed something like this for multiplication (see http://trac.sagemath.org/sage_trac/ticket/11415), not sure whether removing this would break something else.

kcrisman gravatar imagekcrisman ( 2011-08-03 06:07:16 -0500 )edit

Correct me if I'm wrong - the braces do not appear in the compiled pdf/dvi, so why do they bother you?

parzan gravatar imageparzan ( 2011-08-03 07:12:21 -0500 )edit

@parzan - So you are saying that it shows up in the Lyx source code, but the Lyx compiled document does not have them?

kcrisman gravatar imagekcrisman ( 2011-08-03 16:48:44 -0500 )edit

@krisman @parzan is right. I never actually tried to compile it in LyX. I just tried that and the extra braces are not showing in the pdf, even though lyx is showing it.

joon gravatar imagejoon ( 2011-08-04 17:17:34 -0500 )edit

You can see that these braces appear in red in LyX - this means that they only serve as a container. I recommend running LyX with Preview:on (in Pref. -> Look&Feel -> Display) - you then see immediately how the latex compiles (you might need to restart after enabling it).

parzan gravatar imageparzan ( 2011-08-06 01:00:34 -0500 )edit