# latex2html init file for the REALSIMPLE project ##############################################################################/ # # VERSION CONTROL INFORMATION: # # $Author: jos $ # # $Date: 2006-12-16 12:43:49 -0800 (Sat, 16 Dec 2006) $ # # $Rev: 84 $ # # Created 8/30/06 by jos for REALSIMPLE project (copy/edit of personal version) # ##############################################################################/ $SCALABLE_FONTS = 1; # => PK_GENERATION=1; DVIPS_MODE=""; $BOTTOM_NAVIGATION = 1; # override default $AUTO_NAVIGATION = 0; # override default $ANTI_ALIAS = 1; $STYLESHEET = "../realsimple.css"; $ICONSERVER = '../icons'; $MATH_SCALE_FACTOR = 1.6; # default = 1.6, I think $DISP_SCALE_FACTOR = 1; # extra scaling for displayed eqns (default = 1) $FIGURE_SCALE_FACTOR = 1.4; # default = 1.6 -- SEEMS TO HAVE NO EFFECT $TRANSPARENT_FIGURES = 0; # default = 1 $WHITE_BACKGROUND = 1; # default = 0 $BELOW_DISPLAY_SPACE = ""; # Inhibit

after displayed equations $DVIPS = "dvips"; $TMP = '/tmp'; # root dir for temp images $PAPERSIZE = "letter"; # ($width=612) $NO_SIMPLE_MATH = 1; # pro mode or exper mode $NO_MATH_PARSING = 1; # pro mode - apparently unused by l2h these days $WORDS_IN_NAVIGATION_PANEL_TITLES = 12; # default = 4 #FIXME: This one seems to be undocumented: $WORDS_IN_INDEX = 25; # default = 4 $SHORT_INDEX = 1; # make one-line index entries $LONG_TITLES = 4; # Up to four non-generic words of section name # STDADDRESS USAGE: # # $ADDRESS = "
\n #
\n #
\n" # . $STDADDRESS # # STDADDRESS USAGE EXAMPLE: # # $ADDRESS = " # Bandlimited Interpolation --- Introduction and Algorithm
\n # Proc., IEEE International Conference on Acoustics, Speech, # and Signal Processing, (ICASSP), San Diego, 1984.
\n" . $STDADDRESS; $STANFORDHOME = "http://www.stanford.edu"; $WGLNHOME = "http://www.wgln.org/"; $REALSIMPLEHOME = "http://ccrma.stanford.edu/realsimple"; $CCRMAHOME = "http://ccrma.stanford.edu"; $CCRMAPUBSHOME = "http://ccrma.stanford.edu/overview/publications.html"; $JOSHOME = "http://ccrma.stanford.edu/~jos"; $STANFORD = " Stanford University"; $REALSIMPLE = " REALSIMPLE"; $CCRMA = " CCRMA"; $JOS = " Julius O. Smith III"; $JOSS = " Julius Smith"; $JOSSHORT = " JOS"; $JOSEMAIL = "jos_email.html"; $CCLHOME = "http://creativecommons.org/licenses/by/2.5/"; $CCL = " Creative Commons License"; $STDUPDATENOTICE = ($RELEASE ? "Released $address_data[1] under the $CCL" : "Copyright © $address_data[1]"); sub make_updatenotice { return($STDUPDATENOTICE . ", by " . ($DOCAUTHORS ? $DOCAUTHORS : $JOS . "<" . $JOSEMAIL . ">" )); } $STDADDRESSNONAME = " Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
\"CCRMA\"\n"; $STDADDRESS = "
" . $STDUPDATENOTICE . "
\n" . $STDADDRESSNONAME; $DOCPUBINFO = "$REALSIMPLE Project — work supported by the $WGLN\n"; sub make_doc_address { $ADDRESS = "
" . ($NOHARDCOPIES? "" : "Download " . &make_doc_pdf_href . "
\n" . # Moving to PDF-only: # "Download " . &make_doc_ps_href . "
\n" . ($OFFER2UP? "Download " . &make_doc_pdf_2up_href . "
\n" # ."Download " . &make_doc_ps_2up_href . "
\n" : "") . ($OFFER4UP? "Download " . &make_doc_pdf_4up_href . "
\n" # ."Download " . &make_doc_ps_4up_href . "
\n" : "") ) . "
" . "
" . &make_docdir_href . ",\n " . # DOC TITLE "by " . $DOCAUTHORS . ($DOCPUBINFO? ",
\n " . $DOCPUBINFO : "") . ".
\n" . &make_updatenotice . "
\n" . $STDADDRESSNONAME . "
\n" . # # Javascript inclusion for tooltip support # "\n"; # PROBLEM: $BASE BREAKS FIGURE LINKS (file name becomes index.html). # However, it's needed when redirecting a URL via symlinks. # $BASE = &make_docdir_url . "index.html"; return $ADDRESS; } sub make_docdir_url { $DOCURL = ($JOSHOME . "/" . $DOCDIR . "/"); } sub make_docdir_href { # Assumes $DOCDIR, $DOCTITLE and $JOSHOME are defined $DOCHREF = "``" . $DOCTITLE . "''"; } sub make_doc_ps_href { $DOCPSHREF = " " . "compressed PostScript (" . $DOCDIR . ".ps.gz)"; } sub make_doc_ps_2up_href { $DOCPS2UPHREF = " " . "compressed PostScript `2-up' (" . $DOCDIR . "_2up.ps.gz)"; } sub make_doc_ps_4up_href { $DOCPS4UPHREF = " " . "compressed PostScript `4-up' (" . $DOCDIR . "_4up.ps.gz)"; } sub make_doc_pdf_href { $DOCPSHREF = " " . $DOCDIR . ".pdf"; } sub make_doc_pdf_2up_href { $DOCPSHREF = " " . $DOCDIR . "_2up.pdf"; } sub make_doc_pdf_4up_href { $DOCPSHREF = " " . $DOCDIR . "_4up.pdf"; } sub make_doc_stdaddress { $STDADDRESS = "
" . "Download " . &make_doc_pdf_href . &make_updatenotice . "
\n" . $STDADDRESSNONAME; } #Prv: \"CCRMA\"\n"; # -address # Supply your own string if you don't like the default # $ADDRESS = "$address_data[0]\n
$address_data[1]" # . $STDADDRESS; $ADDRESS = $STDADDRESS; $gtocfile = "../index.html"; sub common_navigation_panel { $docname = $DOCDIR . ".html"; $doctop = &make_docdir_url . $docname; $NEED_UP = $UP_TITLE; # Set when there is an 'up' (all but top level) $UP_TITLE =~ m/HREF=\"([^\"]+)\"/; #" $UP_FILE = $1; $PREVIOUS_TITLE =~ m/HREF=\"([^\"]+)\"/; #" $PRV_FILE = $1; # $PREVIOUS_TITLE is set after 1st page (when there is a 'previous') $NEED_PREVIOUS = $PREVIOUS_TITLE && ($PRV_FILE ne $docname); $NEED_DOCTOP = ($doctop !~ m!$UP_FILE$!); $NEED_DOCTOP = $NEED_DOCTOP && ($file ne "Welcome.html"); # Already here! $NEED_DOCTOP = $NEED_DOCTOP && ($file ne "index.html"); # NOT Index.html $NEED_DOCTOP = $NEED_DOCTOP && ($file ne "$DOCDIR.html"); # FIXME: Need also to disable DOCTOP when it equals current page! my $DOCTITLE_NAV = $DOCTITLE; $DOCTITLE_NAV =~ s/\s+/ /g; if ($doctop =~ m!$UP_FILE$!) { $UP_TITLE = "Doc Top"; $NEED_UP = 0; $NEED_DOCTOP = 1; # Don't need both } # If ``next'' section exists, add its title to the navigation panel #----------- Install mouseOver popup in navigation buttons: if ($NEXT_TITLE) { $NEXT_TITLE_NAV = &navLink($NEXT_TITLE,'Next'); } if ($NEED_PREVIOUS) { $PREVIOUS_TITLE_NAV = &navLink($PREVIOUS_TITLE,'Prev'); } if ($NEED_UP) { $UP_TITLE_NAV = &navLink($UP_TITLE,'Up'); } if ($INDEX_LINK) { # Must be idempotent (called twice for upper and lower nav) $INDEX_LINK =~ s!HREF="Index.html">Index! HREF="Index.html"\n onMouseover=\"return escape(\'Index: $DOCTITLE_NAV\')\">Index!; } #----------- DOIT ------------ "\n" . ($NEXT_TITLE ? "$NEXT_TITLE_NAV  | \n" : undef) . ($NEED_PREVIOUS ? "$PREVIOUS_TITLE_NAV  | \n" : undef) . ($NEED_UP ? "$UP_TITLE_NAV  | \n" : undef) . ($CONTENTS_LINK ? "Contents | \n":undef) . ($NEED_DOCTOP ? "Top  | \n" :undef) . ($INDEX_LINK ? "$INDEX_LINK  | \n":undef) ."REALSIMPLE Top  | \n" ."CCRMA Wiki  | \n" . " CCRMA Pubs  | \n" . "CCRMA Home  | \n" . "Search\n" . "" } sub top_navigation_panel { "\n" . &common_navigation_panel . "\n
\n"; } sub bot_navigation_panel { "
\n" . "" . &common_navigation_panel; } # &normalizePopupText($text); sub normalizePopupText { my $text = shift; return $text; } # $newlink = &navLink($oldlink,$name); sub navLink { my $oldlink = shift; my $name = shift; # print "\n=== \nOriginal \$oldlink = '$oldlink'\n"; $oldlink =~ m!>\s*(.+)\s*!; $text = &normalizePopupText($1); # print "Normalized oldlink \$text = $text\n"; my $newlink = $oldlink; $newlink =~ s!>\s*(.+)\s*! onMouseover=\"return escape(\'$text\')\">$name!; # print "newlink = $newlink\n"; return $newlink; } # Override next,previous,up,down icon sizes # (Images are overridden by providing a local icon directory containing them.) # See /l/l2h/l2hconf.pin $iconsizes{'up'} = 'WIDTH="20" HEIGHT="20"'; $iconsizes{'next'} = 'WIDTH="20" HEIGHT="20"'; $iconsizes{'previous'} = 'WIDTH="20" HEIGHT="20"'; $LINKNAME = '"index$EXTN"'; # Append my own info to the default info (slightly edited): # NOTE: Absolute webpubaddress needed by example documents in webpub itself $WEBPUBADDRESS = "http://ccrma.stanford.edu/%7Ejos/webpub"; $WEBPUBFULL = "http://ccrma.stanford.edu/~jos/webpub"; # Need to build page rank since we have competition now: $ODADDRESS = "http://www.opendictionary.org"; $INFO = join('' , "$t_title

\nThis document was generated using the\n" , "LaTeX2HTML" , " translator Version $TEX2HTMLVERSION(patched)\n" , "

Copyright © 1993, 1994, 1995, 1996,\n" # , "Nikos Drakos, \n" , "Nikos Drakos, \n" , "Computer Based Learning Unit, University of Leeds.\n" , "
Copyright © 1997, 1998, 1999, 2000\n" , "Ross Moore, \n" , "Mathematics, Sydney.\n" , "

    " , "
  • The Makefiles and .latex2html-init file similar to the ones used to generate this website are available at $WEBPUBFULL/.\n" # automatic links can't work from CCRMA yet (need proxy server): # , "
  • Hypertext links installed from a # master glossary prepared using the #Open Dictionary.\n" , "
" ); #====================== END OF NAVIGATION PANEL SETUP =================== # Below are various overrides to perl functions in the standard latex2html # distribution. # This whole subroutine has to be overridden just to change $GENERIC_WORDS! # (See last line below. See also /l/l2h/l2hconf.pin#$GENERIC_WORDS) sub english_titles { $toc_title = "Contents"; $lof_title = "List of Figures"; $lot_title = "List of Tables"; $idx_title = "Index"; $ref_title = "References"; $bib_title = "Bibliography"; $abs_title = "Abstract"; $app_title = "Appendix"; $pre_title = "Preface"; $foot_title = "Footnotes"; $thm_title = "Theorem"; $fig_name = "Figure"; $tab_name = "Table"; $prf_name = "Proof"; $date_name = "Date"; $page_name = "Page"; # Sectioning-level titles $part_name = "Part"; $chapter_name = "Chapter"; $section_name = "Section"; $subsection_name = "Subsection"; $subsubsection_name = "Subsubsection"; $paragraph_name = "Paragraph"; # Misc. strings $child_name = "Subsections"; $info_title = "About this document ..."; $also_name = "see also"; $see_name = "see"; # names in navigation panels $next_name = "Next"; $up_name = "Up"; $prev_name = "Previous"; $group_name = "Group"; # mail fields $encl_name = "encl"; $headto_name = "To"; $cc_name = "cc"; @Month = ('', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); # These words will be omitted from filenames derived # from section-titles, when using -long_titles # NOTE 1: Case does not matter (see /l/l2h/latex2html:L9144 # NOTE 2: Words following '---' without a space will NOT MATCH # For example, "Foo Bar---A Baz" --> Foo_Bar_A.html # $GENERIC_WORDS = "and|the|of|for|by|a|an|to"; $GENERIC_WORDS = "and|the|of|for|by|a|an|to|as|at|from|in|on|due|into|its|via|with|is"; } # Override standard routine to allow more than 32 characters per filename. my %title_seen = (); sub make_name { local($sec_name, $packed_curr_sec_id) = @_; local($title,$making_name,$saved) = ('',1,''); if ($LONG_TITLES) { $saved = $_; # JOS: Remove alternate title so name will be based on full title. # This is required by problem sets that use 'Exercises' as alt title. # Without this change, links to problem pages are broken. # print "\n=== make_name: Working with '$_'\n"; #$ s/\[.+\]//; # No [] allowed within alt title # print "\n=== make_name: After alt title removed, have '$_'\n"; #$ &process_command($sections_rx, $_) if /^$sections_rx/; # print "=== make_name: After commands processed, have '$_'\n"; #$ $title = &make_long_title($TITLE) unless ((! $TITLE) || ($TITLE eq $default_title)); $_ = $saved; } elsif ($CUSTOM_TITLES) { $saved = $_; &process_command($sections_rx, $_) if /^$sections_rx/; $title = &custom_title_hook($TITLE) unless ((! $TITLE) || ($TITLE eq $default_title)); $_ = $saved; } if ($title) { #ensure no more than 32 characters, including .html extension #jos $title =~ s/^(.{1,27}).*$/$1/; while ($title_seen{$title}) { $title .= '_I'; } $title_seen{$title}++; ++$OUT_NODE; join("", ${PREFIX}, $title, $EXTN); } else { # Remove 0's from the end of $packed_curr_sec_id $packed_curr_sec_id =~ s/(_0)*$//; $packed_curr_sec_id =~ s/^\d+$//o; # Top level file join("",($packed_curr_sec_id ? "${PREFIX}$NODE_NAME". ++$OUT_NODE : $sec_name), $EXTN); } } # The following is overridden in order to provide symbolic section names # FIXME: CHANGE "$LONG_SECTION_TITLES" below to "$LONG_TITLES" when symbolic section # names are supported in the cross-linking databases (TOC, etc.) sub make_section_heading { local($text, $level, $anchors) = @_; local($elevel) = $level; $elevel =~ s/^(\w+)\s.*$/$1/; local($section_tag) = join('', @curr_sec_id); local($align,$pre_anchors); local($sectiontag) = "SECTION$section_tag"; # separate any invisible anchors or alignment, if this has not already been done if (!($anchors)){ ($anchors,$text) = &extract_anchors($text) } else { $anchors =~ s/(ALIGN=\"\w*\")/$align = " $1";''/e; $align = '' if ($HTML_VERSION < 2.2); $anchors = &translate_commands($anchors) if ($anchors =~ /\\/); } # strip off remains of bracketings $text =~ s/$OP\d+$CP//g; if (!($text)) { # anchor to a single `.' only $text = ".$anchors\n"; } else { # FIXME(JOS): DELETE 'SECTION_' BELOW WHEN READY: if ($LONG_SECTION_TITLES) { print STDERR "GOING FOR IT\n"; $sectiontag = &make_long_title($text); print STDERR "sectiontag = '$sectiontag'\n"; } if ($anchors) { # # put anchors immediately after, except if title is too long # if ((length($text)<60 )&&(!($align)||($align =~/left/))) { # $text = "$text\n" . $anchors; # ...put anchors preceding the title, on a separate when left-aligned # } else { $text = "$anchor_invisible_mark$anchors" . (!($align)||($align =~ /left/i ) ? "
" : "") . "\n". $text; # } } elsif (!($text =~ /\n" . $text . ""; } else { # there are embedded anchors; these cannot be nested local ($tmp) = $text; $tmp =~ s/\n" . $` . "\n<" . $'; $text = "\n" . $` . ""; $pre_anchors = "<" . $'; if ($pre_anchors =~ /^(${anchor_invisible_mark}<\/A>\s*)+$/) { $pre_anchors .= "\n" } else { $text .= $pre_anchors; $pre_anchors = '' } } else { # $text starts with a tag local($after,$tmp) = ($',''); if ( $after =~ /^A[^\w]/i ) { # it is an anchor already, so need a separate line $text = "$anchor_invisible_mark
\n$text"; } else { # Is it a tag enclosing the anchor ? $after =~ s/^(\w)*[\s|>]/$tmp = $1;''/eo; if ($after =~ //) { # it encloses an anchor, so use anchor_mark + break $text = "$anchor_invisible_mark
\n$text"; } else { # take up to the anchor $text =~ s/^(.*)$1$text\n<\/$elevel>"; } # Modify web section heading font sizes (section is H1 -> H2): %standard_section_headings = ('part' , 'H1' , 'chapter' , 'H1', 'section', 'H2', 'subsection', 'H3' , 'subsubsection', 'H4', 'paragraph', 'H5', 'subparagraph', 'H6' ); # This subroutine in /usr/bin/latex2html (version 2002-2-1) is being # overridden to fix a bug: sub do_cmd_author { local($_) = @_; &get_next_optional_argument; my $next; $next = &missing_braces unless ( (s/$next_pair_pr_rx/$next = $2;''/seo) ||(s/$next_pair_rx/$next = $2;''/seo)); local($after) = $_; if ($next =~ /\\and/) { my @author_list = split(/\s*\\and\s*/, $next); my $t_author, $t_affil, $t_address; foreach (@author_list) { $t_author = &translate_environments($_); $t_author =~ s/\s+/ /g; $t_author = &simplify(&translate_commands($t_author)); ($t_author,$t_affil,$t_address) = split (/\s*
s*/, $t_author, 3); push @authors, $t_author; push @affils, $t_affil; push @addresses, $t_address; } } else { $_ = &translate_environments($next); $next = &translate_commands($_); ($t_author) = &simplify($next); ($t_author,$t_affil,$t_address) = split (/\s*
s*/, $t_author, 3); push @authors, $t_author; push @affils, $t_affil if $t_affil; push @addresses, $t_address if $t_address; } $after; } # This subroutine in /usr/bin/latex2html (version 2002-2-1) is being # overridden to fix a bug: sub make_singleauthor_title { local($alignc, $alignl , $t_author , $t_affil,$t_institute,$t_date,$t_address,$t_email,$t_authorURL) = (@_); my $t_title = ''; my ($s_author_info, $e_author_info) = (''); $s_author_info .= ($USING_STYLES ? ' CLASS="author_info"' : '').'>'; if ($t_author) { if ($t_authorURL) { local($href) = &translate_commands($t_authorURL); $href = &make_named_href('author' , $href, "${t_author}"); $t_title .= "\n$href

"; } else { $t_title .= "\n$t_author

"; } } else { &write_warnings("\nThere is no author for this document."); } if ($t_institute&&!($t_institute=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) { $t_title .= "\n$t_institute

";} if ($t_affil&&!($t_affil=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) { $t_title .= "\n$t_affil

";} if ($t_date&&!($t_date=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) { $t_title .= "\n$t_date

";} if ($t_address&&!($t_address=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) { $t_title .= "\n$t_address

"; } # else { $t_title .= "\n"} if ($t_email&&!($t_email=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) { $t_title .= "\n$t_email

"; } # else { $t_title .= "

" } join("\n", $s_author_info, $t_title, $e_author_info); } # This fixes a bug in small caps processing (in latex2html-2002-1-2 (1.70)): sub process_smallcaps { local($text) = @_; local($next, $scstr, $scbef, $special, $char); # is this enough for \sc and \scshape ? $text = &translate_environments($text); # MRO: replaced $* with /m while ($text =~ /(\\[a-zA-Z]+|[&;]SPM\w+;|<[^>]+>)+/m ) { $scbef = $`; $special = $&; $text = $'; # JOS: replaced \W with \s (to fix unequal parens bug): while ( $scbef =~ /(&#\d+;|[a-z$sclower])+[a-z\s\d$sclower]*/m) { $scstr .= $`; $scbef = $'; $next = $&; $next =~ s/&#(\d+);/&lowercase_entity($1)/egm; eval "\$next =~ $scextra" if ($scextra); eval "\$next =~ tr/a-z$sclower/A-Z$scupper/"; $scstr .= "" . $next ."<\/SMALL>"; } $scstr .= $scbef . $special; } if ($text) { while ( $text =~ /(&#\d+;|[a-z$sclower])+[a-z\s\d$sclower]*/m) { $scstr .= $`; $text = $'; $next = $&; $next =~ s/&#(\d+);/&lowercase_entity($1)/egm; eval "\$next =~ $scextra" if ($scextra); eval "\$next =~ tr/a-z$sclower/A-Z$scupper/"; $scstr .= "" . $next ."<\/SMALL>"; } $scstr .= $text; } $scstr; } 1;