0

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 .

Camford Oxbridge
  • 834
  • 8
  • 21

1 Answers1

1

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}}
Stéphane Laurent
  • 75,186
  • 15
  • 119
  • 225
  • Thank you for letting me know the codes!! I did not know the script `\eqn`, which somewhat differ my intuitive, e.g., \eqn{\sigma^2} is not my desired output. but I try to use it for my PDF manual. I think direct edition of the TeX file transformed from Roxygen is one way but I do not know whether such edition is permitted or not when I upload to CRAN. REF: https://stackoverflow.com/questions/37397607/can-r-help-manuals-have-latex-math-in-them – Camford Oxbridge May 29 '19 at 09:09