help for dotex (Roger Newson)

Execute commands from a file, creating a log file in SJ LaTeX

dotex filename [ arguments ] [ , nostop ]

Description

dotex causes Stata to execute the commands stored in filename
as if they were entered from the keyboard, and echoes the commands as it
executes them, creating a log file filename.tex in Stata Journal (SJ) LaTeX.
The LaTeX log file (or parts of it) can then be included in a SJ LaTeX file
(eg a SJ submission), using the SJ LaTeX stlog environment.
If filename is specified without an extension, filename.do is assumed.
If filename is specified with an extension, then the log file will have .log
as an additional extension (so dotex will not overwrite the original do-file).
Arguments are allowed (as with do or run).

Options

nostop allows the do-file to continue executing even if an error occurs.
Normally, Stata stops executing the do-file when it detects an error
(nonzero return code).

Remarks

dotex is adapted from dolog, which creates a generic text log file
instead of a SJ LaTeX file.
One do-file can be run
with either dotex, dolog or do,
creating, respectively, a SJ LaTeX log, a generic text log or no log.
Further information on SJ LaTeX can be found at the
SJ website.
Note that it is usually sensible to include a version statement
at the start of a do-file to be executed by do, dolog or dotex,
so that the do-file will be executed in the Stata version specified,
instead of being executed by the Stata version
of the current version of Stata, dolog or dotex.

dotex is similar to the sjlog do command of official Stata.
Both of these commands work by creating an intermediate SMCL log file,
and then creating a version of this intermediate file translated to SJ LaTeX.
However, dotex does not save the intermediate SMCL log file,
and does report the date and time when this intermediate log file was opened and closed.

dotex works under version control. As in:

. version 15: dotex example1

However, for most do-files other than certification scripts,
it is a good idea to set the Stata version using a version statement
inside the do-file to be executed using dotex.

Examples

. dotex example1

. dotex example1 argone argtwo

Author

Roger Newson, King's College London, UK.

Email: roger.newson@kcl.ac.uk

Also see

Manual: [R] do, [R] doedit, [R] log, [P] version, [P] smcl

Help: sjlatex, sjlog, [R] do, [R] run, [R] doedit, [R] log, [P] version, [P] smcl;

dolog if installed