Replies: 1 comment
-
For what it's worth, using pandoc might be an effective workaround for the chunking problem in general. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to import the styling from one template document and apply it to the working document?
In particular, I have noted that when officer fails to get document properties, it applies an internal default template. Is it possible to do the same, but usiong a different .docx file?
Specifically, I am using a bit of an unusual workflow as a hack to get files "rechunked" so I can find/replace placeholders.
With an existing .docx file, I use pandoc_convert to convert from a .docx to a .docx, which in the process succesfully consolidates in-paragraph chunks. Unfortunately, pandoc_convert loses styles in the process, so I need to reapply the styles from the original (pre-"converted") document posthoc.
test template manuscript.docx
`library(officer)
library(pandoc)
docx_out <- tempfile(fileext = ".docx")
pandoc::pandoc_convert(file = "test template manuscript.docx", from="docx", to = "docx",output=docx_out)
doc <- read_docx(path = docx_out)
print(doc, target="test output.docx")`
Beta Was this translation helpful? Give feedback.
All reactions