Title

img -- captures and imports images and graphs into the dynamic document. This command belongs to Weaver package but it also supports the
MarkDoc package. This document only describes txt in Weaver package.
For using the command in MarkDoc package,
read the MarkDoc manual.

Syntax

Import graphical files in the dynamic document

img [using filename] [, title(str) width(int) height(int) left center ]

Automatically include the current graph from Stata in the dynamic document

img [, title(str) width(int) height(int) left center ]

Description

The img command imports images and graphs into the dynamic document.
Any graphical file that is compatible with a web-browser can be inserted in the
html log. This command belongs to Weaver package but it also supports the
MarkDoc package. The syntax for both packages is the same but
the img command behave differently based on which of the packages is in use.
If Weaver html log and smcl log are open at the same time, the command
only functions for Weaver and not for MarkDoc. In contrast, when Weaver html log is
not open and scml log is on, it will function for MarkDoc package.

Options

tittle(str) specify a header string (title) for the figure

width(int) define the width of the figure. This option must be used
with hight(int) option. Otherwise, it will keep the actual hight of the
figure and only changes the width.

hight(int) define the hight of the figure. This option must be used
with width(int) option for the same reason mentioned above.

left this option is the default and it aligns the figure to the
left-side of the dynamic document.

left aligns the figure to the center of the dynamic document.

Examples

You have created a graph in Stata. Before importing in the HTML log, you should
export it in a format that can be interpreted in html. Such as PNG which is recommended
because it is lossless format and the same file can be used for publication.

. sysuse auto
. histogram price
. graph export price.png, replace

. img using price.png
. img using price.png, title("Histogram of the Price variable")
. img using price.png, w(300) h(200) center

Alternatively, the image can be obtained from Stata automatically

. histogram mpg
. img, title("Histogram of the MPG variable")

Author

E. F. Haghish

Center for Medical Biometry and Medical Informatics

University of Freiburg, Germany

and

Department of Mathematics and Computer Science

University of Southern Denmark

haghish@imbi.uni-freiburg.de

Weaver Homepage

Package Updates on Twitter

This help file was dynamically produced by MarkDoc Literate Programming package