JBF
JBF

Reputation: 55

Repeat title slide at end of reveal.js presentation

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

Upvotes: 3

Views: 438

Answers (1)

Shafee
Shafee

Reputation: 19897

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

<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: "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
```

Upvotes: 4

Related Questions