【发布时间】:2017-05-12 14:28:02
【问题描述】:
我无法在共享文件夹中正确查看 rmarkdown HTML 输出。
我正在使用
生成报告rmarkdown::render('myfile.rmd')
输出的 HTML 包含图像和 DT::datatable。 render() 生成的文件在我的计算机中打开时可以正常工作。如果我通过电子邮件将 HTML 文件发送给同事,他们可以毫无问题地看到它。
一旦我将 HTML 文件复制到服务器中的共享文件夹,它就不再正确呈现:所有 DT::datatable 都丢失了,字体也无法正确显示。
我也试过了:
rmarkdown('myfile.rmd', output_dir = 'shared_folder/', output_file = 'myreport.html')
这也行不通。 Rmd 文件在我的本地计算机中, output_dir 是共享文件夹。该文件已正确写入共享文件夹,但是当我尝试打开它时,我遇到了与以前相同的问题。
最初,共享文件夹中的网页会使 Internet Explorer 崩溃。我在 Rmd 文件中添加了 mathjax:null 选项并且崩溃停止了,但 fonts/DT::datatable 丢失问题仍在继续:
output:
html_document:
mathjax: null
我的本地硬盘是NTFS,共享文件夹文件系统也是NTFS。
rmarkdown 显示的 pandoc 选项为(禁止显示个人信息):
+RTS -K512m -RTS myfile.utf8.md --to html
--from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash
--output myfile.html
--smart --email-obfuscation none
--self-contained --standalone --section-divs
--template "C:\Users\[...]\Documents\R\win-library\3.3\rmarkdown\rmd\h\default.html"
--no-highlight
--variable highlightjs=1
--variable "theme:simplex"
--include-in-header "C:\Users\[...]\AppData\Local\Temp\Rtmpqm2YlA\rmarkdown-str18ab05327b00.html"
在 Windows 7 中运行 R 3.3.2。
有什么想法吗?
【问题讨论】:
标签: r knitr r-markdown pandoc