Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quarto make long text fit into one slide with revealjs

I am creating a presentation in RevealJS using Quarto. The text of one of the slides is too long and gets truncated. Is there a way to automatically (or manually) adjust the font size to make the text fit into one slide? Here is a MWE:

---
title: "My slides"
format:
    revealjs:
        embed-resources: true
        transition: slide
output: 
    revealjs::revealjs_presentation:
        css: styles.css
execute:
    echo: TRUE
---

# This is fine

- Topic 1
   - Level 1
   - Level 2
   - Level 3

# This does not fit

- Topic 2
   - Level 1
   - Level 2
   - Level 3
- Topic 3
   - Level 1
   - Level 2
   - Level 3
- Topic 4
   - Level 1
   - Level 2
   - Level 3
like image 653
Claudio Avatar asked Sep 03 '25 16:09

Claudio


1 Answers

We can follow the suggestions from the section Content Overflow to use the class .smaller to use smaller font for a slide if it contains too much content and even can make the content scrollable by using the .scrollable class.

---
title: "My slides"
format: revealjs
execute: 
  echo: true
---

# This is fine

- Topic 1
   - Level 1
   - Level 2
   - Level 3

# This does not fit {.scrollable .smaller}

- Topic 2
   - Level 1
   - Level 2
   - Level 3
- Topic 3
   - Level 1
   - Level 2
   - Level 3
- Topic 4
   - Level 1
   - Level 2
   - Level 3
like image 184
Shafee Avatar answered Sep 05 '25 06:09

Shafee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!