I have a RMarkdown document with some text, and I want to wrap the text around a figure. Now this hasn't been a problem previously using wrapfigure, however all of a sudden the image floats to the bottom of the document no matter what I try to do!
MWE that doesn't work for me:
---
title: "TEST"
date: "`r Sys.Date()`"
lang: "en"
output:
pdf_document
fontsize: 10pt
header-includes:
- \usepackage{wrapfig}
- \usepackage{lipsum}
- \usepackage{mwe}
urlcolor: blue
---
\begin{wrapfigure}[H]{r}{0.5\textwidth}
\includegraphics{example-image-a}
\end{wrapfigure}
# Header 1
\lipsum[1]
\lipsum[2]
\lipsum[3]

