Rmarkdown 无法使用 Latex 生成 github_document(错误 67)

Rmarkdown failed to generate github_document with latex (Error 67)

我尝试编写几个输出 github_document 的 Rmarkdown 文件,例如:

---
title: 'TEST'
output:   
  github_document:
    pandoc_args: --webtex
always_allow_html: yes
---

\newcommand*{\indep}{\perp \!\!\! \perp}

$$\Bigl \{ Y_i, \; M_i \Bigr \} \indep{} \, A_i|Z_i=z $$

我得到的错误是:

pandoc: Could not fetch https://latex.codecogs.com/png.latex?%5CBigl%20%5C%7B%20Y_i%2C%20%5C%3B%20M_i%20%5CBigr%20%5C%7D%20%7B%5Cperp%20%5C%21%5C%21%5C%21%20%5Cperp%7D%7B%7D%20%5C%2C%20A_i%7CZ_i%3Dz%20
FailedConnectionException2 "latex.codecogs.com" 443 True sendBuf: resource vanished (Broken pipe)
Error: pandoc document conversion failed with error 67
Execution halted

最近 运行 遇到类似的问题 github_document,但它不是确切的错误代码,提供的解决方案也不是 return 所有乳胶代码,在我较长的文档中,也不是 return 适当的独立函数。例如:

---
title: 'TEST'
output:   
  github_document:
    pandoc_args: --webtex=http://chart.apis.google.com/chart?cht=tx&chl=
always_allow_html: yes
---

\newcommand*{\indep}{\perp \!\!\! \perp}

$$\Bigl \{ Y_i, \; M_i \Bigr \} \indep{} \, A_i|Z_i=z $$

return这张图片:new independent sign generation 以前,我的 github 文档可以创建此图像(使用 pandoc_args: --webtex): old independent sign generation 。这基本上是同一行减去了一些东西,因为它是截屏的并且为简单起见编辑了测试文件。

上个月,所有文件都能够 return 我的较长文档中的所有乳胶代码而没有问题。

一些可能有用的附加信息:

─ Session info ─────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.6.0 (2019-04-26)
 os       OS X El Capitan 10.11.6     
 system   x86_64, darwin15.6.0        
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/New_York            
 date     2020-04-13                  

─ Packages ─────────────────────────────────────────────────────────────────────────
 ! package     * version date       lib source        
   assertthat    0.2.1   2019-03-21 [1] CRAN (R 3.6.0)
   base        * 3.6.0   2019-04-26 [?] local         
   cli           1.1.0   2019-03-19 [1] CRAN (R 3.6.0)
 P compiler      3.6.0   2019-04-26 [1] local         
   crayon        1.3.4   2017-09-16 [1] CRAN (R 3.6.0)
 P datasets    * 3.6.0   2019-04-26 [1] local         
   digest        0.6.19  2019-05-20 [1] CRAN (R 3.6.0)
   evaluate      0.14    2019-05-28 [1] CRAN (R 3.6.0)
 P graphics    * 3.6.0   2019-04-26 [1] local         
 P grDevices   * 3.6.0   2019-04-26 [1] local         
 P grid          3.6.0   2019-04-26 [1] local         
   gridExtra     2.3     2017-09-09 [1] CRAN (R 3.6.0)
   gtable        0.3.0   2019-03-25 [1] CRAN (R 3.6.0)
   htmltools     0.4.0   2019-10-04 [1] CRAN (R 3.6.0)
   knitr         1.24    2019-08-08 [1] CRAN (R 3.6.0)
 P methods     * 3.6.0   2019-04-26 [1] local         
   Rcpp          1.0.1   2019-03-17 [1] CRAN (R 3.6.0)
   rlang         0.4.0   2019-06-25 [1] CRAN (R 3.6.0)
   rmarkdown     1.15    2019-08-21 [1] CRAN (R 3.6.0)
   rsconnect     0.8.15  2019-07-22 [1] CRAN (R 3.6.0)
   rstudioapi    0.10    2019-03-19 [1] CRAN (R 3.6.0)
   sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.6.0)
 P stats       * 3.6.0   2019-04-26 [1] local         
 P tools         3.6.0   2019-04-26 [1] local         
 P utils       * 3.6.0   2019-04-26 [1] local         
   withr         2.1.2   2018-03-15 [1] CRAN (R 3.6.0)
   xfun          0.9     2019-08-21 [1] CRAN (R 3.6.0)
   yaml          2.2.0   2018-07-25 [1] CRAN (R 3.6.0)

[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library

P ── Loaded and on-disk path mismatch.
> rmarkdown::pandoc_version()
[1] ‘1.19.2.1’

由于我的 OS,我无法更新到最新的 pandoc 或 RStudio。

codecogs 支持提供的解决方案!

---
title: 'TEST'
output:   
  github_document:
    pandoc_args: --webtex=https://ibm.codecogs.com/png.latex?
always_allow_html: yes
---

\newcommand*{\indep}{\perp \!\!\! \perp}

$$\Bigl \{ Y_i, \; M_i \Bigr \} \indep{} \, A_i|Z_i=z $$

据 codecogs 的支持团队称,他们一直在 运行 定位他们的方程式缓存,因此他们的网站 运行 出现了很多意想不到的问题。所以对我来说,我的代码 运行 可能不到 5% 的时间,而对于 运行 我的代码并说它有效的其他人来说,他们能够这样做是因为该网站可能是"up and running"当时。他们目前正在努力解决许多问题,值得庆幸的是,我能够就此问题获得他们的帮助。