2

Default R Markdown captions in Word appear as:

  • Figure 1: Figure Title
  • Table 1: Table Title

I would like to format my captions so that the Figure 1/Table 1 is bold and the title is italic on the next line. This is the APA style of captions:

Figure 1

Figure Title

I have been trying to figure out an easy way to do this, but can't seem to find a solution. (If figure captions can be above figure, rather than below, that would also be great!). Here is a minimal reprex:

---
title: "Untitled"
author: "Test"
date: "11/8/2020"
output:
  bookdown::word_document2: default
---

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




{r table, tab.cap="Descriptives", echo=FALSE, message=FALSE, warning=FALSE}
psych::describe(cars) %>%
  as.data.frame() %>%
  flextable() %>%
  set_table_properties(layout = "autofit", width = 1)


{r fig, fig.cap="Pressure Figure", echo=FALSE, message=FALSE, warning=FALSE}
plot(pressure)
neilfws
  • 29,020
  • 5
  • 49
  • 59
acircleda
  • 587
  • 3
  • 10
  • Directly related (duplicate?): [How to change the figure caption format in bookdown](https://stackoverflow.com/questions/51945079/how-to-change-the-figure-caption-format-in-bookdown); bottom line: there's no easy solution. Have you considered moving away from Word templates and using LaTeX instead (within RMarkdown)? These type of customisations are usually a lot easier in LaTeX. – Maurits Evers Nov 09 '20 at 01:36

0 Answers0