}
next LINE if $environ;
# Section headings
-if (/\\(part|chapter|section|subsection|subsubsection)\*?{(.*)}/) {
+if (/\\(part|chapter|section|subsection|subsubsection)\*?\{(.*)\}/) {
if ($buffer) {
add_to_section(tag(flushbuffer($buffer),$poetry?"stanza":"p"));
$buffer="";
pushsection($1,tag($2,"p"));
next LINE;
}
-if (/\\vspace{/) {
+if (/\\vspace\{/) {
add_to_section("<empty-line />");
next LINE;
}
s/^%.*$//;
# strip \sloppy
s/\\sloppy\s+//g;
-s/\\sloppy{}//g;
+s/\\sloppy\{\}//g;
s/\\sloppy([^\w])/$1/g;
# strip extra space
s/^\s+//;
$poetic_buffer=$_;
next LINE;
}
- s/\\footnote{(.*)}/push_footnote($1)/e;
+ s/\\footnote\{(.*)\}/push_footnote($1)/e;
s/\s*\\\\$//;
$buffer.=tag($_,'v')."\n";
} elsif ($verbatim) {
sub flushbuffer {
local $_ = shift;
- s/{\\(em|it|bf)(?:\s+|{})([^{}]+)}/<emphasis>$2<\/emphasis>/g;
- s/\\(emph|textit|textbf){([^{}]+)}/<emphasis>$2<\/emphasis>/g;
- s/\\footnote{(.*)}/push_footnote($1)/e;
+ s/\{\\(em|it|bf)(?:\s+|\{\})([^{}]+)\}/<emphasis>$2<\/emphasis>/g;
+ s/\\(emph|textit|textbf)\{([^{}]+)\}/<emphasis>$2<\/emphasis>/g;
+ s/\\footnote\{(.*)\}/push_footnote($1)/e;
s/[{}]//g;
return $_;
}