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

2023-06-12 Thread Mikael Jagan
I was a bit surprised to learn that, if one has an Rd file as below: %% zzz.Rd \newcommand{\zzz}{whatever} \name{zzz} \title{zzz} \description{ \zzz{} \eqn{\zzz{}} \deqn{\zzz{}} } then the macro is _not_ expanded inside of \eqn{} or \deqn{} when parsed to text or HTML. Is th

Re: [Rd] codetools wrongly complains about lazy evaluation in S4 methods

2023-06-12 Thread Mikael Jagan
Thanks both. Yes, I was aware of globalVariables, etc. I guess I was hoping to be pointed to the right place in the source code, in case the issue could be addressed properly, notably as it seems to have already been addressed for functions that are not S4 methods, i.e., codetools is apparently

Re: [Rd] Rd macros are not expanded inside of \eqn{} or \deqn{}

2023-06-12 Thread Duncan Murdoch
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

Re: [Rd] codetools wrongly complains about lazy evaluation in S4 methods

2023-06-12 Thread Duncan Murdoch
Most of the errors, warnings and notes generated by R CMD check are generated by code in the tools package, usually in the tools/R/QC.R source file. Search that file for the error message, then backtrack to find the code that causes it to be triggered. If I recall correctly, it works on the e