Search code examples
rlatexr-markdownrnotebook

R notebook inline latex output


I have a simple LaTex code in my R notebook as

$y=\frac{(x-\mu)}{(max-min)}$

When I hover on the code, I see the output and also when I knit to HTML. However, how do I see the rendered output within the .RMD file?

I know this can be done because once I accidentally hit something on the keyboard and I was able to see the rendered LaTeX output within the .RMD file itself. I just do not know what I hit and I am not able to reproduce that behavior. I was not able to find in documentation as well.


Solution

  • Display equations (surrounded with $$) preview as a chunk result rather than a popup, as inline equations ($) do.

    $$y=\frac{(x-\mu)}{(max-min)}$$
    

    However, note that $$ will print the math in its own paragraph/div while $ produces inline output. AFAIK, there is no way to have inline equations preview without hovering over them.