klutometis/roxygen — Issue #80: Wrapping of `\preformatted`
Author: mathematicalcoffee
Created: 2012-02-22 01:19:43+00:00
State: open

I've been trying to insert some instances of `\preformatted` into my roxygen markup, each line less than 60 characters.

Since roxygen2 seems to ignore newlines in markup (that aren't double newlines) and wrap at 60 characters, the text within my `\preformatted` all gets mashed into one line and wrapped at 60 characters.

That makes my 'preformatted' appear all distorted in the Rd/text help.

Is there a workaround for this? A `@verbatim` tag that tells roxygen to respect newlines within markup?

Example replicating my problem:

#' test documentation
#' @details
#' \preformatted{
#' /a\\
#' |b|
#' /x y 0 0 -ux -uy\\|d| = /u\
#' \\0 0 x y -vx -vy/|e| = \\v/
#' |g|
#' \\h/
#' }
#
f <- function()
{
return(NULL)
}

(I put in the double backslashes just in case. And just for interest, in reality, this will be nested in an `\ifelse{latex}{ ...latex version of the equation... }{ ASCII version for the text help file }`).

This shows up in the .Rd (and text help) as :

Details:
/a\ |b| /x y 0 0 -ux -uy\|d| = /u\ \0 0
x y -vx -vy/|e| = \v/ |g| \h/

This is a result of all the lines being formed into one and then wrapped at 60.