UCLA Stat Computing Portal Web
Tools
ATS Stat
Computing
 

Customizing stata2htm

When you downloaded stata2htm you may have noticed that in addition to
  stata2htm.bat
  stata2htm.pl
you also downloaded
  stata2htmats.bat
  stata2htmats.pl

These additional files are the files we use at ATS for making our Stata web pages.  Our pages include headers at the top that display our toolbar of buttons, and our pages include custom footers at the bottom.  Instead of manually adding the toolbar at the top and footer at the bottom every time we make a page, we have included these in stata2htmats.pl so every page we create has these headers and footers, and then instead of getting a plain page we get a page with our headers and footers.  

You can look at stata2htmats.pl and see where we have added these headers and footers, and you can make your own custom copy of stata2htm.pl and stata2htm.bat that include your own custom headers and footers. Here are some examples of stata2htm.pl that you can change.


In this section you can add or change any tags that you want to appear in the <head> section of your web page.

# USER CONFIG #1, head tags, title tags, start body
print O "<html>\n\n<head>\n<title>$TITLES<\/title>\n\n";
print O "</head>\n\n";
print O "<body>\n\n";
print O "<h1 align='center'><font color='#000080'>$TITLES</font></h1>\n";
print O "\n";

In this section, you can add or change anything that you want to appear at the end of the page, such as a footer.

# USER CONFIG #2, footer
print O "\n";