Maël
Maël

Reputation: 52059

Center caption in Quarto

Is there an easy way to center a caption in Quarto? I work with the revealjs format. I'd like to do this locally.

I've tried with fig-cap-location="center" but it does not work.

Reproducible example:

---
title: "Untitled"
format: revealjs
---

## Centering the caption

![I want this to be centered](https://www.r-project.org/logo/Rlogo.png){fit-align="center"}

enter image description here

Upvotes: 2

Views: 2593

Answers (2)

Kevin Murphy
Kevin Murphy

Reputation: 31

In https://quarto.org/docs/authoring/figures.html#figure-alignment, they say

Note that figure captions are left aligned to accommodate longer caption text (which looks odd when center aligned).

Upvotes: 1

Julian
Julian

Reputation: 9260

I think the easiest way is using css, e.g.

.caption{
   text-align: center;
}

Upvotes: 3

Related Questions