设置Rmarkdown的YAML标题中数字的标题字体大小
我正在使用Rstudios markdown编写一份报告,我想使用latex将其编译为pdf以及html设置Rmarkdown的YAML标题中数字的标题字体大小,r,yaml,rstudio,knitr,r-markdown,R,Yaml,Rstudio,Knitr,R Markdown,我正在使用Rstudios markdown编写一份报告,我想使用latex将其编译为pdf以及html 是否有可能调整中包含的图像的标题字体大小![说明](figure.jpg)environment?目前,html中的标题看起来与文本的其余部分类似。您可以使用css控制这一点。例如: <style type="text/css"> .caption { font-size: x-small; } </style> ![caption](figure.jpg)
是否有可能调整
中包含的图像的标题字体大小![说明](figure.jpg)
environment?目前,html中的标题看起来与文本的其余部分类似。您可以使用css控制这一点。例如:
<style type="text/css">
.caption {
font-size: x-small;
}
</style>
![caption](figure.jpg)
.标题{
字体大小:x-small;
}
![说明](图.jpg)
有关可用的
字体大小
选项,请参见css指南。这个答案显然已经被接受,但为了完整起见,我添加了问题的PDF部分
如果您希望更改PDF文档的标题字体大小,我建议您通过以下两种方法之一使用caption
软件包:
标题包括-选项:
---
title: "Title"
author: "Jorge Luis Borges"
header-includes:
- \usepackage[font={small}]{caption}
output:
pdf_document
---
---
title: "Title"
author: "Jorge Luis Borges"
output:
pdf_document:
includes:
in_header: style.tex
---
这里的重点是font={}
在标题中-选项:
---
title: "Title"
author: "Jorge Luis Borges"
header-includes:
- \usepackage[font={small}]{caption}
output:
pdf_document
---
---
title: "Title"
author: "Jorge Luis Borges"
output:
pdf_document:
includes:
in_header: style.tex
---
其中style.tex
包含在包含.Rmd文件的同一目录中。style.tex
文件需要包含\usepackage[font={small}]{caption}
与前面一样,这里的重点是font={}
使用
标题
软件包,您可以获得大量定制选项,仅举几个例子,请参见以下内容:
=非常小的大小scriptsize
=通常用于脚注的大小footnotesize
=小尺寸small
=大尺寸large
=斜体it
=粗体bf
多亏了@Johnny之前的评论,我想对我的pdf报告中的数字标题做更多的修改。我希望标题如下所示: 图1。这是一张解释生产率的图表 要获得此信息,请添加YAML:
---
title: "Title"
author: "Author"
header-includes:
- \usepackage[font={small,it}, labelfont={bf}]{caption}
output:
pdf_document
---