Closed paulsharpeY closed 3 years ago
Knitting some individual chapters to word_document2
works.
I narrowed this down to an issue with correction
blocks. You should be able to reproduce this by knitting chapter 3 (works) and chapter 4 (fails) to Word. I reproduced this in a document with a single correction block, so I think inline corrections are fine. Here's the error when building chapter 4.
output file: 04-oxthesis.knit.md
UTF-8 decoding error in 04-oxthesis.utf8.md at byte offset 2271 (f8).
The input must be a UTF-8 encoded text.
Error: pandoc document conversion failed with error 92
In addition: Warning messages:
1: In read_utf8(file) :
The file pandoc4e7e458b9109 is not encoded in UTF-8. These lines contain invalid UTF-8 characters: 3, 4, 5, 6, 7, 8, ...
2: In read_utf8(file) :
The file pandoc4e7e51bc8afc is not encoded in UTF-8. These lines contain invalid UTF-8 characters: 3, 4, 5, 6, 7, 8, ...
3: In readLines(con, warn = FALSE) :
invalid input found on input connection '04-oxthesis.knit.md'
Execution halted
Warning message:
In file.remove(intermediate_html) :
cannot remove file '04-oxthesis.utf8.tmp.html', reason 'No such file or directory'
It might also be worth noting that custom blocks rely on echo=TRUE
. I had to add this to my correction blocks, as I'd set echo=FALSE
globally, something you're likely to do in a thesis.
Thanks for flagging this - apologies for the delay.
It seems custom blocks cannot be included in Word output. I've pushed a fix (the correction block example now has the chunk options block type='correction', include=knitr::is_latex_output() | knitr::is_html_output()
). I also allowed HTML stuff to be included in word output (always_allow_html: true
in index.Rmd), which make the Word output more likely to compile come hell or high water. :)
I have not paid much attention to the word output - I very much welcome pull requests with e.g. a nice template for Word output, or implementation of correction highlighting via officer
or officedown
!
...