- s/{\\(em|it|bf)(?:\s+|{})([^{}]+)}/<emphasis>$2<\/emphasis>/g;
- s/\\(emph|textit|textbf){([^{}]+)}/<emphasis>$2<\/emphasis>/g;
- s/\\footnote{(.*)}/push_footnote($1)/e;
+
+ s/\\footnote\{(.*)\}/push_footnote($1)/e;
+ $_.="}" if (/^\s*\{.*?[^}]$/) ;
+ s/\{\\(em|it|bf)(?:\s+| \{\})([^{}]+)}/<emphasis>$2<\/emphasis>/g;
+ s/\{\\(tt)(?:\s+|\{\})([^{}]+)}/<code>$2<\/code>/g;
+ s/\\(emph|textit|textbf)\{([^{}]+)\}/<emphasis>$2<\/emphasis>/g;