Hello, I have the problem with the output text in the pdf document going out of margin when the document is rendered using rmarkdown::render with output_format = 'pdf_document'. This can be avoided by using knit button in RStudio but sometimes I need the documents being generated by running scripts. Here is a reproducible example:
When running knit button, it will also use rmarkdown::render() so I don't see why there would be a difference I am really surprised by this, so I looked into it
So it is possible that the background process started by RStudio IDE does set some options.
Cell output width is controlled by the option width and I see that by default on my R console it is
> getOption("width")
[1] 176
and this will be used with rmarkdown::render(). So you need to change this.
See about width of text output
So I would advice to change this option in your document setup chunk like you do with tidy.opts