Hi Rrof. Goulet,
Thank you very much for sharing the function.
It works.
Now I noticed that the return value of commandArgs() inside Rnw with
ess includes a working Rnw file name.
\begin{Schunk}
\begin{Sinput}
> commandArgs()
\end{Sinput}
\begin{Soutput}
[1] "/usr/lib/R/bin/exec/R"
I'm not sure this is what you're looking for, but here goes. I have been using
the following function for a number of years to extract the name of the file
from which Sweave is called.
###
### getSourceName()
###
## Extract the name of the file used in the command 'Sweave' calling
## this func