【问题标题】:YAML front matter in R markdown version 2: add an institution and logoR markdown 版本 2 中的 YAML 前言:添加机构和徽标
【发布时间】:2014-10-13 10:15:06
【问题描述】:

R markdown version 2 中是否可以在 YAML 前端添加机构和徽标?

我正在寻找类似的东西

---
title:       "My report"
author:      "me"
institution: "Swansea University"
logo:        "logo.png"
output:
   pdf_document:
   toc: yes
---

【问题讨论】:

  • 我确实尝试过类似author: "NAME SURNAME \\newline Swansea University" 的方法,但这极大地改变了文本对齐方式。
  • 如果您使用的模板包含使用徽标和机构的 Beamer 主题怎么办? rmarkdown.rstudio.com/pdf_document_format.html
  • 我认为我最好更改 R Studio 使用的 .tex 模板。

标签: r yaml pandoc r-markdown


【解决方案1】:

答案是使用模板文件,但需要对徽标位进行一些调整:

---
title:       "My report"
author:      "me"
output:
   pdf_document:
   toc: yes
   includes:
     in_header: style.tex
---

在你的markdown文件所在的文件夹中准备文档“style.tex”,并确保你已经将R中的工作目录更改为这个文件夹。

将以下行添加到您的“style.tex”文件中:

\institute{My institute}
\pgfdeclareimage[width=2cm]{logo}{logo.png}
\usebackgroundtemplate{\pgfuseimage{logo}}

感谢: Inserting logo into beamer presentation using R Markdown

【讨论】:

    猜你喜欢
    • 2021-12-19
    • 1970-01-01
    • 1970-01-01
    • 2018-08-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多