{smcl} {hline} help for {cmd:htmlutil}{right:(Roger Newson)} {hline} {title:Utilities for writing Hypertext Markup Language (HTML) files} {pstd} Open a HTML file {p 8 21 2} {cmd:htmlopen} {it:handle} {cmd:using} {help filename:{it:filename}} [ , {cmd:replace} {cmdab:at:tributes}{cmd:(}{it:attributes_list}{cmd:)} {break} {cmdab:he:ad} {cmdab:heada:ttributes}{cmd:(}{it:head_attributes_list}{cmd:)} {cmdab:ti:tle}{cmd:(}{it:string}{cmd:)} {cmdab:headf:rom}{cmd:(}{help filename:{it:filename}}{cmd:)} {break} {cmdab:bo:dy} {cmdab:bodya:ttributes}{cmd:(}{it:body_attributes_list}{cmd:)} {break} {opt bom(bom_option)} {break} ] {pstd} {pstd} where {it:attributes_list} is a list of attributes for the {cmd:} tag in HTML, {it:head_attributes_list} is a list of attributes for the {cmd:
} tag in HTML, {it:body_attributes_list} is a list of attributes for the {cmd:} tag in HTML, {it:handle} is a {help file:file handle} as recognized by the {helpb file} utility, and {it:bom_option} can be an empty string or {cmd:utf-8}. {pstd} Insert an image in an open HTML file {p 8 21 2} {cmd:htmlimg} {it:handle} [ , {cmdab:at:tributes}{cmd:(}{it:attributes_list}{cmd:)} ] {pstd} where {it:attributes_list} is a list of attributes for the {cmd:}{p_end} {p 8 12 2}{cmd:. Hello, World!!!!}{p_end} {p 8 12 2}{cmd:.
}{p_end} {p 8 12 2}{cmd:. }{p_end} {p 8 12 2}{cmd:. END_OF_HTML}{p_end} {p 8 12 2}{cmd:. {c )-}}{p_end} {p 8 12 2}{cmd:. htmlclose `handle1'}{p_end} {pstd} The following example generates a document {cmd:mydoc2.htm}, which contains a HTML table of the mileages and weights of the 22 non-American cars in the {cmd:auto} data. This table is generated using the {helpb listtab} package, downloadable from {help ssc:SSC}. The rest of the HTML is generated using the {helpb tfinsert} package. {p 8 12 2}{cmd:. sysuse auto, clear}{p_end} {p 8 12 2}{cmd:. keep if foreign==1}{p_end} {p 8 12 2}{cmd:. tempname handle2}{p_end} {p 8 12 2}{cmd:. htmlopen `handle2' using "mydoc2.htm", attributes(lang=en-US) replace}{p_end} {p 8 12 2}{cmd:. capture noisily {c -(}}{p_end} {p 8 12 2}{cmd:. tfinsert `handle2', terminator(END_OF_HTML)}{p_end} {p 8 12 2}{cmd:. }{p_end} {p 8 12 2}{cmd:.Make | Mileage (mpg) | Weight (lb) |
---|
View the .pdf version of this image
")}{p_end} {p 8 12 2}{cmd:. listtab make mpg weight, handle(`handle3') rstyle(html) head("Make | Mileage (mpg) | Weight (lb) |
---|
Make | Mileage (mpg) | Weight (lb) |
---|