davidgohel / R2DOCX

Other
15 stars 9 forks source link

Feature request: addVerbatim (add verbatim text) #2

Closed markheckmann closed 6 years ago

markheckmann commented 11 years ago

I think a useful function would be something like addVerbatim or addConsoleOutput to add verbatim text output from the console into the doc. The unfortunate prerequisite would of course still be, that a Verbatim style (with some monospace font type) needs to exists in the template.

addVerbatim <- function(doc, value, stylename="Verbatim") {
  out <- capture.output(value)
  doc <- addParagraph(doc, value=out, stylename=stylename)  
  doc
}
davidgohel commented 11 years ago

OK with that also... It will be in the next release