while (/^\\c (([^\\]|\\[^c])*)(.*)$/) {
$l = $1;
$_ = $3;
- $l =~ s/\\{/{/g;
- $l =~ s/\\}/}/g;
+ $l =~ s/\\\{/{/g;
+ $l =~ s/\\\}/}/g;
$l =~ s/\\\\/\\/g;
push @$pname, $l;
}
$snum = 0;
$xref = "chapter-$cnum";
$pflags = "chap $cnum :$xref";
- die "badly formatted chapter heading: $_\n" if !/^\\C{([^}]*)}\s*(.*)$/;
+ die "badly formatted chapter heading: $_\n" if !/^\\C\{([^}]*)\}\s*(.*)$/;
$refs{$1} = "chapter $cnum";
$node = "Chapter $cnum";
&add_item($node, 1);
$snum = 0;
$xref = "appendix-$cnum";
$pflags = "appn $cnum :$xref";
- die "badly formatted appendix heading: $_\n" if !/^\\A{([^}]*)}\s*(.*)$/;
+ die "badly formatted appendix heading: $_\n" if !/^\\A\{([^}]*)\}\s*(.*)$/;
$refs{$1} = "appendix $cnum";
$node = "Appendix $cnum";
&add_item($node, 1);
$snum = 0;
$xref = "section-$cnum.$hnum";
$pflags = "head $cnum.$hnum :$xref";
- die "badly formatted heading: $_\n" if !/^\\[HP]{([^}]*)}\s*(.*)$/;
+ die "badly formatted heading: $_\n" if !/^\\[HP]\{([^\}]*)\}\s*(.*)$/;
$refs{$1} = "section $cnum.$hnum";
$node = "Section $cnum.$hnum";
&add_item($node, 2);
$snum++;
$xref = "section-$cnum.$hnum.$snum";
$pflags = "subh $cnum.$hnum.$snum :$xref";
- die "badly formatted subheading: $_\n" if !/^\\S{([^}]*)}\s*(.*)$/;
+ die "badly formatted subheading: $_\n" if !/^\\S\{([^}]*)\}\s*(.*)$/;
$refs{$1} = "section $cnum.$hnum.$snum";
$node = "Section $cnum.$hnum.$snum";
&add_item($node, 3);
# the standard word-by-word code will happen next
} elsif (/^\\IR/) {
# An index-rewrite.
- die "badly formatted index rewrite: $_\n" if !/^\\IR{([^}]*)}\s*(.*)$/;
+ die "badly formatted index rewrite: $_\n" if !/^\\IR\{([^\}]*)\}\s*(.*)$/;
$irewrite = $1;
$_ = $2;
# the standard word-by-word code will happen next
} elsif (/^\\IA/) {
# An index-alias.
- die "badly formatted index alias: $_\n" if !/^\\IA{([^}]*)}{([^}]*)}\s*$/;
+ die "badly formatted index alias: $_\n" if !/^\\IA\{([^}]*)\}\{([^\}]*)\}\s*$/;
$idxalias{$1} = $2;
return; # avoid word-by-word code
} elsif (/^\\M/) {
# Metadata
- die "badly formed metadata: $_\n" if !/^\\M{([^}]*)}{([^}]*)}\s*$/;
+ die "badly formed metadata: $_\n" if !/^\\M\{([^\}]*)\}\{([^\}]*)\}\s*$/;
$metadata{$1} = $2;
return; # avoid word-by-word code
} elsif (/^\\b/) {
die "badly formatted \\c: \\c$_\n" if !/{(([^\\}]|\\.)*)}(.*)$/;
$w = $1;
$_ = $3;
- $w =~ s/\\{/{/g;
- $w =~ s/\\}/}/g;
+ $w =~ s/\\\{/{/g;
+ $w =~ s/\\\}/}/g;
$w =~ s/\\-/-/g;
$w =~ s/\\\\/\\/g;
(push @$pname,"i"),$lastp = $#$pname if $indexing;
die "badly formatted $type: $type$_\n" if !/{(([^\\}]|\\.)*)}(.*)$/;
$w = $1;
$_ = $3;
- $w =~ s/\\{/{/g;
- $w =~ s/\\}/}/g;
+ $w =~ s/\\\{/{/g;
+ $w =~ s/\\\}/}/g;
$w =~ s/\\-/-/g;
$w =~ s/\\\\/\\/g;
$t = $emph ? "es" : "n ";
$t = "w ";
$t = "wc" if $3 eq "\\c";
$indexing = 1 if $2;
- $w =~ s/\\{/{/g;
- $w =~ s/\\}/}/g;
+ $w =~ s/\\\{/{/g;
+ $w =~ s/\\\}/}/g;
$w =~ s/\\-/-/g;
$w =~ s/\\\\/\\/g;
(push @$pname,"i"),$lastp = $#$pname if $indexing;
die "painful death! $_\n" if !length $1;
$w = $1;
$_ = $3;
- $w =~ s/\\{/{/g;
- $w =~ s/\\}/}/g;
+ $w =~ s/\\\{/{/g;
+ $w =~ s/\\\}/}/g;
$w =~ s/\\-/-/g;
$w =~ s/\\\\/\\/g;
if ($w eq "-") {