简体   繁体   English

如何调整 Quarto 中的数字(PDF 输出)?

[英]How to resize figures in Quarto (PDF output)?

I do not get the syntax for resizing graphics in Quarto, could you please give me a hint.我没有得到在 Quarto 中调整图形大小的语法,请给我一个提示。 The following has no effect.以下没有效果。

---
title: "resize image"
format: pdf
---

![World](images/World.pdf){fig-width=5}

![World](images/World.pdf){fig-width=10}

![World](images/World.pdf){fig-width=50%}

![World](images/World.pdf){fig-height=50%}

https://quarto.org/docs/reference/formats/pdf.html#figures https://quarto.org/docs/reference/formats/pdf.html#figures

https://quarto.org/docs/authoring/figures.html https://quarto.org/docs/authoring/figures.html

You can use width and height , as documentedhere .您可以使用widthheight ,如此处所述

---
title: "resize image"
format: pdf
---

![Elephant with small width](elephant.png){width=10%}

![Elephant with larger height](elephant.png){height=50%}

You can also use px and in as the unit, or specify it between quotes:您还可以使用pxin作为单位,或在引号之间指定:

![Elephant with height=100px](elephant.png){height=100px}

![Elephant](elephant.png){height=2in}

![Elephant](elephant.png){height="100"}

Why are fig-height and fig-width not working?为什么fig-heightfig-width不起作用?

As stated in the document you cite, fig-height and fig-width are settings for the default size for figures generated by R or Matplotlib graphics .如您引用的文档中所述, fig-heightfig-widthR 或 Matplotlib graphics 生成的图形的默认大小设置。

Since your image is not generated by R or Matplotlib, you should use pandoc 's attributes, as documented here .由于您的图像不是由 R 或 Matplotlib 生成的,因此您应该使用pandoc的属性,如此所述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM