Title

Output destination and details

Syntax

out([destination] [, sub-options])

where destination is one of:

results

viewer

html file

html page

mata

Description

out() specifies where the output from its command appears, along with a few related details.

Sub-options are described with each destination, and general style sub-options after that.

Destination: results

results is an optional specification; when no destination is specified, output is to the Results window as usual.

Destination: viewer

viewer sends the output to a Viewer tab.

sub-options

name(which) specifies which viewer tab to use. If which is a valid stata name, output will go to that viewer (opening one of that name if necessary).
Otherwise, if which is a valid file-path, output will be saved to the specified file, and then displayed in a viewer named with the file name.

append specifies that the current output be appended to a viewer window, instead of overwriting it. This will always work with the most recently used tab;
however, to append to 'older' tabs, they must have been (and continue to be) specified with file-paths, rather than names.

Destination: html file

html file sends the output to an html file on disk, and displays the file in a browser (eg, Firefox, IE).

sub-options

email specifies a special, self-contained, format (ie, html <pre>) that can be cut & pasted from the browser into (html) email with formatting/appearance intact.

title(), revision(), and description() each provide text for pre-defined field that will display at the top of the page.

saving(filepath) specifies where to save the output file. When it is not specified, the file is saved (as _html.html) in the settings directory.

ms specifies a special format that enables Word, Excel, etc. to recognize and retain the html formatting.

You can set up ms to open files directly in Word or Excel instead of a browser: Along with ms, specify saving(), and include a custom file extension in the filepath.
The extension will be remembered and used by default whenever ms is specified.
With the proper OS fiddling to recognize the extension, the files will open in Word or Excel instead of a browser, whenever ms is specified.

Destination: html page

html page sends the output to the currently selected html page (and div) in memory. See html.

Destination: mata

mata sends the output (as a text string) to a Mata variable. By default, the text is formatted as smcl.

sub-options

variable(name) is mandatory; it is the name of the mata variable to receive the output.

html specifies formatting the text as standard html, instead of smcl.

email specifies formatting the text as html <pre>, instead of smcl.

Style sub-options

scheme(name) selects a set of styles (eg, fonts, colors, lines), defined and managed through the elfs command.

There is always a default scheme, used when none is specified, and it can also be defined with the elfs command.

styles(defs|file) defines individual additions to, or replacements for, the scheme:

o- defs are style definitions typed directly in the option.

o- file is a path to a text file containting style definitions.

For html text, the definitions are standard CSS. For email or smcl, the class names and attributes differ as they do for schemes, as described in elfs.

An html example: You could - one way or another - make use of the style-name superbig in your output.
Then you could define the style in the out option:

out(htm, styles(.superbig 300%))