title: How to cross-reference an equation in an R help file/roxygen2
body: <p>I'm in the process of documenting some of my functions for an R package I'm making.</p>
  <p>I'm using roxygen markup, though that is largely irrelevant to my question.</p>
  <p>I have put equations into my documentation using <code>\deqn{...}</code>. My question is:
  <strong>Is there a way to cross-reference this equation later on?</strong></p>
  <p>For example, in my Rd file:</p>
  <pre><code>\deqn{\label{test}
   y = mx + b
  }
  </code></pre>
  <p>Can I later do something like:</p>
  <blockquote>
  <p>Referring to equation \ref{test}, ...</p>
  </blockquote>
  <p>I've tried <code>\eqref{test}</code>, <code>\ref{test}</code> (which both get &quot;unknown macro&quot; and don't get linked ), and also <code>\link{test}</code> (which complains it can't find function <code>test</code> because it's really just for linking to other functions).</p>
  <p>Otherwise I fear I may have to do something hacky and add in the <code>-- (1)</code> and <code>Refer to equation (1)</code> <em>manually</em> within the <code>\deqn</code> etc in the Rd file...</p>
  <h1>Update</h1>
  <p>General answer appears to be &quot;no&quot;. (awww...)</p>
  <p>However, I can write a vignette and use &quot;normal&quot; latex/packages there. In any case, I've just noticed that the matrix equations I spent ages putting into my roxygen/Rd file look awful in the <code>?myFunction</code> version of the help (they show up as just-about literal latex source). Which is a shame, because they look beautiful in the pdf version of the help.</p>
  <p>@Iterator has pointed out the existence of <a href="http://cran.r-project.org/doc/manuals/R-exts.html#Conditional-text" rel="noreferrer">conditional text</a>, so I'll do ASCII maths in the .Rd files, but Latex maths in the pdf manual/vignette.</p>