gpt4 book ai didi

html - 在 RStudio 中将 ioslides 幻灯片的标题居中

转载 作者:行者123 更新时间:2023-12-04 10:11:04 25 4
gpt4 key购买 nike

我正在使用新的 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 文档以获得答案,但我没有找到。)

最佳答案

您可以尝试以下方法:

在 YAML header 之后,添加以下几行:

<style type="text/css">

h2 {
text-align: center;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
</style>

这意味着您覆盖了标题 2 CSS 样式。
您的标题现在出现在屏幕中间,您可以使用 css 完全修改您的标题样式,例如改变颜色,字体大小......

关于html - 在 RStudio 中将 ioslides 幻灯片的标题居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61333926/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com