重复标题幻灯片在 reveal.js 演示末尾。

huangapple go评论60阅读模式
英文:

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演示文稿的更多信息,請參見&lt;https://quarto.org/docs/presentations/&gt;。

## 簡介

當您單擊**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
&lt;script&gt;
  function move_titleSlide() {
      var titleSlide = document.querySelector(&#39;section#title-slide&#39;);
      var titleSlideClone = titleSlide.cloneNode(true);
      titleSlideClone.id = &#39;title-slide-cloned&#39;;
      document.querySelector(&#39;.reveal .slides&#39;).appendChild(titleSlideClone);
      Reveal.sync();
  }

  window.document.addEventListener(&quot;DOMContentLoaded&quot;, function (event) {
    move_titleSlide();
  });
&lt;/script&gt;


&lt;style&gt;
  #title-slide-cloned {
    text-align: center
  }

  #title-slide-cloned .subtitle {
    margin-bottom: 2.5rem
  }
&lt;/style&gt;
~~~


**presentation.qmd**

~~~ markdown
---
title: &quot;Title Slide&quot;
subtitle: &quot;Its a subtitle&quot;
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 &lt;https://quarto.org/docs/presentations/&gt;.

## 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>



huangapple
  • 本文由 发表于 2023年5月10日 13:50:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76215257.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定