【问题标题】:Use before_body in Rmarkdown for a html document在 Rmarkdown 中使用 before_body 获取 html 文档
【发布时间】:2019-01-07 10:50:31
【问题描述】:

我想在另一个 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

【问题讨论】:

    标签: yaml r-markdown


    【解决方案1】:

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

    ---
    output: 
      html_document:
        includes:
          before_body: Logo.html
    fig_caption: true
    code_folding: hide
    ---
    

    【讨论】:

    • 谢谢,我意识到我的文件名被命名为“Logo.htm”......我还有一个问题,我希望我的图像位于我的文档右侧,我该怎么做?跨度>
    猜你喜欢
    • 2016-03-02
    • 2017-10-06
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-04
    • 1970-01-01
    相关资源
    最近更新 更多