# chowto.perl by Stephen A. Wood # # Extension to LaTeX2HTML V97.1 to support the "chowto" document class # and standard LaTeX2e class options. # # Change Log: # =========== # # $Log: chowto.perl,v $ # Revision 1.1 2003/03/06 20:21:14 saw # Initial Checkin # package main; # Suppress option-warning messages: sub do_chowto_a4paper{} sub do_chowto_a5paper{} sub do_chowto_b5paper{} sub do_chowto_legalpaper{} sub do_chowto_letterpaper{} sub do_chowto_executivepaper{} sub do_chowto_landscape{} sub do_chowto_final{} sub do_chowto_draft{} sub do_chowto_oneside{} sub do_chowto_twoside{} sub do_chowto_openright{} sub do_chowto_openany{} sub do_chowto_onecolumn{} sub do_chowto_twocolumn{} sub do_chowto_notitlepage{} sub do_chowto_titlepage{} sub do_chowto_openbib{} sub do_chowto_10pt{ $LATEX_FONT_SIZE = '10pt' unless $LATEX_FONT_SIZE; } sub do_chowto_11pt{ $LATEX_FONT_SIZE = '11pt' unless $LATEX_FONT_SIZE; } sub do_chowto_12pt{ $LATEX_FONT_SIZE = '12pt' unless $LATEX_FONT_SIZE; } sub do_chowto_leqno{ $EQN_TAGS = 'L'; } sub do_chowto_reqno{ $EQN_TAGS = 'R'; } sub do_chowto_fleqn{ $FLUSH_EQN = 1; } sub do_cmd_thesection { join('', &do_cmd_arabic("${O}0${C}section${O}0$C"), @_[0]) } sub do_cmd_thesubsection { join('',&translate_commands("\\thesection") ,".", &do_cmd_arabic("${O}0${C}subsection${O}0$C"), @_[0]) } sub do_cmd_thesubsubsection { join('',&translate_commands("\\thesubsection") ,"." , &do_cmd_arabic("${O}0${C}subsubsection${O}0$C"), @_[0]) } sub do_cmd_theparagraph { join('',&translate_commands("\\thesubsubsection") ,"." , &do_cmd_arabic("${O}0${C}paragraph${O}0$C"), @_[0]) } sub do_cmd_thesubparagraph { join('',&translate_commands("\\theparagraph") ,"." , &do_cmd_arabic("${O}0${C}subparagraph${O}0$C"), @_[0]) } sub do_cmd_theequation { join('', &do_cmd_arabic("${O}0${C}equation${O}0$C"), @_[0]) } sub do_cmd_thefootnote { join('', &do_cmd_arabic("${O}0${C}footnote${O}0$C"), @_[0]) } sub do_cmd_thefigure { join('', &do_cmd_arabic("${O}0${C}figure${O}0$C"), @_[0]) } sub do_cmd_thetable { join('', &do_cmd_arabic("${O}0${C}table${O}0$C"), @_[0]) } sub pre_pre_process { # Rewrite some of the Latex # Put the optional experiment name into the title if(s/^[^%\n]*\\experiment{(.*?)}//m) { $experiment = $1; s/\\title{(.*?)}/\\title{Experiment: $experiment\\\\$1}/; } # Put the type of howto into the title if(s/^[^%\n]*\\howtotype{(.*?)}//m) { if($1 eq "user") { $howtotype = "User Howto"; } elsif($1 eq "expert") { $howtotype = "Expert Howto"; } elsif($1 eq "reference") { $howtotype = "Reference"; } else { $howtotype = ""; } s/\\title{(.*?)}/\\title{Hall C $howtotype\\\\$1}/; } # Add the maintainer to the author if(s/^[^%\n]*\\maintainer{(.*?)}//m) { $maintainer = $1; s/\\author{(.*?)}/\\author{$1\\\\Maintained by $maintainer}/; } # Make sure the title is displayed s/^[^%\n]*\\begin{document}/$&\n\\maketitle/m; # Make sure a bibliography is included if(/^[^%\n]*(\\cite|\\nocite)/m) { s/^[^%\n]*\\end{document}/\\bibliography{chowto}\n$&/m; } # Ignore the category for now s/^[^%\n]*\\category{(.*?)}//m } $MAX_SPLIT_DEPTH = 4; $COPY_GRAPHICS = 1; &do_require_package("html"); &do_require_package("hthtml"); &do_require_package("graphicx"); &do_require_package("epsfig"); 1; # Must be last line