Html 在不创建新目录的情况下将图像添加到rmd模板

Html 在不创建新目录的情况下将图像添加到rmd模板,html,r,templates,r-markdown,Html,R,Templates,R Markdown,我正在使用创建rmd的自定义模板。有一种方法可以在使用模板时向模板添加页脚,而无需创建目录。它通过调用r代码中的页脚来实现: #' Custom HTML template #' #' Loads additional style and template file #' #' @param toc table of contents #' @param toc_float floating of toc #' @param toc_depth how many subsections are

我正在使用创建rmd的自定义模板。有一种方法可以在使用模板时向模板添加页脚,而无需创建目录。它通过调用r代码中的页脚来实现:

#' Custom HTML template
#'
#' Loads additional style and template file
#'
#' @param toc table of contents
#' @param toc_float floating of toc
#' @param toc_depth how many subsections are in toc
#' @param number_sections whether display section number

#' @param ... additional arguments provided to \@code{html_document}
#' @export
#'
html_report_format <- function(toc = TRUE,
                               toc_float = TRUE,
                               toc_depth = 2,
                               number_sections = TRUE,
                               ...) {

  # locations of resource files in the package
  pkg_resource = function(...) {
    system.file(..., package = "a")
  }

  footer = pkg_resource("rmarkdown/resources/footer.html")
  css = pkg_resource("rmarkdown/resources/dsaa_style.css")
  

  # call the base html_document function
  rmarkdown::html_document(
    toc = toc,
    toc_float = toc_float,
    toc_depth = toc_depth,
    number_sections = number_sections,
    css = css,
    includes = rmarkdown::includes(after_body = footer),
    ...
  )
}
自定义HTML模板 #' #'加载其他样式和模板文件 #' #“@param toc目录 #“@param toc_toc浮动 #“@param toc_depth toc中有多少个小节 #“@param number_节是否显示节号 #“@param。。。为\@code{html\u document}提供的其他参数 #“@出口 #' html_报告_格式