Is it possible to remove slide-number
and footer
elements from the title slide in Quarto?
---
title: "My prez"
format:
revealjs:
slide-number: c
footer: "Confidential"
---
You can do this using Revealjs API methods. So write the necessary Js code (To capture the event of slide being ready and slide changed and if the current slide is title slide, change the display of footer and slide number to none
) in a html file and then attach that file to qmd file using include-after-body
.
---
title: "My prez"
format:
revealjs:
slide-number: c
footer: "Confidential"
include-after-body: clean_title_page.html
---
## Slide A
## Slide B
clean_title_page.html
<style>
.hide {
display: none !important;
}
</style>
<script>
function remove() {
let footer = document.querySelector('div.footer');
let slideNo = document.querySelector('div.slide-number');
slideNo.classList.add('hide');
footer.classList.add('hide');
Reveal.on('slidechanged', event => {
if(Reveal.isFirstSlide()) {
slideNo.classList.add('hide');
footer.classList.add('hide');
} else {
slideNo.classList.remove('hide');
footer.classList.remove('hide');
}
});
}
window.onload = remove();
</script>