#!/usr/bin/perl -i.bak

use English;


######################
# DEFINE GLOBAL CONSTANTS
######################
@usepackage_list = qw(slidesec);

######################
# BEGIN MAIN
######################



undef $INPUT_RECORD_SEPARATOR;
$file = <>;

#print STDERR "*********** I got: $file\n";


if ($file =~ /\\documentclass{seminar}/)
{

    foreach $pkg (@usepackage_list) {
	if  (!( $file =~ /\\usepackage(\[[^\]]*\])?{$pkg}/ ))
	{
	    $file =~ s/\\begin{document}/\\usepackage{$pkg} % pkg required by EasyLatex\n\\begin{document}/;
	    #
	}
    }
}



print $file;
