When using bookdown (single document), figures are numbered automatically as:
Figure 1 Text of figure caption.
In chemistry, the convention is to label main Figures as:
Figure 1. Text of figure caption.
and for the supporting information document:
Figure S1. Text of figure caption.
Also in the figure reference in the text we need:
...as can be seen in Figure 1, ...
so the reference text should not be bold.
Question
How can i make bookdown (or rmarkdown) produce figure and table captions like so: "Figure S1. Some text." and "Table S1. Some text." ?
I need this to be in MS Word format.
Example/ Attempted Solution
So far i tried to modify the _bookdown.yml document as follows:
language:
label:
fig: "**Figure S**"
tab: "**Table S**"
This gives: Figure S1 Some text... and the inline reference when using:
Figure S@ref(fig:Xray)
is Figure S1 which is ok.
Here is a minimal example:
---
title: Supporting Information
subtitle: "Iron(I) etc"
author: "Some people here"
abstract: "Added the addresses here since there is no abstract in the SI"
output:
bookdown::word_document2:
fig_caption: yes
toc: yes
toc_depth: 1
---
## Reaction of etc.
Some text (Figure S@ref(fig:Xray)). Some text followed by a figure:
```{r Xray, fig.cap="Single-crystal X-ray structure of some text", echo=FALSE}
plot(cars)
```
Some text etc. followed by a table:
```{r DipUVvis, echo=FALSE, tab.cap="Table caption"}
df<-data.frame(Entry=c('AMM 51$3^a$','AMM 52^*a*^'),
Precat=c('[FeBr~2~(dpbz)~2~] (4.00)','[FeBr~2~(dpbz)~2~]
(2.00)'))
kable(head(df), format = "markdown")
```
The code above produces Figure S1 in the figure caption but NOT Figure S1. (Note it is all bold and a full stop in the end).
See Question&Answers more detail:
os