summaryrefslogtreecommitdiff
path: root/pod/pod2latex.PL
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-08 12:41:38 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-08 12:41:38 +0000
commitd23ed1f2ad4fab0ab337e1558f4157d663b72860 (patch)
tree1514a818f3f4c76e090d395ee8df40f51758b681 /pod/pod2latex.PL
parentf07cf794e2ddad870bcc5abe24ba4bd3bcabf9e2 (diff)
downloadperl-d23ed1f2ad4fab0ab337e1558f4157d663b72860.tar.gz
shore up pod2latex shortcomings, and a Pod::Parser fix (from
Robin Barker) p4raw-id: //depot/perl@5612
Diffstat (limited to 'pod/pod2latex.PL')
-rw-r--r--pod/pod2latex.PL10
1 files changed, 7 insertions, 3 deletions
diff --git a/pod/pod2latex.PL b/pod/pod2latex.PL
index feed98e923..71115f3f21 100644
--- a/pod/pod2latex.PL
+++ b/pod/pod2latex.PL
@@ -101,7 +101,6 @@ print OUT <<'!NO!SUBS!';
# Translation of HTML escapes of various European accents might be wrong.
-$/ = ""; # record separator is blank lines
# TeX special characters.
##$tt_ables = "!@*()-=+|;:'\"`,./?<>";
$backslash_escapables = "#\$%&{}_";
@@ -119,13 +118,16 @@ $indent = 0;
# parse the pods, produce LaTeX.
-open(POD,"<$ARGV[0]") || die "cant open $ARGV[0]";
+use Pod::Plainer;
+open(POD,"-|") or Pod::Plainer -> new() -> parse_from_file($ARGV[0]), exit;
+
($pod=$ARGV[0]) =~ s/\.pod$//;
open(LATEX,">$pod.tex");
&do_hdr();
$cutting = 1;
$begun = "";
+$/ = ""; # record separator is blank lines
while (<POD>) {
if ($cutting) {
next unless /^=/;
@@ -314,6 +316,8 @@ while (<POD>) {
}
}gex;
+ s/X<([^<>]*)>/\\index{$1}/g;
+
s/Z<>/\\&/g; # the "don't format me" thing
# comes last because not subject to reprocessing
@@ -416,7 +420,7 @@ while (<POD>) {
}
print LATEX "\n\\begin{$listingcmd}\n";
push(@listingcmd,$listingcmd);
- } elsif ($lastcmd ne 'item') {
+ } elsif ( !@listingcmd ) {
warn "Illegal '=item' command without preceding 'over':";
warn "=item $bareitem";
}