[R-pkg-devel] Macros in Rd files --- supplementary question ...
On 09/11/2017 3:29 PM, Rolf Turner wrote:
... Mr. Speaker. On 09/11/17 23:40, Duncan Murdoch wrote:
On 09/11/2017 5:06 AM, Uwe Ligges wrote:
Note the % may be a comment?
Yes, and the body should be written in Rd markup, not R.? Working out
the appropriate number of escapes is painful; I recommend trial and error.
This worked for me:
?\newcommand{\today}{\Sexpr{format(Sys.Date(),"\\\%d/\\\%m/\\\%Y")}}
Did that, and it worked like a charm. However when I do the "R CMD build" thing, when it comes to the "* building the PDF package manual" step it says "Hmm ... looks like a package" (no shit, Sherlock!) and emits a huge amount of verbose LaTeX diagnostics. "Normally" one just gets the line "* building the PDF package manual" and nothing else, and "R CMD build" just carries on cruising. Evidently defining a macro in the *.Rd file triggers the extra elaboration. It's no big deal of course, but I just thought I'd ask: (a) Is there anything to worry about in this respect?
Of course, never ignore diagnostics. Worry about every line that was printed!
(b) Is there anything different that I should be doing?
Sounds like it...
(c) Is there anyway of suppressing the (ever-so-slightly annoying) extra screen output?
Oooh, that's such a bad idea. Don't do that. Fix the problem that led to the output. Duncan
I guess that's really three supplementary questions .... Thanks for any pointers. cheers, Rolf