Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: st: file names in esttab, style(tex)

From   Christopher Baum <>
To   "" <>
Subject   re: st: file names in esttab, style(tex)
Date   Tue, 24 Jan 2012 15:38:25 -0500

I wonder if there is a way to print the do-file file name (and
possibly the date) as a comment on a tex file outputted by esttab
(available from ssc). That is, it would be wonderful if the generated
tex file started with a (tex) comment, such as

% file generated by in DD/MM/YYYY

For example, the equivalent function in R does exactly this. If any
one has any idea on how to pass this to esttab, I'd be thankful if you
could share it. If not, here's a suggestion for future versions of

I don't believe this is really an esttab (Jann, SSC) issue. To my knowledge a do-file does not know its own name, in the sense that nowhere
among the creturns is the name of the file that appeared in the last do... command (or equivalent, e.g., click on 'run' in the GUI). You can determine
the current working directory, and the name of the current datafile loaded into memory (if it exists), but I don't believe that you can recover the 
name of the do-file from within that file.

I could be wrong, of course, and I'm sure Stata developers will clarify if I am.


Kit Baum   |   Boston College Economics and DIW Berlin   |
An Introduction to Stata Programming   |
An Introduction to Modern Econometrics Using Stata   |

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index