Skip to content
Prev 61672 / 63421 Next

Rd macros are not expanded inside of \eqn{} or \deqn{}

A description of the format is given in this document:

   https://developer.r-project.org/parseRd.pdf

As far as I know that document is still up to date.  As it says in Table 
3, \eqn and \deqn take "Verbatim" arguments.  That mode is described in 
the introduction to Section 2; it contains text and comments, so by 
design no macros are expanded.

I think it's unlikely that this would change.  The problem is that the 
equation markup can contain LaTeX macros.  So the parser would have to 
have a new mode where it distinguished between LaTeX macros and Rd 
macros.  But then how would you write true verbatim text, where you're 
trying to discuss the macros?  It gets complicated very quickly.

What you could conceivably do is write your own macro that passed its 
content to R code that expanded your user-defined macros. It sounds 
complicated, and would probably be hard to get right.

Duncan Murdoch
On 12/06/2023 1:55 p.m., Mikael Jagan wrote: