在Quarto中居中显示标题。

huangapple go评论48阅读模式
英文:

Center caption in Quarto

问题

在Quarto中以revealjs格式居中标题的简便方法是什么?我想在本地进行这个操作。

我尝试过使用fig-cap-location="center",但不起作用。

可复现的示例:

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

## 居中标题

![我希望这个标题居中](https://www.r-project.org/logo/Rlogo.png){fit-align="center"}

在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"}

在Quarto中居中显示标题。

答案1

得分: 1

我认为最简单的方法是使用 CSS,例如:

.caption{
   text-align: center;
}
英文:

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

.caption{
   text-align: center;
}

答案2

得分: 1

在https://quarto.org/docs/authoring/figures.html#figure-alignment中,他们说:“请注意,图题是左对齐的,以适应更长的图题文本(在居中对齐时看起来很奇怪)。”

英文:

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).

huangapple
  • 本文由 发表于 2023年6月5日 16:42:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76404758.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定