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

st: Re: formatting results

From   Kit Baum <[email protected]>
To   [email protected]
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
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

* For searches and help try:

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