我想要将写论文时需要用到的表格和图表从LaTeX转换成RMarkdown+bookdown。其中一个主要动机是为了能够创建Word文档和PDF文档。
对于word_document2
,我该如何在图表上方添加图表标题/说明,并在相同的图表下方添加注释?
以下是我在LaTeX中的做法(因为我正在将所有内容从LaTeX转移到RMarkdown中,所以继续使用LaTeX会很方便)。
\begin{figure}
\caption{Figure Title...}
\label{figure_label}
\vspace*{.2cm}
\includegraphics[width=7in]{figure_name.png}\\
\caption*{Figure Notes...}
\end{figure}
更广泛地说,是否有可能在word_document2中使用LaTeX代码?
请注意,我的导言目前看起来像:
---
title: "..."
author: "..."
date: "10/14/2021"
output:
bookdown::word_document2:
number_sections: false
bookdown::pdf_document2:
number_sections: false
header-includes:
- \usepackage{floatrow}
- \floatsetup[figure]{capposition=top}
citation_package: default
bibliography: ../references.bib
always_allow_html: true
---
我目前能够获得图像上方的标题,但仅适用于pdf_document2
(请参见Caption above figure using knitr (LaTeX/PDF)):
```{r figure-label, fig.cap="Figure Title", fig.width=6, fig.height=3.7, fig.align="center"}
...
在创建Word文档时,这似乎不起作用。