0
我使用R中的ReporteRs包创建Word文档,并且我想将单个间隔的段落间距改为1.5间隔。使用R中的ReporteR更改docx中的行间距
我想我可以输入每一行作为一个新的段落,并在每个“段落”的开始放置一个缓冲区,但我正在寻找一种更干净的方式。
我打算使用另一个包,如果它会工作。
我使用R中的ReporteRs包创建Word文档,并且我想将单个间隔的段落间距改为1.5间隔。使用R中的ReporteR更改docx中的行间距
我想我可以输入每一行作为一个新的段落,并在每个“段落”的开始放置一个缓冲区,但我正在寻找一种更干净的方式。
我打算使用另一个包,如果它会工作。
您可以在空白Word文档中定义一个行距为1.5的段落(名称为myparag
),并将其重新用作模板(文件名:template.docx
)。
doc <- docx()
styles(doc) # check value `myparag` is in the available paragraph styles
doc <- addParagraph(doc, "Blah blah blah", stylename = "myparag")
## docx example
doc = docx()
# Footnote definition
par1 = pot("About this reference", textItalic(font.size = 8))
par2 = pot("Omni ab coalitos pro malivolus obsecrans graviter
cum perquisitor perquisitor pericula saepeque inmunibus coalitos ut.",
textItalic(font.size = 8))
Footnote = Footnote()
Footnote = addParagraph(Footnote, set_of_paragraphs(par1, par2),
parProperties(padding.top = 15))
# add text in the doc with previously defined footnote
my_pot = pot("Blah blah blah.") +
pot(" Here is a note.", footnote = Footnote)
doc = addParagraph(doc, my_pot)
writeDoc(doc, file = "footnote.docx")
谢谢!这适用于我的段落,但同样的技巧无法改变该段落中包含的脚注中的间距。脚注风格似乎是由段落风格决定的,但我想要一个单独的脚注,并在1.5间隔的段落中引用该脚注。你能帮我吗? – forest