Val
Val

Reputation: 75

fig.cap in rmarkdown does not work when multiple images and output in Word

I'm producing a document using bookdown where I'm trying to print three figures side by side with one caption underneath, but I can't get the caption to work. The output has to be a word document.

I have 2 rmd:

  1. an index.rmd, that has the following preamble:
---
title: " "
output: 
  bookdown::html_document2:
   css: "style.css"
  bookdown::word_document2:
    fig_caption: yes
bookdown::gitbook:
  css: "style.css"
always_allow_html: true
site: bookdown::bookdown_site
---
  1. An introduction.rmd file, where I'm printing three figures side by side:
---
output:
  word_document: default
  html_document: default
editor_options:
  chunk_output_type: inline
  markdown: 
    wrap: sentence
---


# **INTRODUCTION** {#introduction}

```{r figures, out.width = "30%", echo=FALSE, fig.cap="my figures"}

knitr::include_graphics(c("./_images/fig1.png", "./_images/fig2.png", "./_images/fig3.png"))


I don't understand why I'm not able to get a caption underneath my figures. I've looked into officer and officedown but I don't seem able to get it to work.

Any help would be much appreciated.

Thanks,

V

Upvotes: 0

Views: 37

Answers (0)

Related Questions