Search code examples
htmlrlatexr-markdownrnotebook

LaTeX in R Notebook not rendering properly in HTML (hats are skewed to the right)


When I output an Notebook to , and use , most of the output renders fine.

When I use hats though, it's not lined up properly on the character I'm 'hatting'.

For example:

---
title: "R Notebook"
output: html_notebook
---

Hello Everyone, $\pi = 3.14159...$ but my estimate is $\hat{\pi}=3.13$

Outputs into an HTML file:

Output

Even though, when I hover over the in the code, it renders properly:

enter image description here

Another thing I now notice is that, the output font when I hover is nicer than the HTML output, is it possible to change the HTML output font to the 'hovering' font?

EDIT: My OS and software versions are MacOS Catalina 10.15.3 with RStudio version 1.1.456


Solution

  • It turns out I just needed an RStudio update, and it solved the problem. I'd tried updating RStudio through the application, but since I had the option 'Ignore Updates' it would always notify me that I had the latest version, so I had to download the .dmg from the website and re-install.

    If anyone can help me change the font though, I'd really appreciate it.