Package inputenc Error & Error: pandoc document conversion failed with error 43

陌路散爱 提交于 2019-12-24 17:54:51

问题


I was trying to produce a PDF file with the knitr in RStudio but I encountered a problem. I have read a lot of solutions found on stack overflow and google but they are not very helpful. Could anyone please help me with this? Much obliged!

The error is shown as below:

output file: final_project.knit.md

"C:/Users/JOHNL_~1/AppData/Local/Pandoc/pandoc" +RTS -K512m -RTS final_project.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output final_project.pdf --template "E:\R\R-3.2.3\library\rmarkdown\rmd\latex\default-1.15.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" 
! Package inputenc Error: Unicode char 骞?(U+5E74)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H   for immediate help.
 ...                                              

l.128 \maketitle

Try running pandoc with --latex-engine=xelatex.
pandoc.exe: Error producing PDF
Error: pandoc document conversion failed with error 43
In addition: Warning message:
running command '"C:/Users/JOHNL_~1/AppData/Local/Pandoc/pandoc" +RTS -K512m -RTS final_project.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output final_project.pdf --template "E:\R\R-3.2.3\library\rmarkdown\rmd\latex\default-1.15.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"' had status 43 
Execution halted

Specification:

  1. Window 8.1 64
  2. RStudio version: 0.99.891 Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/538.1 (KHTML, like Gecko) rstudio Safari/538.1 Qt/5.4.1
  3. MikTeX: version 2.9.5840 (basic)
  4. pandoc

Others

I have tried most solutions I can find from stack overflow and it did not work. So I am afraid solutions like adding latex_engine: xelatex will also fail to solve this.

Could anyone please help me? Thanks a lot!

Best


回答1:


I have figured out what the problem is, that you have to choose WINDOWS-1252 as your text encoding.

If you have set other types as default, change it at tools> global options > code > saving, choose [Ask] in the default text encoding.

Hope that works for you.



来源:https://stackoverflow.com/questions/35715986/package-inputenc-error-error-pandoc-document-conversion-failed-with-error-43

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!