How to insert two images in the same line, one with left one with right alignment

Viewed 139

I have two same size images, and I would like to insert in for knitting to a PDF document, one with left one with right alignment.

I have used

---
title: "Untitled"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Testing

![](meme.jpg){width=5%, align="left"}  ![](meme.jpg){width=5%,align="right"}

but it does not seem to work.

What am I doing wrong?

1 Answers

Markdown does not include alignment but you can use LaTeX's \hfill:

---
title: "Untitled"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Testing
![](meme.jpg){width=5%} \hfill ![](meme.jpg){width=5%}
Related