当我写一篇包含表格和图形的论文时,我正试图从LaTeX切换到RMarkdown+bookdown。一个主要的动机是能够创建Word文档和PDF文档。
对于word_document2,如何在图形上添加图形标题/标题,以及在同一图形下添加图形注释?
下面是我如何在LaTeX中做这件事(继续使用LaTeX会很方便,因为我正在把所有的东西从LaTeX转移到RMarkdown)。
\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文档时,这似乎不起作用。
发布于 2021-10-19 17:42:05
---
title: "..."
author: "..."
date: "10/14/2021"
output:
officedown::rdocx_document:
plots:
style: Normal
align: center
topcaption: true
bookdown::pdf_document2:
number_sections: false
header-includes:
- \usepackage{floatrow}
- \floatsetup[figure]{capposition=top}
citation_package: default
---
```{r figure-label, fig.cap="Top Caption", fig.width=6, fig.height=3.7}plot(rnorm(1000,300,32))
库(Officedown)
这应该会给你一个顶部带有图形标题的docx。
https://stackoverflow.com/questions/69588154
复制相似问题