rtexroxygen2roxygen

Include TeX in Roxygen comments


I want to use TeX in Roxygen comments.

E.g.,

#' @title   $f(y|\theta)$
#'
#'@description  
#'
#'  \begin{eqnarray*}
#'         a + b &=& c \\
#'         a + b &=& c \\
#'         \theta &=& \beta \\
#'  \end{eqnarray*}
#'
#'
#'@references  
#'@param  
#'@importFrom 
#'@seealso  
#'@inheritParams  

Is there some methods such that the PDF manual reflects TeX scripts in Roxygen comments .


Solution

  • Use eqn for inline equations: \eqn{f(x|theta)}. See here about how to document an inline equation for PDF, HTML and ASCII.

    Use deqn for equations in blocks. I don't think that the environment eqnarray is available, but the array environment is available:

    \deqn{\begin{array}[ccc] a + b &=& c \\ a + b &=& c \\ \theta &=& \beta \end{array}}