title: R include "#" in R manual hyperref
body: <p>I am attempting to include a hyperref link in R documentation using roxygen2 and devtools in a repo.  <a href="https://github.com/trinker/dummy" rel="nofollow">Here's a dummy version</a>.</p>
  
  <pre><code>#' Test
  #' 
  #' Test 2
  #' 
  #' @param x An object
  #' @section Suggestion: Looky here: 
  #' \enumerate{ 
  #'   \item{\bold{Item 1} - Foo}
  #'   \item{\bold{Item 2} - Bar:  
  #'   \href{https://github.com/hakimel/reveal.js/#installation}{click me}}   
  #' }
  #' @export 
  test &lt;- function(x = "test") {
      print(x)
  }
  </code></pre>
  
  <p>I run </p>
  
  <pre><code>library(roxygen2)
  roxygenize("C:/Users/trinker/GitHub/dummy")
  </code></pre>
  
  <p>And then in R studio use check and out pops this error:</p>
  
  <pre><code>* checking PDF version of manual ... WARNING
  LaTeX errors when creating PDF version.
  This typically indicates Rd problems.
  LaTeX errors found:
  ! Illegal parameter number in definition of \Hy@tempa.
  &lt;to be read again&gt; 
                     i
  l.61 me}
  
  ! Illegal parameter number in definition of \Hy@tempa.
  &lt;to be read again&gt; 
                     i
  l.61 me}
  
  ! Illegal parameter number in definition of \Hy@tempa.
  &lt;to be read again&gt; 
                     i
  l.61 me}
  
  * checking PDF version of manual without hyperrefs or index ... ERROR
  
  Exited with status 1.
  
  
  
  
  Files
  Plots
  Help
  
  
  
  
  New Folder
  
  
  Delete
  
  
  Rename
  
  
  More
  
  
  
  
  C:  Users   trinker GitHub  dummy   R
  
  
  Name
  Size    Modified
  
  ..
  
  
  dummy-package.R
  109 bytes
  May 31, 2013, 12:51 PM
  
  
  test.R
  324 bytes
  May 31, 2013, 12:56 PM
  
  
  ConsoleC:/Users/trinker/GitHub/dummy/
  </code></pre>
  
  <p>SO I escape the <code>#</code> and it runs:</p>
  
  <pre><code>#' Test
  #' 
  #' Test 2
  #' 
  #' @param x An object
  #' @section Suggestion: Looky here: 
  #' \enumerate{ 
  #'   \item{\bold{Item 1} - Foo}
  #'   \item{\bold{Item 2} - Bar:  
  #'   \href{https://github.com/hakimel/reveal.js/\#installation}{click me}}   
  #' }
  #' @export 
  test &lt;- function(x = "test") {
      print(x)
  }
  </code></pre>
  
  <p><a href="https://dl.dropboxusercontent.com/u/61803503/dummy.pdf" rel="nofollow">PDF looks good</a> and hypref works.  But then if I do:</p>
  
  <pre><code>library(dummy)
  ?dummy::test
  </code></pre>
  
  <p>The hyperef <code>click me</code> is broke and results in:</p>
  
  <pre><code>https://github.com/hakimel/reveal.js//#installation
  </code></pre>
  
  <p>Rather than:</p>
  
  <pre><code>https://github.com/hakimel/reveal.js/#installation
  </code></pre>
  
  <p>As produced by the pdf (LaTeX link).</p>
  
  <p>How can I appropriately escape the pound sign (<code>#</code>) so both the pdf and html documentation heyperlinks work?</p>
  
  <p>I put the devtools and roxygen2 tags on but I don't think they're relevant to this problem.</p>
  
  <p>Session info as requested:</p>
  
  <pre><code>&gt; sessionInfo()
  R version 3.0.0 (2013-04-03)
  Platform: i386-w64-mingw32/i386 (32-bit)
  
  locale:
  [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
  [4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] dummy_0.1.0
  
  loaded via a namespace (and not attached):
  [1] tools_3.0.0
  </code></pre>