Re: knitr (Rnw) module: \Sexpr in Inline Math
That should be the best solution for this particular case, but you are right this problem needs to be solved at a lower level in knitr or Sweave, or LyX's math mode. The difficulty on R's side is from parsing \Sexpr{} using regular expressions. In your case, the R code should be 0.5^{2} but knitr sees 0.5^{2 because } terminates the code. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Thu, Aug 16, 2012 at 2:33 PM, Michael Bach wrote: > On 8/16/2012 9:25 PM, Michael Bach wrote: >> >> 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. >> > > Ok I found a workaround for my specific issue, which is to use the > alternative \Sexpr{0.5**2} for the exponent. > > Sorry for the noise, but suggestions / ideas are welcome anyway. > >
Re: knitr (Rnw) module: \Sexpr in Inline Math
On 8/16/2012 9:25 PM, Michael Bach wrote: 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. Ok I found a workaround for my specific issue, which is to use the alternative \Sexpr{0.5**2} for the exponent. Sorry for the noise, but suggestions / ideas are welcome anyway.
knitr (Rnw) module: \Sexpr in Inline Math
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
Re: Seperating Definition Lists
On 2012-08-16, Kortink, Mark A wrote: > [-- Type: text/plain, Encoding: base64 --] > Hi Michael, which drop list, the only one that says anything about a > separator is “Menu Separator” and that doesn’t work. The list of Styles (like section, title, definition) should also contain the --- separator --- dummy style. (The same effect can be achieved by a LyX-Note in an otherwise empty Standard paragraph.) Günter