This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!require(tidyverse) || !require(xml2)){ | |
stop("Packages `tidyverse` and `xml2` are required for read_nquery() to work.\n", | |
'Please run `install.packages(c("tidyverse", "xml2", "devtools"))` before trying again.') | |
} | |
#' Read nQuery files | |
#' | |
#' @param file the `.nqt` file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Extension ofTarleb's answer on Stackoverflow (https://stackoverflow.com/a/52131435/3888000) to include docx section ends with portrait/landscape orientation changes. | |
-- Also uses officer package syntax to create sections breaks | |
local function newpage(format) | |
if format == 'docx' then | |
local pagebreak = '<w:p><w:r><w:br w:type="page"/></w:r></w:p>' | |
return pandoc.RawBlock('openxml', pagebreak) | |
else | |
return pandoc.Para{pandoc.Str '\f'} |