英文:
Repeat title slide at end of reveal.js presentation
问题
我想在我的 quarto reveal.js 演示的最后重复我的标题幻灯片。
我正在寻找类似 title-slide
或其他命令。感谢。
英文:
I'd like to repeat my title slide at the end of my quarto reveal.js presentation.
I'm looking for a command like title-slide
or something other.
Thanks
答案1
得分: 3
我已經在評論中提到,您可以使用一些JavaScript代碼和CSS來在演示文稿的末尾自動重複顯示您的標題幻燈片。
使用quarto
中的include-in-header
YAML鍵將以下**append-title-slide.html
**文件附加到演示文稿中。
append-title-slide.html
<script>
function move_titleSlide() {
var titleSlide = document.querySelector('section#title-slide');
var titleSlideClone = titleSlide.cloneNode(true);
titleSlideClone.id = 'title-slide-cloned';
document.querySelector('.reveal .slides').appendChild(titleSlideClone);
Reveal.sync();
}
window.document.addEventListener("DOMContentLoaded", function (event) {
move_titleSlide();
});
</script>
<style>
#title-slide-cloned {
text-align: center
}
#title-slide-cloned .subtitle {
margin-bottom: 2.5rem
}
</style>
presentation.qmd
---
title: "標題幻燈片"
subtitle: "這是副標題"
author: None
date: last-modified
format:
revealjs:
include-in-header: append-title-slide.html
slide-number: true
---
## Quarto
Quarto允許您將內容和可執行代碼編織到一個完成的演示文稿中。要了解有關Quarto演示文稿的更多信息,請參見<https://quarto.org/docs/presentations/>。
## 簡介
當您單擊**Render**按鈕時,將生成包括的文檔:
- 使用Markdown編寫的內容
- 可執行代碼的輸出
## 代碼
當您單擊**Render**按鈕時,將生成包括內容和嵌入代碼輸出的演示文稿。您可以像這樣嵌入代碼:
```{r}
1 + 1
<details>
<summary>英文:</summary>
As I have already mentioned in the comment, you can make use of some javascript code and CSS to automatically repeat your title slide at the end of the presentation.
Attach the following **`append-title-slide.html`** file in the presentation using the `include-in-header` YAML key in quarto.
**append-title-slide.html**
~~~ html
<script>
function move_titleSlide() {
var titleSlide = document.querySelector('section#title-slide');
var titleSlideClone = titleSlide.cloneNode(true);
titleSlideClone.id = 'title-slide-cloned';
document.querySelector('.reveal .slides').appendChild(titleSlideClone);
Reveal.sync();
}
window.document.addEventListener("DOMContentLoaded", function (event) {
move_titleSlide();
});
</script>
<style>
#title-slide-cloned {
text-align: center
}
#title-slide-cloned .subtitle {
margin-bottom: 2.5rem
}
</style>
~~~
**presentation.qmd**
~~~ markdown
---
title: "Title Slide"
subtitle: "Its a subtitle"
author: None
date: last-modified
format:
revealjs:
include-in-header: append-title-slide.html
slide-number: true
---
## Quarto
Quarto enables you to weave together content and executable code into a finished presentation. To learn more about Quarto presentations see <https://quarto.org/docs/presentations/>.
## Bullets
When you click the **Render** button a document will be generated that includes:
- Content authored with markdown
- Output from executable code
## Code
When you click the **Render** button a presentation will be generated that includes both content and the output of embedded code. You can embed code like this:
```{r}
1 + 1
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论