Dear LyX Users and Developers,

today I tried to use the knitr (Rnw) module successfully when accessed from Insert > Custom Insets > S/R expression.

When I tried to do that in inline math via \Sexpr{0.5^2} then the display becomes 0.5² meaning that LyX correctly thinks I want LaTeX-ish 0.5^{2}, but R will choke on that literal "{" in there.

I am sure this must have occurred to someone already and I wonder how that was solved.

On researching on this I found things like fake math macros and such which I am not comfortable with (plus looking for "cleaner" solution). I am thinking of modifying the \Sexpr so that the input to it is done literally in the same way as the custom S/R expression inset. Or is this one indeed solved canonically with math macros?

Best Regards,
Michael Bach

Reply via email to