#LaTeX2HTML Version 96.1 : dot.latex2html-init -*- perl -*-
#
# Significantly revised by Fred L. Drake, Jr. \n
\n";
$VERBOSITY = 0;
# default # of columns for the indexes
$INDEX_COLUMNS = 2;
$MODULE_INDEX_COLUMNS = 4;
# A little painful, but lets us clean up the top level directory a little,
# and not be tied to the current directory (as far as I can tell).
#
use Cwd;
use File::Basename;
($myname, $mydir, $myext) = fileparse(__FILE__, '\..*');
chop $mydir; # remove trailing '/'
$mydir = getcwd() . "$dd$mydir"
unless $mydir =~ s|^/|/|;
$LATEX2HTMLSTYLES = "$mydir$envkey$LATEX2HTMLSTYLES";
push (@INC, $mydir);
($myrootname, $myrootdir, $myext) = fileparse($mydir, '\..*');
chop $myrootdir;
# Hackish way to get the appropriate paper-*/ directory into $TEXINPUTS;
# pass in the paper size (a4 or letter) as the environment variable PAPER
# to add the right directory. If not given, the current directory is
# added instead for use with HOWTO processing.
#
if (defined $ENV{'PAPER'}) {
$mytexinputs = "$myrootdir${dd}paper-$ENV{'PAPER'}$envkey";
}
else {
$mytexinputs = getcwd() . $envkey;
}
$mytexinputs .= "$myrootdir${dd}texinputs";
sub custom_driver_hook{
#
# This adds the directory of the main input file to $TEXINPUTS; it
# seems to be sufficiently general that it should be fine for HOWTO
# processing.
#
my $file = @_[0];
my($jobname,$dir,$ext) = fileparse($file, '\..*');
$dir = make_directory_absolute($dir);
$dir =~ s/$dd$//;
$TEXINPUTS = "$dir$envkey$mytexinputs";
print "\nadding $dir to \$TEXINPUTS\n";
}
sub set_icon_size{
my($name, $w, $h) = @_;
$iconsizes{$name} = "width=$w height=$h";
}
foreach $name (split(/ /, 'up next previous contents index modules blank')) {
set_icon_size($name, 32, 32);
}
# The '_motif' is really annoying, and makes the HTML larger with no value
# added, so strip it off:
foreach $name (keys %icons) {
my $icon = $icons{$name};
# Strip off the wasteful '_motif':
$icon =~ s/_motif//;
# Change the greyed-out icons to be blank:
$icon =~ s/[a-z]*_gr/blank/;
$icons{$name} = $icon;
}
$icons{'blank'} = 'blank.' . $IMAGE_TYPE;
$CUSTOM_BUTTONS = '';
$BLANK_ICON = "\n" . img_tag('blank.' . $IMAGE_TYPE) . " ";
$BLANK_ICON =~ s/alt="blank"/alt=""/;
$NAV_BGCOLOR = " bgcolor=\"#99CCFF\"";
sub make_nav_sectref{
my($label,$title) = @_;
if ($title) {
return ("$label: "
. "$title\n");
}
return '';
}
sub make_nav_panel{
my $s;
$s = ""
. "\n
"
#. ""
. "\n $NEXT "
. "\n$UP "
. "\n$PREVIOUS "
. "\n"
. "\n $t_title "
. ($CONTENTS ? "\n$CONTENTS " : $BLANK_ICON)
. "\n$CUSTOM_BUTTONS " # module index
. ($INDEX ? "\n$INDEX " : $BLANK_ICON)
. "\n
"
. make_nav_sectref("Next", $NEXT_TITLE)
. make_nav_sectref("Up", $UP_TITLE)
. make_nav_sectref("Previous", $PREVIOUS_TITLE);
$s =~ s/ NAME="tex2html\d+"\n//g;
return $s;
}
sub top_navigation_panel {
" ';
}
sub bot_navigation_panel {
"
' . make_section_heading($idx_module_title, "h2") . $idx_module_mark . $_; } # The bibliography and the index should be treated as separate sections # in their own HTML files. The \bibliography{} command acts as a sectioning command # that has the desired effect. But when the bibliography is constructed # manually using the thebibliography environment, or when using the # theindex environment it is not possible to use the normal sectioning # mechanism. This subroutine inserts a \bibliography{} or a dummy # \textohtmlindex command just before the appropriate environments # to force sectioning. # XXX This *assumes* that if there are two {theindex} environments, the # first is the module index and the second is the standard index. This # is sufficient for the current Python documentation, but that's about # it. sub add_bbl_and_idx_dummy_commands { my $id = $global{'max_id'}; s/([\\]begin\s*$O\d+$C\s*thebibliography)/$bbl_cnt++; $1/eg; s/([\\]begin\s*$O\d+$C\s*thebibliography)/$id++; "\\bibliography$O$id$C$O$id$C $1"/geo #if ($bbl_cnt == 1) ; #} #---------------------------------------------------------------------- # (FLD) This was added my(@parts) = split(/\\begin\s*$O\d+$C\s*theindex/); if (scalar(@parts) == 3) { # Be careful to re-write the string in place, since $_ is *not* # returned explicity; *** nasty side-effect dependency! *** print "\nadd_bbl_and_idx_dummy_commands ==> adding module index"; my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex[\\s\\S]*)" . "([\\\\]begin\\s*$O\\d+$C\\s*theindex)"; s/$rx/\\textohtmlmoduleindex \1 \\textohtmlindex \2/o; # Add a button to the navigation areas: $CUSTOM_BUTTONS .= ("" . img_tag('modules.'.$IMAGE_TYPE) . ""); } else { $CUSTOM_BUTTONS .= img_tag('blank.' . $IMAGE_TYPE); $global{'max_id'} = $id; # not sure why.... s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o; s/[\\]printindex/\\textohtmlindex /o; } #---------------------------------------------------------------------- lib_add_bbl_and_idx_dummy_commands() if defined(&lib_add_bbl_and_idx_dummy_commands); } # The bibliographic references, the appendices, the lists of figures and tables # etc. must appear in the contents table at the same level as the outermost # sectioning command. This subroutine finds what is the outermost level and # sets the above to the same level; sub set_depth_levels { # Sets $outermost_level my $level; #RRM: do not alter user-set value for $MAX_SPLIT_DEPTH foreach $level ("part", "chapter", "section", "subsection", "subsubsection", "paragraph") { last if (($outermost_level) = /\\($level)$delimiter_rx/); } $level = ($outermost_level ? $section_commands{$outermost_level} : do {$outermost_level = 'section'; 3;}); #RRM: but calculate value for $MAX_SPLIT_DEPTH when a $REL_DEPTH was given if ($REL_DEPTH && $MAX_SPLIT_DEPTH) { $MAX_SPLIT_DEPTH = $level + $MAX_SPLIT_DEPTH; } elsif (!($MAX_SPLIT_DEPTH)) { $MAX_SPLIT_DEPTH = 1 }; %unnumbered_section_commands = ('tableofcontents' => $level, 'listoffigures' => $level, 'listoftables' => $level, 'bibliography' => $level, 'textohtmlindex' => $level, 'textohtmlmoduleindex' => $level); $section_headings{'textohtmlmoduleindex'} = 'h1'; %section_commands = (%unnumbered_section_commands, %section_commands); make_sections_rx(); } # Fix from Ross Moore for ']' in \item[...]; this can be removed once the next # patch to LaTeX2HTML is released and tested ... if the patch gets included. # Be very careful to keep this around, just in case things break again! # sub protect_useritems { local(*_) = @_; local($preitems,$thisitem); while (/\\item\s*\[/) { $preitems .= $`; $_ = $'; $thisitem = $&.'<<'.++$global{'max_id'}.'>>'; s/^(((($O|$OP)\d+($C|$CP)).*\3|<[^<>]*>|[^\]<]+)*)\]/$thisitem.=$1;''/e; $preitems .= $thisitem . '<<' . $global{'max_id'} . '>>]'; s/^]//; } $_ = $preitems . $_; } # This changes the markup used for {verbatim} environments, and is the # best way I've found that ensures the
.... # # Note that this *must* be done in the init file, not the python.perl # style support file. The %declarations must be set before initialize() # is called in the main script. # %declarations = ('preform' => '