nrao nrao
next up previous contents index home.gif
Next: Index Up: B. NRAO customization of LATEX2HTML Previous: B..1 Option to use l2h.ini as the initialization

B..2 Option to emit NRAO-standard web pages

When using LATEX2HTML to publish documents on the NRAO web pages, it is useful if the HTML output incorporates the standard NRAO server-side includes so that it conforms to the observatory's uniform web style. I therefore modified the LATEX2HTML installation input script latex2html.pin for use at the NRAO as follows:

Just before the standard line

join("\n", (($DOCTYPE)? $DTDcomment : '' )

at line 7013, add the following:

#   insert NRAO style and banners if requested
    if ($NRAO) {$DTDcomment = "<!--#include virtual=\"/nrao-header.html\"-->"};
    if ($NRAO) {$begin_head = "-->\n<TITLE>"} 
    else {$begin_head = " -->\n<HTML>\n<HEAD>\n<TITLE>"};
    if ($NRAO) {$end_head = "<!--#include virtual=\"/nrao-banner.html\"-->"} 
    else {$end_head = "</HEAD>"};
    if ($NRAO) {$begin_foot = "<!--#include virtual=\"/nrao-trailer.shtml\"-->\n"} 
    else {$begin_foot=""};
    if ($NRAO) {$end_foot = "<!--#include virtual=\"/nrao-end.html\" -->\n"} 
    else {$end_foot = "\n</BODY>\n</HTML>\n"};

and modify the join segment (at line 7024 in the revised file) to read

    join("\n", (($DOCTYPE)? $DTDcomment : '' )
	,"<!--Converted with LaTeX2HTML $TEX2HTMLVERSION"
	, "original version by:  Nikos Drakos, CBLU, University of Leeds"
	, "* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan"
	, "* with significant contributions from:"
	, "  Jens Lippmann, Marek Rouchal, Martin Wilck and others"
	, "  including NRAO-specific modifications by Alan Bridle"
	$begin_head.$title."</TITLE>"                # NRAO mod 
	, &meta_information($title)
	,  ($CHARSET && $HTML_VERSION ge "2.1" ? 
	"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=$this_charset\">" 
	 : "" )
	, $LATEX2HTML_META
	, ($BASE ? "<BASE HREF=\"$BASE\">" : "" )
	, $STYLESHEET_CASCADE
	, ($STYLESHEET ? "<LINK REL=\"STYLESHEET\" HREF=\"$STYLESHEET\">" : '' )
	, $more_links_mark
	, $end_head , ($before_body? $before_body : '')   # NRAO mod 
	, "<BODY $body>", '');

Modify the make_real_address routine at line 746 in the revised file to read

sub make_real_address {
    local($addr) = $ADDRESS;
    if ((defined &custom_address)&&($addr)) {
	&custom_address($addr)
    } elsif ($addr) {
	$begin_foot."<ADDRESS>\n$addr\n</ADDRESS>";   # NRAO mod 
    } else { '' }
}

Modify the make_address routine at line 7139 in the revised file to read

sub make_address { 
    local($addr) = &make_real_address(@_);
    $addr .= $end_foot;                           # NRAO mod 
    &lowercase_tags($addr) if $LOWER_CASE_TAGS;
    $addr;
}

Modify the make_file routine at line 8442 in the revised file to read

sub make_file {
    # Uses and modifies $_ defined in the caller
    local($filename, $title, $layout) = @_;
    $layout = $BODYTEXT unless $layout;
    $_ = join('',&make_head_and_body($title,$layout), $_
	, (($filename =~ /^\Q$footfile\E$/) ? '' : &make_address )
	, (($filename =~ /^\Q$footfile\E$/) ? $end_foot : '')        # NRAO mod 
	);
    &replace_markers unless ($filename eq $footfile); 

    unless(open(FILE,">$filename")) {
        print "\nError: Cannot write '$filename': $!\n";
        return;
    }
    print FILE $_;
    close(FILE);
}

Note that if you did not get your copy of LATEX2HTML from the NRAO toolkit, you can add this NRAO option to your local copy after it has been installed, by directly editing these changes into your own latex2html.bat.

These NRAO-specific options can then be turned on by setting the variables

$NRAO = 1;
$ALLOW_SSI = 1;

in the initialization file. The first activates the added options, and the second tells LATEX2HTML to write out files with .shtml extensions that will invoke the server-side includes when installed on an NRAO web server.

Setting

$NRAO = 0;
$ALLOW_SSI = 0;

in the initialization file will revert to the default (i.e., non-NRAO-specific) LATEX2HTML output.


next up previous contents index home.gif
Next: Index Up: B. NRAO customization of LATEX2HTML Previous: B..1 Option to use l2h.ini as the initialization


Home | Contact Us | Directories | Site Map | Help | Search


2001-04-18