我正在Ubuntu 18.04系统上使用Blogdown,我的“ LaTeX”是TinyTeX,R是v3.5.2。我所有的软件包都是最新的,只需运行update.packages(ask = FALSE, checkBuilt = TRUE)
和tinytex::tlmgr_update()
。
现在问题是:当我从R Studio发出blogdown::serve_site()
命令时,LaTeX方程以及其他所有内容都可以正常显示。当我离线时(例如在飞机上),LaTeX方程式在Blogdown中根本不会呈现。代替呈现的方程式,我得到了代码,例如:
$$\sigma = \sqrt{ \sum_{i=1}^N \frac{(x_i - \overline{x})^2}{N}}$$
这是为什么?我该怎么办?没什么大不了的,因为我实际上可以在R Studio中看到渲染的方程式。只是不在我的网站上。
另一个有趣的事情是,也没有正确呈现用三重刻度线“''包裹的代码段。
我得到的是这个(注意斑马条纹背景):
当我希望得到这个(纯灰色背景)时:
2 123
3 132
4 131
5 127
6 117
7 120
8 124
当我恢复使用WiFi上网时,并使用blogdown::serve_site()
重新渲染时,一切看起来都很好。一切都呈现正确。
编辑:最小可复制性是默认的Blogdown网站,上面显示了LaTeX公式。我应该将其压缩并张贴在某个地方以提供帮助吗?
我将此添加到了YAML中,但似乎无济于事:
output:
html_document:
mathjax: local
self_contained: false
我的浏览器控制台输出如下。
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