If I recall correctly, it's a known issue that we don't have true ERT in math 
mode. We can still insert custom LaTeX commands, but sometimes the workaround 
is limited. For example, in a knitr document (which runs R on commands in the 
.lyx file and substitutes in the output), R functions and objects can have "_" 
in their names. I attach an example.

Basically, is there any workaround to be able to use LyX's math mode and output 
the LaTeX \Sexpr{mean(x_draws)}?

If I try to paste from LaTeX, LyX converts it to the following: 
$\Sexpr{mean(x_{d}raws)}$, which gives a knitr error.

Scott

Attachment: math_ert_underscore.23.lyx
Description: application/lyx

Attachment: signature.asc
Description: PGP signature

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to