#
# fix_print_html.lib
#
# Dan Scott /
# Ferg /
#
# Used to prepare single-file HTML variant for PDF/Postscript creation
# thru htmldoc.
#
# log:
# 16Oct2000 - initial entry
# 03Apr2001 - fix for
#
#
sub fix_print_html {
my($in,$out,$ttl) = @_;
open(IN_FILE, "< $in") || do {
print "fix_print_html: cannot open $in: $!\n";
return 0;
};
my($buf,$ttl_buf) = '';
my($indx) = -1;
my($is_article) = 0;
while() {
if( $indx == 1 ) {
# ignore everything until we see the chapter or sect
#
if( $_ =~ /CLASS="CHAP/i || $_ =~ /CLASS="PREF/i ) {
$buf .= $_;
$indx++;
} elsif( $_ =~ /CLASS="SECT/ || $_ =~ /CLASS="sect/ ) {
$buf .= $_;
$indx++;
$is_article = 1;
} else {
next;
}
} elsif( $indx == 0 ) {
# write out the title page file
#
if( $_ =~ /CLASS="TOC"/ ) {
$ttl_buf .= ">\n