I'm in the process of documenting some of my functions for an R package I'm making.
I'm using roxygen markup, though that is largely irrelevant to my question.
I have put equations into my documentation using \deqn{...}
. My question is:
Is there a way to cross-reference this equation later on?
For example, in my Rd file:
\deqn{\label{test}
y = mx + b
}
Can I later do something like:
Referring to equation \ref{test}, ...
I've tried \eqref{test}
, \ref{test}
(which both get "unknown macro" and don't get linked ), and also \link{test}
(which complains it can't find function test
because it's really just for linking to other functions).
Otherwise I fear I may have to do something hacky and add in the -- (1)
and Refer to equation (1)
manually within the \deqn
etc in the Rd file...
Update
General answer appears to be "no". (awww...)
However, I can write a vignette and use "normal" 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 ?myFunction
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.
@Iterator has pointed out the existence of conditional text, so I'll do ASCII maths in the .Rd files, but Latex maths in the pdf manual/vignette.