Extra curly braces in latex() command?

asked 13 years ago

joon gravatar image

Hi,

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!

Preview: (hide)

Comments

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 ( 13 years ago )

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 ( 13 years ago )

@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 ( 13 years ago )

@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 ( 13 years ago )
1

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 ( 13 years ago )