|
|
@ -162,6 +162,8 @@ while(<$inf>) { |
|
|
} elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) { |
|
|
} elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) { |
|
|
$_ = "\n=back\n"; |
|
|
$_ = "\n=back\n"; |
|
|
$ic = pop @icstack; |
|
|
$ic = pop @icstack; |
|
|
|
|
|
} elsif ($ended eq "multitable") { |
|
|
|
|
|
$_ = "\n=back\n"; |
|
|
} else { |
|
|
} else { |
|
|
die "unknown command \@end $ended at line $.\n"; |
|
|
die "unknown command \@end $ended at line $.\n"; |
|
|
} |
|
|
} |
|
|
@ -252,6 +254,8 @@ while(<$inf>) { |
|
|
and $_ = "\n=head2 $1\n"; |
|
|
and $_ = "\n=head2 $1\n"; |
|
|
/^\@subsection\s+(.+)$/ |
|
|
/^\@subsection\s+(.+)$/ |
|
|
and $_ = "\n=head3 $1\n"; |
|
|
and $_ = "\n=head3 $1\n"; |
|
|
|
|
|
/^\@subsubsection\s+(.+)$/ |
|
|
|
|
|
and $_ = "\n=head4 $1\n"; |
|
|
|
|
|
|
|
|
# Block command handlers: |
|
|
# Block command handlers: |
|
|
/^\@itemize(?:\s+(\@[a-z]+|\*|-))?/ and do { |
|
|
/^\@itemize(?:\s+(\@[a-z]+|\*|-))?/ and do { |
|
|
@ -260,7 +264,7 @@ while(<$inf>) { |
|
|
if (defined $1) { |
|
|
if (defined $1) { |
|
|
$ic = $1; |
|
|
$ic = $1; |
|
|
} else { |
|
|
} else { |
|
|
$ic = '@bullet'; |
|
|
$ic = '*'; |
|
|
} |
|
|
} |
|
|
$_ = "\n=over 4\n"; |
|
|
$_ = "\n=over 4\n"; |
|
|
$endw = "itemize"; |
|
|
$endw = "itemize"; |
|
|
@ -278,6 +282,12 @@ while(<$inf>) { |
|
|
$endw = "enumerate"; |
|
|
$endw = "enumerate"; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/^\@multitable\s.*/ and do { |
|
|
|
|
|
push @endwstack, $endw; |
|
|
|
|
|
$endw = "multitable"; |
|
|
|
|
|
$_ = "\n=over 4\n"; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
/^\@([fv]?table)\s+(\@[a-z]+)/ and do { |
|
|
/^\@([fv]?table)\s+(\@[a-z]+)/ and do { |
|
|
push @endwstack, $endw; |
|
|
push @endwstack, $endw; |
|
|
push @icstack, $ic; |
|
|
push @icstack, $ic; |
|
|
@ -297,6 +307,16 @@ while(<$inf>) { |
|
|
$_ = ""; # need a paragraph break |
|
|
$_ = ""; # need a paragraph break |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/^\@item\s+(.*\S)\s*$/ and $endw eq "multitable" and do { |
|
|
|
|
|
@columns = (); |
|
|
|
|
|
for $column (split (/\s*\@tab\s*/, $1)) { |
|
|
|
|
|
# @strong{...} is used a @headitem work-alike |
|
|
|
|
|
$column =~ s/^\@strong{(.*)}$/$1/; |
|
|
|
|
|
push @columns, $column; |
|
|
|
|
|
} |
|
|
|
|
|
$_ = "\n=item ".join (" : ", @columns)."\n"; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
/^\@itemx?\s*(.+)?$/ and do { |
|
|
/^\@itemx?\s*(.+)?$/ and do { |
|
|
if (defined $1) { |
|
|
if (defined $1) { |
|
|
# Entity escapes prevent munging by the <> processing below. |
|
|
# Entity escapes prevent munging by the <> processing below. |
|
|
@ -382,6 +402,9 @@ sub postprocess |
|
|
s/\@gol//g; |
|
|
s/\@gol//g; |
|
|
s/\@\*\s*\n?//g; |
|
|
s/\@\*\s*\n?//g; |
|
|
|
|
|
|
|
|
|
|
|
# Anchors are thrown away |
|
|
|
|
|
s/\@anchor\{(?:[^\}]*)\}//g; |
|
|
|
|
|
|
|
|
# @uref can take one, two, or three arguments, with different |
|
|
# @uref can take one, two, or three arguments, with different |
|
|
# semantics each time. @url and @email are just like @uref with |
|
|
# semantics each time. @url and @email are just like @uref with |
|
|
# one argument, for our purposes. |
|
|
# one argument, for our purposes. |
|
|
|