#!/usr/bin/perl


while(<>) {

    next if (/\{\\footnotesize/) ;
    if (/\\begin{[Vv]erbatim}/) {
        print "\n{\\tiny\\noindent\n";
        while(<>) {
           last if (/\\end{[Vv]erbatim}/) ;
           next if (/^\s*$/) ;
           chop;
           s/\{/\\{/g;
           s/\}/\\}/g;
           my $pos = 0;
           if (s/\s+//) {
               $pos = length($&);
               print "\\hspace{${pos}pt}";
           }
           s/_/\\_\\mbox{}/g;
           s/<-/←/g;
           s/->/→/g;
           s/>/\\>\\mobox{}/g;
           s/</\\<\\mobox{}/g;
           print;
           print "\\newline\n"; 
        }
        # print "}\n";
        next;
     } else {
         print;
     }
}
