我这次直接偷懒用 testthat 去测 rticles 包的模版了,目前只有4个模版有问题,目测前三个原因应该一致,可能跟路径设置有关,最后一个比较吊诡,信息如下:
1. Error: asa_article format (@test_formats.R#30) ------------------------------
file 'testdoc.pdf' does not exist
1: rmarkdown::render(testdoc) at C:\Users\SPMESUPERCPU\Downloads\rticles/tests/testthat/test_formats.R:30
2: tools::file_path_as_absolute(output_file)
3: stop(gettextf("file '%s' does not exist", x), domain = NA)
2. Error: jss_article format (@test_formats.R#30) ------------------------------
file 'testdoc.pdf' does not exist
1: rmarkdown::render(testdoc) at C:\Users\SPMESUPERCPU\Downloads\rticles/tests/testthat/test_formats.R:30
2: tools::file_path_as_absolute(output_file)
3: stop(gettextf("file '%s' does not exist", x), domain = NA)
3. Error: pnas_article format (@test_formats.R#30) -----------------------------
file 'testdoc.pdf' does not exist
1: rmarkdown::render(testdoc) at C:\Users\SPMESUPERCPU\Downloads\rticles/tests/testthat/test_formats.R:30
2: tools::file_path_as_absolute(output_file)
3: stop(gettextf("file '%s' does not exist", x), domain = NA)
4. Error: rjournal_article format (@test_formats.R#30) -------------------------
unable to run 'pdflatex' on 'RJwrapper.tex'
1: rmarkdown::render(testdoc) at C:\Users\SPMESUPERCPU\Downloads\rticles/tests/testthat/test_formats.R:30
2: output_format$post_processor(yaml_front_matter, utf8_input, output_file, clean, !quiet)
3: tools::texi2pdf("RJwrapper.tex", clean = clean) at C:\Users\SPMESUPERCPU\Downloads\rticles/R/rjournal_article.R:39
4: texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet, texi2dvi = texi2dvi,
texinputs = texinputs, index = index)
5: stop(gettextf("unable to run '%s' on '%s'", latex, file), domain = NA)
DONE ===========================================================================