英文:
How to rotate a figure (.png) in a Quarto document
问题
我在我的 Quarto 文档中包括了一个图像(.png)。
由于这个图像太大且信息丰富,我想将它旋转为横向格式以提高可读性。
我只找到适用于 revealjs 的解决方案,而这些解决方案在文章格式下不起作用(参见例如此帖子:https://stackoverflow.com/questions/76069903/rotate-images-in-quarto)。
有什么建议吗?
英文:
I included a figure (.png) in my Quarto Document.
As the figure is so big and rich in information I want to rotate it to a landscape format for improving readability.
I only find solutions for revealjs that do not work with an article format (see e.g., this thread: https://stackoverflow.com/questions/76069903/rotate-images-in-quarto)
Any suggestions?
答案1
得分: 1
"Does this help (see here for more alternatives)?
title: "Test Landscape"
format:
pdf:
number-sections: true
include-in-header:
- text: |
\usepackage{lscape}
\newcommand{\blandscape}{\begin{landscape}}
\newcommand{\elandscape}{\end{landscape}}
normal
hist(mtcars$mpg)
\blandscape
Landscape {#sec-landscape}
#| fig-cap: A Caption
#| label: fig-hist
hist(mtcars$mpg)
\elandscape
Let's try out crossreference.
We can see in section @sec-landscape that the histogram @fig-hist is turned around.
英文:
Does this help (see here for more alternatives)?
---
title: "Test Landscape"
format:
pdf:
number-sections: true
include-in-header:
- text: |
\usepackage{lscape}
\newcommand{\blandscape}{\begin{landscape}}
\newcommand{\elandscape}{\end{landscape}}
---
# normal
```{r}
hist(mtcars$mpg)
```
\blandscape
# Landscape {#sec-landscape}
```{r}
#| fig-cap: A Caption
#| label: fig-hist
hist(mtcars$mpg)
```
\elandscape
Let's try out crossreference.
We can see in section @sec-landscape that the histogram @fig-hist is turned around.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论