我使用一个新的Rmarkdown文件在RStudio中做了一个快速演示,并使用ioslides
将其设置为输出一个HTML文件。下面是我得到的信息:
---
title: "SX MWE Presentation"
author: "John Doe"
date: "Today"
output:
ioslides_presentation:
smaller: yes
widescreen: yes
transition: "faster"
---
## Plan
Here's the plan: I'm going to give one speech today and another next Monday.
## Today's Speech
## Today I'll be talking about A B and C.
## Next Monday
## Next Monday I'll be talking about X Y and Z.
这是我的问题:我想让## Today's Speech
和## Next Monday
幻灯片中的幻灯片标题文本水平和垂直居中。我该怎么做?你会立即看到,这些只是幻灯片,没有内容,只有标题,但这是故意的:我只想要几个“设置”幻灯片来锚定我们所在的位置。
我的怀疑是,为了使幻灯片标题居中显示,我需要某种自定义的css文件,但我一直无法找到我想要的代码。(当然,我已经在ioslides文档中找到了答案,但我没有找到。)
发布于 2020-04-21 19:57:20
您可以尝试以下方法:
在您的YAML标头之后,添加以下行:
<style type="text/css">
h2 {
text-align: center;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
</style>
这意味着您将覆盖标题2的CSS样式。你的页眉现在出现在屏幕的中间,你可以用css完全修改你的页眉样式,例如改变颜色,字体大小...
https://stackoverflow.com/questions/61333926
复制相似问题