试了一下跟dapengde 一样, html 没问题,word没问题,pdf报错 不过报错信息跟他不一样…
/usr/lib/rstudio/bin/pandoc/pandoc +RTS -K512m -RTS ReferenceTest.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output ReferenceTest.tex --template /home/tc/.R_libs/rmarkdown/rmd/latex/default-1.17.0.2.tex --highlight-style tango --pdf-engine pdflatex --variable graphics=yes --variable 'geometry:margin=1in' --variable 'compact-title:yes' --filter /usr/lib/rstudio/bin/pandoc/pandoc-citeproc
processing file: ReferenceTest.rmd
output file: ReferenceTest.knit.md
tlmgr search --file --global '/fandol'
Trying to automatically install missing LaTeX packages...
tlmgr install fandol
tlmgr: package repository http://mirror.aarnet.edu.au/pub/CTAN/systems/texlive/tlnet (verified)
tlmgr install: package already present: fandol
tlmgr path add
tlmgr search --file --global '/fandol'
! Critical ctex error: "fontset-unavailable"
!
! CTeX fontset `fandol' is unavailable in current mode.
!
! See the ctex documentation for further information.
!
! For immediate help type H <return>.
!...............................................
!
! CTeX fontset `fandol' is unavailable in current mode.
!
! See the ctex documentation for further information.
!
! For immediate help type H <return>.
!...............................................
! CTeX fontset `fandol' is unavailable in current mode.
!
! See the ctex documentation for further information.
!
! For immediate help type H <return>.
!...............................................
!
! See the ctex documentation for further information.
!
! For immediate help type H <return>.
!...............................................
! See the ctex documentation for further information.
!
! For immediate help type H <return>.
!...............................................
!
! For immediate help type H <return>.
!...............................................
! For immediate help type H <return>.
!...............................................
Error: Failed to compile ReferenceTest.tex. See ReferenceTest.log for more info.
Execution halted
搜了一下解决方案是用xelatex引擎而不用pdflatex,我用的是前者应该没问题啊…
> xfun::session_info(c('rmarkdown','bookdown'))
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS, RStudio 1.2.837
Locale:
LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8 LC_NAME=C
LC_ADDRESS=C LC_TELEPHONE=C
LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
Package version:
backports_1.1.2 base64enc_0.1.3 bookdown_0.7 digest_0.6.16
evaluate_0.11 glue_1.3.0 graphics_3.4.4 grDevices_3.4.4
highr_0.7 htmltools_0.3.6 jsonlite_1.5 knitr_1.20.15
magrittr_1.5 markdown_0.8 methods_3.4.4 mime_0.5
Rcpp_0.12.18 rmarkdown_1.10 rprojroot_1.3.2 stats_3.4.4
stringi_1.2.3 stringr_1.3.1 tinytex_0.7 tools_3.4.4
utils_3.4.4 xfun_0.3 yaml_2.2.0