Changing the font size of figure captions in RMarkdown pdf output
我想缩小我的R Markdown文档中所有标题(图和表格)的字体大小。 我正在使用书本。 最终输出是pdf,我正在R Studio中工作。 要加载图片,我使用了
我只找到了完全相同的问题,但此处为html输出
示例
1 2 3 4 5 6 7 8 9 | --- output: pdf_document --- Normal text has the same size as the captions. ```{r, echo = FALSE, out.width = '50%', fig.cap ="The caption has the same size as normal text."} knitr::include_graphics('logo.png') ``` |
如您所见,标题字体大小和常规文本字体大小完全相同,看起来不太好。 我怎么解决这个问题?
如果使用LaTeX软件包可接受,则可以使用
1 2 3 4 5 6 7 8 9 10 11 12 13 | --- output: pdf_document header-includes: - \\usepackage{caption} - \\captionsetup[figure]{font=scriptsize} --- Normal text has the same size as the captions. ```{r, echo = FALSE, out.width = '50%', fig.cap ="The caption has the same size as normal text."} knitr::include_graphics('logo.png') ``` |
替换
https://zh.wikibooks.org/wiki/LaTeX/Fonts#Built-in_sizes
CTAN上的
https://ctan.org/pkg/caption