在Rmarkdown中将before_body用于html文档

时间:2019-01-07 10:50:32

标签: yaml r-markdown

我想在另一个HTML文档的顶部添加图像(名为“ Logo.html”的html文件)。 为此,我使用“ before_body”:

我将Logo.html与Rmarkdown保存在同一文件中,并且在“编织” rmd时收到以下错误: pandoc.exe:Logo.html:openFile:不存在(没有这样的文件或目录)

在特定位置放置“ Logo.html”吗?你知道我的代码有什么不对吗?

输出:

html_document:

include:

  before_body: Logo.html

fig_caption: true
code_folding: hide

1 个答案:

答案 0 :(得分:1)

您必须注意YAML参数的缩进和嵌套。 这对我有用:

Exception

org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
    org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:197)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:413)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause

java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
    java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:129)
    org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:60)
    org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:192)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:413)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)