Skip to content

How can I reduce the space between ggplot2 figures and subsequent text in revealjs slides? #10888

Answered by mcanouil
jtr13 asked this question in Q&A
Discussion options

You must be logged in to vote

Using the inspect/developer mode show what is adding the margins.

You only have to overwrite that rule, either in a CSS file via the css key, via SCSS using theme or via include-in-header.

---
format: 
  revealjs:
    auto-stretch: false
    include-in-header:
      - text: |
          <style>
            .reveal p > img {
              margin: 0;
            }
          </style>
---

## auto-stretch: true

```{r}
plot(1)
```

This is a line of text below the plot.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@mcanouil
Comment options

Answer selected by jtr13
@jtr13
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
revealjs Issues with the revealjs format figures themes Related to HTML theming or any other style related issue (like highlight-style)
3 participants