Closed mattwarkentin closed 5 years ago
This works for me, in that I get an output document with Garamond font. Is this not the case for you?
If not, do attach the output file that you generate, as well.
@noamross Hmm, very peculiar that it is working for you...
I ran the same setup as before:
---
title: Reversible R Markdown Document
subtitle: Your subtitle
author: Your Name
date: Created `r Sys.Date()`
output:
redoc::redoc:
reference_docx: /Users/Matt/Documents/pandoc-ref-styles/ref-style-serif.docx
---
I tried again and had no luck. Here is the output file: redoc.docx
It does not have the correct font, margins, headers, etc.
No errors in RStudio
R Markdown
pane, however, it doesn't look like the template is being passed to pandoc, right?
/usr/local/bin/pandoc +RTS -K512m -RTS redoc.utf8.md --to docx+empty_paragraphs --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart+fenced_divs+bracketed_spans --output redoc.docx --highlight-style tango --lua-filter /Library/Frameworks/R.framework/Versions/3.5/Resources/library/redoc/lua-filters/protect-empty.lua
According to the diagnostics in your redoc.docx
, you're using an old commit of redoc (0ee885e). Can you re-install the latest version try again?
@noamross Good suggestion! I had to update diffobj
first and then re-installed redoc
and everything now seems to be working as expected. Thanks for your help.
Hi Noam,
I asked you on Twitter about how to use a reference DOCX file to change the formatting of a
redoc
document. I figured it was the same providing areference_docx
to a standardR Markdown
with output asword_document
; and you confirmed this to be the case and asked that I file an issue if it didn't work.Here is the basics of what I did:
With the following YAML header:
I have attached the reference file here (ref-style-serif.docx), if that helps. In the same session, I verified that I can pass the reference doc to a standard
word_document
formatR Markdown
file and it does indeed render using the reference format. So it seems like something specific toredoc
. The reference document I am providing was created using the recommended approach (i.e. get a template word document from pandoc and modify the style as preferred.Session Info
```r R version 3.5.3 (2019-03-11) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Mojave 10.14.4 ``` Pandoc version (get with rmarkdown::pandoc_version): > rmarkdown::pandoc_version() [1] ‘2.7.2’ RStudio version (if applicable): Version 1.2.1335