【发布时间】:2018-03-16 17:14:19
【问题描述】:
我希望能够在对 word 使用 papaja 模板时格式化 word 输出(html 输出或 pdf 输出分别适用于 html 和 LaTeX)。
例如,假设我想用题词开始一篇论文,其中第一行包含某人的引用(左对齐,不缩进),第二行包含引用的人的姓名(右对齐):
由于 papaja(根据需要)和样式为“left”和“right”的 word 文档,以下为我提供了 APA 格式。
---
title: Test
author:
- name: author
email: author@uni.com
address: address
corresponding: yes
output:
papaja::apa6_word
---
```{r message = FALSE, warning = FALSE}
knitr::opts_chunk$set(echo = FALSE)
library("papaja")
```
<div custom-style="left">This text should go on the left after editing the styles in word</div>
<div custom-style="right">This text should go on the right after editing the styles in word</div>
当我在 word 文档中编辑样式“左”和“右”时,将该文档另存为 template.docx,然后更改我的输出以包含模板作为参考(请参阅下面的 MWE),第一行的格式正确(左右对齐)。但是,由于我没有指定我想使用 papaja 的 apa6_word 模板,因此输出在逻辑上不是以 APA 样式格式化的。
---
title: Test
author:
- name: author
email: author@uni.com
address: address
corresponding: yes
output:
word_document:
reference_docx: template.docx
---
```{r message = FALSE, warning = FALSE}
knitr::opts_chunk$set(echo = FALSE)
library("papaja")
```
<div custom-style="left">This text should go on the left after editing the styles in word</div>
<div custom-style="right">This text should go on the right after editing the styles in word</div>
有没有办法两者兼得?即,将格式保留为papaja::apa6_word,但能够微调某些方面? 针对这个问题的黑客已经会有所帮助,但我预计会更频繁地遇到这个问题,我想知道是否有是更通用的解决方案吗?
【问题讨论】:
标签: r ms-word r-markdown