我使用 RStudio 和 Rmarkdown 来创建报告。由于某种原因,使用“Knit”按钮会导致它仅在某个临时目录中创建。从命令输出来看,似乎 pandoc 本身被指示这样做,我觉得这很奇怪。
/usr/lib/rstudio/bin/pandoc/pandoc +RTS -K512m -RTS 31_effective_masses.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output /tmp/RtmppeovW9/preview-2c001154ef6d2e.dir/31_effective_masses.tex --table-of-contents --toc-depth 3 --template /hadron/ueding/R/x86_64-pc-linux-gnu-library/3.6/rmarkdown/rmd/latex/default-1.17.0.2.tex --number-sections --highlight-style tango --pdf-engine lualatex --variable graphics=yes --lua-filter /hadron/ueding/R/x86_64-pc-linux-gnu-library/3.6/rmarkdown/rmd/lua/pagebreak.lua --lua-filter /hadron/ueding/R/x86_64-pc-linux-gnu-library/3.6/rmarkdown/rmd/lua/latex-div.lua --variable 'geometry:margin=1in' --variable 'compact-title:yes'
output file: 31_effective_masses.knit.md
Output created: /tmp/RtmppeovW9/preview-2c001154ef6d2e.dir/31_effective_masses.pdf
但是当我在命令行上执行此操作时Rscript -e "rmarkdown::render('vignettes/3pi/31_effective_masses.Rmd')"
,它会在正确的目录中创建输出:
/usr/bin/pandoc +RTS -K512m -RTS 31_effective_masses.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output 31_effective_masses.tex --table-of-contents --toc-depth 3 --template /hadron/ueding/R/x86_64-pc-linux-gnu-library/3.6/rmarkdown/rmd/latex/default-1.17.0.2.tex --number-sections --highlight-style tango --latex-engine lualatex --variable graphics=yes --variable 'geometry:margin=1in' --variable 'compact-title:yes'
Output created: 31_effective_masses.pdf
我在 Debian 9 上使用 RStudio 1.2.5001。
在 RStudio 中,knitr markdown 输出位于哪里? https://stackoverflow.com/questions/62432329/in-rstudio-where-is-knitr-markdown-output-located
解释了这种行为的一些原因。由于在“vignettes”目录中工作并将 Sweave 全局选项“PDF 预览”设置为“无预览”,我遇到了同样的问题。设置预览选项显示输出,避免导航到临时目录。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)