8

I am using roxygen2 from within RStudio to generate package documentation. How do I force the following in the @description section to appear as verbatim fixed-font?

SettingID    Value    
RedItem      Patient_10574    
GreenItem    Record_433    

My workaround is to put it into @examples \dontrun{}, but that's not what I want.

@Joshua Ulrich found a (non-)solution to here

Community
  • 1
  • 1
Dieter Menne
  • 10,076
  • 44
  • 67
  • Just an idea, what about `\code{}`? Can it handle multi lines? – Roman Luštrik Jun 12 '13 at 09:40
  • Clearly, `\code{}` was my first choice, but I could not get it to honor the verbatim layout. I thought I could use `\dontrun{}`, but that one is not accepted outside @examples. Maybe I have missed some trick, but I tried a few "newline" variants. – Dieter Menne Jun 12 '13 at 10:01
  • 1
    This may be the same issue I ran into [here](http://stackoverflow.com/q/14041601/271616). – Joshua Ulrich Jun 12 '13 at 11:39
  • You are right; I remember having read that, but I did not make the connection. – Dieter Menne Jun 12 '13 at 12:53

1 Answers1

3

UPDATE: Wrapping is now turned off by default in roxygen2, so this should not be an issue anymore.

I have invented a new comment syntax for roxygen2 that will preserve wrapping: Comments starting with

#''

are not wrapped at all. My reference implementation hasn't received much attention yet, though...

Of course, turning off wrapping altogether is also a way to handle the problem, but I wonder how the help looks like in a command-line terminal if the developer forgets to wrap her roxygen comments... There must have been a reason why wrapping was introduced in the first place.

krlmlr
  • 25,056
  • 14
  • 120
  • 217
  • Great. Do you know if this will carry over to RStudio etc.? I do not know the exact chain of command to make it work. – Dieter Menne Jul 15 '13 at 13:13
  • @DieterMenne: Install from my feature branch using `install_github('roxygen', 'krlmlr', ref='80-preformatted')` and see if it works for you. You can always get back to "original" roxygen2 with `install.package` or `install_github('roxygen', 'klutometis')`. – krlmlr Jul 15 '13 at 13:15
  • @DieterMenne: Glad to hear this. Care to comment on the [pull request](https://github.com/klutometis/roxygen/pull/129), too? – krlmlr Jul 16 '13 at 14:18