Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: formatting results


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: formatting results
Date   Sat, 23 Oct 2004 09:10:31 -0400

On Oct 23, 2004, at 2:33 AM, Philippe wrote:

First, open a
(temporary) smcl log file and use standard Stata commands to output the
table you want to export (e.g. with things like -estimates table-,
- -tabdisp-, -table-, -tabulate-, etc.). Close the temporary log file. In a
second step, use -file- (and a variety of string functions) to process the
fragment of log-file created (that's only simple ASCII file processing) and
export the result as LaTeX code (or any other mark-up language such as
html). The whole process is obviously best packaged in a single programme.
That is exactly the approach followed by -log2html- of Baum/Cox/Rising on SSC. Anyone who wishes to tinker is free to use it as a model to create a formatter that creates LaTeX rather than HTML.

StataCorp also provides a similar facility in their -sj- set of tools for Stata Journal articles (freely downloadable from the Stata Journal website). That is,

sjlog using foo, replace
commands...
sjlog close, replace

will create foo.log.tex (see any SJ article which has an example of Stata output included for a sample of this).

It is much easier to do this sort of transformation into LaTeX, since it is an ASCII markup language like HTML, XML, etc. and the files created can be automatically included in a document (requiring no manual copy/paste steps).

Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index