【问题标题】:How to solve RMarkdown error after installing tinytex::install_tinytex()安装 tinytex::install_tinytex() 后如何解决 RMarkdown 错误
【发布时间】:2021-12-19 08:40:33
【问题描述】:

我只是尝试使用 RMardown 创建一个 pdf 文件,并在安装 tinytex 包后如下:

tinytex::install_tinytex()

如果我在 .RMd 文档的最顶部设置以下措辞:

output:
  pdf_document: default
  latex_engine: xelatex

我得到了这个错误

!包 inputenc 错误:Unicode 字符 σ (U+03C3) (inputenc) 未设置为与 LaTeX 一起使用。

Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. See https://bookdown.org/yihui/rmarkdown-cookbook/latex-unicode.html
Errore: LaTeX failed to compile REPORT-CODES.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See REPORT-CODES.log for more info

如果我尝试按照其他帖子中的建议(或像这样)报告它:

output:
  pdf_document: default
    latex_engine: xelatex

错误是:

Errore in yaml::yaml.load(..., eval.expr = TRUE) : 
  Scanner error: mapping values are not allowed in this context at line 6, column 17
Chiamate: <Anonymous> ... parse_yaml_front_matter -> yaml_load -> <Anonymous>

实际上第 6 行和第 7 行分别是 pdf_documentlatex_engine。有谁知道如何解决这个问题?

【问题讨论】:

    标签: r latex r-markdown tinytex


    【解决方案1】:

    去掉default关键字:

    ---
    output:
      pdf_document: 
        latex_engine: xelatex
    ---
    
     Ï
    

    【讨论】:

    • 感谢您的友好回复。这个 .pdf 文档应该包含一些由 tab_model() 函数创建的对象,据我所知,它们应该只支持 html 格式。你知道是否可以让它们在这个 .pdf 文档扩展上可见?
    • @mały_statystyczny 如果您有新问题,请提出新问题。
    猜你喜欢
    • 2021-08-26
    • 2021-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-10
    • 2020-02-05
    • 2021-02-27
    • 2021-04-12
    相关资源
    最近更新 更多