Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrapping causing errors #89

Closed
jverzani opened this issue Apr 13, 2012 · 5 comments
Closed

wrapping causing errors #89

jverzani opened this issue Apr 13, 2012 · 5 comments

Comments

@jverzani
Copy link

@jverzani jverzani commented Apr 13, 2012

Sometimes the wrapping of contents will occur and an entry like:

 \method{.getStockIconByName}{guiWidgetsToolkitQt}
    (toolkit, name, ...)

will happen. This causes a warning (Bad \usage lines found in documentation object ...) Whereas

 \method{.getStockIconByName}{guiWidgetsToolkitQt}  (toolkit, name, ...)

does not. Seems like something that should be fixed downstream. But in the absence of that, I can report that adjusting the width option in format_collapse to 600 (from 60) will fix the problem for me. Since Rd files aren't really meant to be read, I don't see why wrapping at 60 is desirable.

@hadley
Copy link
Member

@hadley hadley commented Apr 15, 2012

Hi John - we're wrapping Rd files because when you view them from the terminal wrapping does matter (and I was trying to match the style of base R documentation). I'll take a look when I'm working on roxygen2 next.

@jverzani
Copy link
Author

@jverzani jverzani commented Apr 15, 2012

Good points. It isn't really wrapping that is the issue, it is the breaking at }( that causes problems. Here is a small hack that works, likely you can make look prettier:

format_collapse <- function(x, ..., indent = 2, exdent = 2) {
values <- str_c(x$values, collapse = "\n\n")
values <- gsub("}\s+(", "}(", values) ## <---- right here
rd_tag(x$tag, str_wrap(values, width = 60, indent = indent,
exdent = exdent), space = TRUE)
}

@BrianDiggs
Copy link

@BrianDiggs BrianDiggs commented Jan 7, 2013

Wrapping can also apparently cause problems with text parts of deqn as discussed in http://stackoverflow.com/q/14041601/892313

@hadley
Copy link
Member

@hadley hadley commented Nov 4, 2013

I think overall I'd like to move roxygen2 towards no wrapping, since this causes substantial problems.

@krlmlr
Copy link
Member

@krlmlr krlmlr commented Nov 4, 2013

Just for reference: #129 proposes a temporary solution.

@hadley hadley closed this in 5be2e3e Nov 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants