#!/usr/bin/perl # # Author : Hans Dulimarta # : Volker Simonis # Creation Date : Jul 24, 2000 # # Extension to LaTeX2HTML to process keyword generated by rcs.sty. # # $Id: rcs.perl,v 1.2 2003/03/06 13:35:32 RRM Exp $ # $Log: rcs.perl,v $ # Revision 1.2 2003/03/06 13:35:32 RRM # -- prevented RCS macros eating trailing text inside an environment # -- changed the date format to match \today # # Thanks to Volker Simonis # # Revision 1.1 2000/08/05 02:05:51 RRM # New file: rcs.perl by Hans Dulimarta # # - implements rcs.sty for recognising Revision-control tags # in multi-purpose LaTeX documents. # # Revision 1.3 2003/03/04 22:37:12 simonis # Fixed syntax error in regular expression which matched empty RCS keywords. # Fixed bug which made the RCS macros eat trailing text inside an environment. # Changed format of date to conform to the one of the '\today' macro. # (This knows only the english date format until now!) # # Revision 1.2 2000/08/04 22:37:12 dulimart # Used hash for storing RCS keyword-value pairs. Modified regular # expression to anticipate possible empty value after RCS keywords. # # Revision 1.1 2000/07/28 05:58:00 dulimart # Created for generating RCS keywords in HTML files. # package main; sub do_cmd_RCS { my($keyword,$value); s/\s* # white space \\begin<<(\d+)>> # get the sequence id (\w+) # tex2html_.... <<\1>> # matching sequence id \s* # white space \\RCS \\end<<(\d+)>> # get the sequence id \2 # matching tag <<\3>> # matching sequence id \s* # white space //x; s/\s* # white space \\begin<<(\d+)>> # get the sequence id (\w+) # tex2html_.... <<\1>> # matching sequence id \$([^\$]+)\$ # RCS string \\end<<(\d+)>> # get the sequence id \2 # matching tag <<\4>> # matching sequence id //x; $_ = $3; s/^\s* # white space (\w+) # RCS keyword (?:\s*:\s* (.+) )? //x; $keyword = $1; $value = $2; print ("RCS : [$keyword: $value]\n"); SWITCH: for ($keyword) { /Author|Header|Id|Locker|Name|RCSfile|Revision| Source|State|Log/x && do { $RCS{$keyword} = $value; last; }; /Date/ && do { $RCS{'Date'} = (split / /, $value)[0]; $RCS{'Date'} =~ s|(\d+)/0?(\d+)/0?(\d+)|$Month[$2] $3, $1|; last; }; print "Unknown keyword [$keyword]\n"; } } sub do_cmd_RCSAuthor { local($_) = @_; $_ = join('', $RCS{'Author'}, $_[0]); } sub do_cmd_RCSDate { local($_) = @_; $_ = join('', $RCS{'Date'}, $_[0]); } sub do_cmd_RCSHeader { local($_) = @_; $_ = join('', $RCS{'Header'}, $_[0]); } sub do_cmd_RCSId { local($_) = @_; $_ = join('', $RCS{'Id'}, $_[0]); } sub do_cmd_RCSLog { local($_) = @_; $_ = join('', $RCS{'Log'}, $_[0]); } sub do_cmd_RCSLocker { local($_) = @_; $_ = join('', $RCS{'Locker'}, $_[0]); } sub do_cmd_RCSName { local($_) = @_; $_ = join('', $RCS{'Name'}, $_[0]); } sub do_cmd_RCSRCSfile { local($_) = @_; $_ = join('', $RCS{'RCSfile'}, $_[0]); } sub do_cmd_RCSRevision { local($_) = @_; $_ = join('', $RCS{'Revision'}, $_[0]); } sub do_cmd_RCSSource { local($_) = @_; $_ = join('', $RCS{'Source'}, $_[0]); } sub do_cmd_RCSState { local($_) = @_; $_ = join('', $RCS{'State'}, $_[0]); } &process_commands_nowrap_in_tex ( <<_NO_WRAP_); RCS _NO_WRAP_ 1; # This must be the last line