I'm using blogdown on an Ubuntu 18.04 system, my 'LaTeX' is TinyTeX, and R is v3.5.2. All my packages are up to date, just ran a update.packages(ask = FALSE, checkBuilt = TRUE)
and tinytex::tlmgr_update()
.
And now the issue: LaTeX equations, and everything else, renders fine when I issue the blogdown::serve_site()
command from R Studio. When I'm offline (say on a plane) LaTeX equations won't render at all in blogdown. Instead of the rendered equation I get the code, eg:
$$\sigma = \sqrt{ \sum_{i=1}^N \frac{(x_i - \overline{x})^2}{N}}$$
Why is this? What should I do? It's not that big of a deal because I can actually see the rendered equations in R Studio. Just not on my served site.
Another interesting thing is that code snippets wrapped in triple tick marks ``` aren't properly rendered either.
What I get is this (notice zebra stripe background):
When I expect to get this (solid grey background):
2 123
3 132
4 131
5 127
6 117
7 120
8 124
When I'm back online with WiFi, and I re-render with blogdown::serve_site()
it all looks fine again. Everything renders properly.
EDIT: Minimum reproducible would be a default blogdown site with the LaTeX equation shown above. Should I zip that up and post somewhere to help?
I added this to my YAML but it didn't seem to help:
output:
html_document:
mathjax: local
self_contained: false
My browser console output is below.
cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css:1 Failed to load resource: net::ERR_INTERNET_DISCONNECTED
(index):1 [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: http://127.0.0.1:4321/fonts/lato-v11-latin-regular.woff2
(index):1 [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: http://127.0.0.1:4321/fonts/merriweather-v13-latin-regular.woff2
cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js:1 Failed to load resource: net::ERR_INTERNET_DISCONNECTED
cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/r.min.js:1 Failed to load resource: net::ERR_INTERNET_DISCONNECTED
cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/yaml.min.js:1 Failed to load resource: net::ERR_INTERNET_DISCONNECTED
(index):194 Uncaught ReferenceError: hljs is not defined
at (index):194
cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML:1 Failed to load resource: net::ERR_INTERNET_DISCONNECTED