#!/usr/bin/perl
#

$name = $ARGV[0];
if ($name !~ /\.bbl/) {die("no .bbl-File!");}

open(OUT, ">pub.html") or die("Cannot open file for writing.");
print OUT "<html>\n<head>\n<title>Publications</title>\n</head>\n<body>\n";
print OUT "<b>List of publications</b> in reverse chronological order.\n\n";

open(F, $name);

while( <F> )
{
  $s = $_;
  $s =~ s/~/&nbsp;/gsi;
  $s =~ s/\/&nbsp;/\/~/gsi;
  $s =~ s/--/-/gsi;
  $s =~ s/%\n//gsi;
  $s =~ s/\\"a/&auml;/gsi;
  $s =~ s/\\"o/&ouml;/gsi;
  $s =~ s/\\"u/&uuml;/gsi;
  $s =~ s/\\"a/&Auml;/gsi;
  $s =~ s/\\"o/&Ouml;/gsi;
  $s =~ s/\\"u/&Uuml;/gsi;
  $s =~ s/\\"s/&szlig;/gsi;
  $s =~ s/{//gsi;
  $s =~ s/}//gsi;
  $s =~ s/``/"/gsi;
  print OUT $s;
}

close(F);
print OUT "\n</body>\n</html>\n";
close(OUT);

