簡體   English   中英

避免 `github_document` 出現“pandoc 文檔轉換失敗,錯誤 61”

[英]avoid "pandoc document conversion failed with error 61" for `github_document`

由於下面顯示的錯誤,我一直無法編織github_document 在這個問題中為html_document提供了避免這種情況的解決方案。 但是這個論點不適用於github_document ,所以我想知道是否有另一種解決方案來避免這個錯誤。

錯誤詳情:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS README.utf8.md --to gfm --from markdown+autolink_bare_uris+tex_math_single_backslash --output README.md --standalone --webtex --template "C:\Users\inp099\Documents\R\win-library\4.0\rmarkdown\rmarkdown\templates\github_document\resources\default.md" 
output file: README.knit.md

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS README.md --to html4 --from gfm --output README.html --standalone --self-contained --highlight-style pygments --template "C:\Users\inp099\Documents\R\win-library\4.0\rmarkdown\rmarkdown\templates\github_document\resources\preview.html" --variable "github-markdown-css:C:\Users\inp099\Documents\R\win-library\4.0\rmarkdown\rmarkdown\templates\github_document\resources\github.css" --email-obfuscation none --metadata pagetitle=PREVIEW 
Could not fetch https://latex.codecogs.com/png.latex?%5Ccheckmark
HttpExceptionRequest Request {
  host                 = "latex.codecogs.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/png.latex"
  queryString          = "?%5Ccheckmark"
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InternalException (HostCannotConnect "latex.codecogs.com" [Network.Socket.connect: <socket: 940>: failed (Connection timed out (WSAETIMEDOUT))]))
Error: pandoc document conversion failed with error 61
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Execution halted

yaml如下:

---
output:
  github_document:
    pandoc_args: --webtex
---

一些可能重要的附加信息:

library(rmarkdown)
sessioninfo::session_info(include_base = TRUE)
#> - Session info ---------------------------------------------------------------
#>  setting  value                                             
#>  version  R Under development (unstable) (2020-02-28 r77874)
#>  os       Windows 10 x64                                    
#>  system   x86_64, mingw32                                   
#>  ui       RTerm                                             
#>  language (EN)                                              
#>  collate  English_United States.1252                        
#>  ctype    English_United States.1252                        
#>  tz       Europe/Berlin                                     
#>  date     2020-03-31                                        
#> 
#> - Packages -------------------------------------------------------------------
#>  ! package     * version    date       lib source                           
#>    assertthat    0.2.1      2019-03-21 [1] CRAN (R 4.0.0)                   
#>    backports     1.1.5      2019-10-02 [1] CRAN (R 4.0.0)                   
#>    base        * 4.0.0      2020-02-29 [?] local                            
#>    cli           2.0.2      2020-02-28 [1] CRAN (R 4.0.0)                   
#>  P compiler      4.0.0      2020-02-29 [2] local                            
#>    crayon        1.3.4      2017-09-16 [1] CRAN (R 4.0.0)                   
#>  P datasets    * 4.0.0      2020-02-29 [2] local                            
#>    digest        0.6.25     2020-02-23 [1] CRAN (R 4.0.0)                   
#>    ellipsis      0.3.0      2019-09-20 [1] CRAN (R 4.0.0)                   
#>    evaluate      0.14       2019-05-28 [1] CRAN (R 4.0.0)                   
#>    fansi         0.4.1      2020-01-08 [1] CRAN (R 4.0.0)                   
#>    fs            1.3.2      2020-03-05 [1] CRAN (R 4.0.0)                   
#>    glue          1.3.2      2020-03-12 [1] CRAN (R 4.0.0)                   
#>  P graphics    * 4.0.0      2020-02-29 [2] local                            
#>  P grDevices   * 4.0.0      2020-02-29 [2] local                            
#>    highr         0.8        2019-03-20 [1] CRAN (R 4.0.0)                   
#>    htmltools     0.4.0      2019-10-04 [1] CRAN (R 4.0.0)                   
#>    knitr         1.28       2020-02-06 [1] CRAN (R 4.0.0)                   
#>    lifecycle     0.2.0.9000 2020-03-16 [1] Github (r-lib/lifecycle@355dcba) 
#>    magrittr      1.5        2014-11-22 [1] CRAN (R 4.0.0)                   
#>  P methods     * 4.0.0      2020-02-29 [2] local                            
#>    pillar        1.4.3      2019-12-20 [1] CRAN (R 4.0.0)                   
#>    pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 4.0.0)                   
#>    purrr         0.3.3      2019-10-18 [1] CRAN (R 4.0.0)                   
#>    Rcpp          1.0.4      2020-03-17 [1] CRAN (R 4.0.0)                   
#>    reprex        0.3.0.9001 2020-03-25 [1] Github (tidyverse/reprex@a019cc4)
#>    rlang         0.4.5      2020-03-01 [1] CRAN (R 4.0.0)                   
#>    rmarkdown   * 2.1        2020-01-20 [1] CRAN (R 4.0.0)                   
#>    rstudioapi    0.11       2020-02-07 [1] CRAN (R 4.0.0)                   
#>    sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 4.0.0)                   
#>  P stats       * 4.0.0      2020-02-29 [2] local                            
#>    stringi       1.4.6      2020-02-17 [1] CRAN (R 4.0.0)                   
#>    stringr       1.4.0      2019-02-10 [1] CRAN (R 4.0.0)                   
#>    styler        1.3.2      2020-02-23 [1] CRAN (R 4.0.0)                   
#>    tibble        3.0.0      2020-03-30 [1] CRAN (R 4.0.0)                   
#>  P tools         4.0.0      2020-02-29 [2] local                            
#>  P utils       * 4.0.0      2020-02-29 [2] local                            
#>    vctrs         0.2.4      2020-03-10 [1] CRAN (R 4.0.0)                   
#>    withr         2.1.2      2018-03-15 [1] CRAN (R 4.0.0)                   
#>    xfun          0.12       2020-01-13 [1] CRAN (R 4.0.0)                   
#>    yaml          2.2.1      2020-02-01 [1] CRAN (R 4.0.0)                   
#> 
#> [1] C:/Users/inp099/Documents/R/win-library/4.0
#> [2] C:/Program Files/R/R-devel/library
#> 
#>  P -- Loaded and on-disk path mismatch.
rmarkdown::pandoc_version()
#> [1] '2.9.2.1'

以下作品。 但它沒有更早地工作,可能是網站有問題。

---
title: "Untitled"
author: "Stéphane Laurent"
date: "26 mars 2020"
output:
  github_document:
    pandoc_args: --webtex=https://latex.codecogs.com/png.latex?
---

$\checkmark$
---
title: "A Quick Fix"
author: "Christopher Schwarz"
date: "3 April 2020"
output:
  github_document:
    pandoc_args: --webtex=http://chart.apis.google.com/chart?cht=tx&chl=
---

$\checkmark$

在轉移到 CodeCogs 之前,上面的內容恢復到舊的默認值

https://github.com/jgm/pandoc/pull/3142/files

我不知道 CodeCogs 的問題是什么,但這可能與不提供鏈接返回有關。

https://www.codecogs.com/latex/usage.php

使用這些選項對我有用:

  github_document:
    math_method:
      engine: webtex
      url: http://chart.apis.google.com/chart?cht=tx&chl=

看起來這里有一些答案使用不同的 webtex 網站。 今天他們都沒有為我工作。,但我用谷歌搜索了其他網站,如“codecogs”並找到了一個有效的網站,所以如果你需要一個更多的選擇:

---
title: "One more Codecogs API"
output:   
  github_document:
    pandoc_args: --webtex=http://codecogs.tomagrade.com/png.latex?
---

$\checkmark$

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM