forest
forest

Reputation: 335

Change line spacing in footnote of docx using ReporteRs in R

In a word document, I want single spaced footnotes while the body of the document is 1.5 spaced.

No matter what I try, the footnote spacing stays at 1.15 spacing instead of single spacing.

I've tried changing the style of the footnote and changing the padding around each line of the footnote (treating each as a different paragraph). Styles don't seem to work on footnotes and changing the padding to zero still left the default 1.15 space between each "paragraph."

My current code:

footnote1 = Footnote()
footnote1 = addParagraph( footnote1,
                          value = pot("footnote text",
                                  textProperties(font.size = 10, font.family = "Arial"))
                        )

doc <- addParagraph( doc, 
                     value = "\tparagraph text" +
                         pot("addfootnotehere.", footnote = footnote1 ) +
                         "more text.", 
                     stylename = "NormalLeft",
                     bookmark = "paragraph1"
                   )

Upvotes: 0

Views: 133

Answers (1)

jpf5046
jpf5046

Reputation: 797

Your problem may be fixed if you used your own created template instead of the default doc <- docx().

Set up a template with the spacing required, save it, then call the newly created template with:

doc <- docx(template = 'D:/docs/template/my_corporate_template.docx')

then addFootnote should read your template sizing without auto correcting.

Upvotes: 1

Related Questions