I am using Rstudios markdown to write a report which I would like to compile to pdf using latex as well as to html...
Is it somehow possible to adjust the size of caption fonts for images included in an ![caption](figure.jpg)
environment? At the moment captions in html look like the rest of the text.
This answer has obviously already been accepted but just for completeness I am adding the PDF aspect of the question.
If you wish to alter the caption font size for your PDF documents I would recommend to use the caption
package via one of the following two approaches:
header-includes - option:
---
title: "Title"
author: "Jorge Luis Borges"
header-includes:
- \usepackage[font={small}]{caption}
output:
pdf_document
---
The focus here is on font={<font options>}
.
in_header - option:
---
title: "Title"
author: "Jorge Luis Borges"
output:
pdf_document:
includes:
in_header: style.tex
---
Where style.tex
is included in the same directory that contains the .Rmd file. The style.tex
file needs to contain \usepackage[font={small}]{caption}
.
As before, the focus here is on font={<font options>}
.
With the caption
package you have loads of customisation options, just to name a few, see below:
scriptsize
= very small sizefootnotesize
= size typically used for footnotessmall
= small sizelarge
= large sizeit
= italicsbf
= bold faceFor full reference please visit the official documentation.
Also, some cross-references here to articles on the TexSE site:
Change the font of figure captions
How to include Latex package in RMarkdown
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With