4

It’s common to want to use grammatical characters like the curly apostrophe in "It’s" in R help files.

Using a regular single quote ' ) is not a great solution as ' is used in roxygen line openings (#') and to quote strings (which leads syntax-highlighting in text editors to break (not in the .Rd file).

What doesn't work

  1. You can't just paste in unicode.
    • CRAN doesn't allow any non-ascii characters in packages for portability.
  2. You can't use encoded unicode, e.g. \u2019
    • This renders as raw string.
  3. You can't use &-escaped html codes.
    • ’ renders as raw code in the help :-(

So: Are there solutions to including an apostrophe in Rd files?

tim
  • 3,559
  • 1
  • 33
  • 46
  • I don't follow. Code is marked as `\code` in Rd files. What kind of syntax highlighting issues are you experiencing when using a single quote? – Roland Apr 05 '17 at 12:45
  • 1
    Also, it is possible to use utf8 encoding in your help files. However, CRAN does not like that very much due to portability issues. I don't even write my name with the correct non-ascii letters in my packages for that reason. – Roland Apr 05 '17 at 12:48
  • hmm. There's another question on SO somewhere about UTF-8 encoding in .Rd files but I can't find it at the moment ... – Ben Bolker May 29 '17 at 00:52

0 Answers0