Following this guide to set Word (.docx
) style, you could make fig. and tab. captions boldface, though the whole caption line can be bold... I mean we have a way to create a caption in .docx
via RMarkdown like this automatically:
Figure S1: Single-crystal X-ray structure of some text (1)
However, still it seems difficult to make one like this:
Figure S1: Single-crystal X-ray structure of some text (1)
I imagine that you do want to boldface only "Figure/Table S1" section, not the whole caption line. Nevertheless, if you are interested in formatting .docx
file with Rmarkdown, you can check the link I added above and see the following description.
1. Knit the .Rmd
file @LmW. provided us to get the first .docx
output.
If you have some problem with captioner
package, you can also use the following one.
---
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:
word_document:
fig_caption: yes
---
```{r, include=F}
library(captioner)
#`captioner` package (Ver. 2.2.3) in my envionment returns the following error messages:
#Error in captioner(prefix = "Table S", suffix = ". ", style = "b", style_prefix = TRUE, :
# unused arguments (suffix = ". ", style = "b", style_prefix = TRUE)
#Error in captioner(prefix = "Figure S", suffix = ". ", style = "b", style_prefix = TRUE, :
# unused arguments (suffix = ". ", style = "b", style_prefix = TRUE)
#tables <- captioner(prefix = "Table S", suffix = ". ", style="b", style_prefix=TRUE, auto_space = FALSE)
#figures <- captioner(prefix = "Figure S", suffix = ". ", style="b", style_prefix=TRUE, auto_space = FALSE)
tables <- captioner(prefix = "Table S", auto_space = FALSE)
figures <- captioner(prefix = "Figure S", auto_space = FALSE)
figures("Xray1", "Single-crystal X-ray structure of some text (1)", display=FALSE)
figures("Xray2", "Single-crystal X-ray structure of some text (2)", display=FALSE)
figures("Xray3", "Single-crystal X-ray structure of some text (3)", display=FALSE)
```
## Reaction of etc.
Some text. Some text followed by `r figures("Xray1", display="cite")`, which is the same figure as `r figures("Xray3", display="cite")` but comes after `r figures("Xray2", display="cite")`.
```{r Xray, fig.cap=figures("Xray1"), echo=FALSE}
plot(cars)
```
```{r Xray2, fig.cap=figures("Xray2"), echo=FALSE}
plot(cars)
```
```{r Xray3, fig.cap=figures("Xray3"), echo=FALSE}
plot(cars)
```
Some text etc. followed by `r tables("tab-DipUVvis", display="cite")`:
```{r DipUVvis, echo=FALSE}
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)'))
knitr::kable(head(df), caption=tables("tab-DipUVvis", "Table Caption"))
```
2. Set Image Caption
and Table Caption
as boldface.
In the first .docx
file,
- Select an image caption or a table caption;
- Make it bold (
Ctrl
+ B
or Command
+ B
);
- Click the lower right corner of Styles setting in Home tab. Or press
Alt
+ Ctrl
+ Shift
+ S
;
- Find
Image Caption
or Table Caption
;
- Click its drop-down menu and click Update Title to match selection.
If you have done the steps above in both Image and Table Caption, be sure to save the .docx
file as word-styles-reference-01.docx
in your working directory.

3. Knit the .Rmd
file adding the reference_docx
line to get your final .docx
output.
Add reference_docx: word-styles-reference-01.docx
under word_document:
line. See Line 7 in the following 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:
word_document:
reference_docx: word-styles-reference-01.docx
fig_caption: yes
---
```{r, include=F}
library(captioner)
#`captioner` package (Ver. 2.2.3) in my envionment returns the following error messages:
#Error in captioner(prefix = "Table S", suffix = ". ", style = "b", style_prefix = TRUE, :
# unused arguments (suffix = ". ", style = "b", style_prefix = TRUE)
#Error in captioner(prefix = "Figure S", suffix = ". ", style = "b", style_prefix = TRUE, :
# unused arguments (suffix = ". ", style = "b", style_prefix = TRUE)
#tables <- captioner(prefix = "Table S", suffix = ". ", style="b", style_prefix=TRUE, auto_space = FALSE)
#figures <- captioner(prefix = "Figure S", suffix = ". ", style="b", style_prefix=TRUE, auto_space = FALSE)
tables <- captioner(prefix = "Table S", auto_space = FALSE)
figures <- captioner(prefix = "Figure S", auto_space = FALSE)
figures("Xray1", "Single-crystal X-ray structure of some text (1)", display=FALSE)
figures("Xray2", "Single-crystal X-ray structure of some text (2)", display=FALSE)
figures("Xray3", "Single-crystal X-ray structure of some text (3)", display=FALSE)
```
## Reaction of etc.
Some text. Some text followed by `r figures("Xray1", display="cite")`, which is the same figure as `r figures("Xray3", display="cite")` but comes after `r figures("Xray2", display="cite")`.
```{r Xray, fig.cap=figures("Xray1"), echo=FALSE}
plot(cars)
```
```{r Xray2, fig.cap=figures("Xray2"), echo=FALSE}
plot(cars)
```
```{r Xray3, fig.cap=figures("Xray3"), echo=FALSE}
plot(cars)
```
Some text etc. followed by `r tables("tab-DipUVvis", display="cite")`:
```{r DipUVvis, echo=FALSE}
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)'))
knitr::kable(head(df), caption=tables("tab-DipUVvis", "Table Caption"))
```