如何在RMarkdown标题幻灯片上修改文本和徽标的位置

Tun*_*ung 14 css r pandoc r-markdown xaringan

由于我在标题幻灯片底部的图片,我想:

  • 移动所有title,subtitleauthor达到他们的中心位置.
  • 仅删除Rlogo标题幻灯片中的内容(不知道该怎么做).我现在只能删除幻灯片号码.title-slide .remark-slide-number { display: none; }.

任何建议表示赞赏!谢谢!

这是我可重复的例子:

tweaks.css文件

/* for logo and slide number in the footer */
.remark-slide-content:after {
    content: "";
    position: absolute;
    bottom: 15px;
    right:   8px;
    height: 40px;
    width: 120px;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url("Rlogo.png");
}

/* for background image in title slide */
.title-slide {
  background-image: url("slideMasterSample.png");
  background-size: cover;
}

.title-slide h1 {
  color: #F7F8FA;
  margin-top: -170px;
}

.title-slide h2, .title-slide h3 {
  color: #e7e8e2; 
  line-height: 1.0em;
  margin-top: -75px;
}

.title-slide .remark-slide-number {
  display: none;
}
Run Code Online (Sandbox Code Playgroud)

第一次尝试:修改后margin-toptweaks.css文件中提到xaringan的wiki

---
title: "Presentation Ninja"
subtitle: "xaringan"
author: "Author"
output:
  xaringan::moon_reader:
    lib_dir: libs
    css: ["default", "tweaks.css"]
    nature:
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: false
---
Run Code Online (Sandbox Code Playgroud)

结果1:

结果1

第2次尝试:添加<br>title手动向上推,但随后subtitleauthor进行了下推.添加<br>subtitleauthor没有帮助.

---
title: "Presentation Ninja<br><br><br><br><br><br>"
subtitle: "xaringan"
author: "Author"
output:
  xaringan::moon_reader:
    lib_dir: libs
    css: ["default", "tweaks.css"]
    nature:
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: false
---
Run Code Online (Sandbox Code Playgroud)

结果2:

结果2

使用的照片

slideMasterSample.png Rlogo.png

pat*_*t-s 19

使用seal: false您可以创建独立于YAML标题的标题幻灯片.它经常简化幻灯片创建.

对于所有幻灯片的R徽标,但标题幻灯片,创建一个自定义div并将其设置为layout.

在此输入图像描述在此输入图像描述

CSS:

.title-slide {
  background-image: url("slideMasterSample.png");
  background-size: cover;
}
.title-slide h1, h2, h3 {
  text-align: center;
  color: #F7F8FA;
}

.title-slide .remark-slide-number {
  display: none;
}

div.my-footer {
content: "";
    position: absolute;
    bottom: 15px;
    right:   8px;
    height: 40px;
    width: 120px;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url("Rlogo.png");
}
Run Code Online (Sandbox Code Playgroud)

RMD:

---
title: "Presentation Ninja"
subtitle: "xaringan"
author: "Author"
output:
  xaringan::moon_reader:
    lib_dir: libs
    css: ["tweaks.css", "default"]
    nature:
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: false
    seal: false
---

```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
```

class: title-slide   

# Header 1

## Header 2  

### Header 3 

---

layout: true

<div class="my-footer"></div>       

---

# new slide 1

---

# new slide 2
Run Code Online (Sandbox Code Playgroud)