summaryrefslogtreecommitdiff
path: root/pod/pod2latex.PL
diff options
context:
space:
mode:
authorKenneth Albanowski <kjahds@kjahds.com>1996-12-20 16:43:35 -0500
committerChip Salzenberg <chip@atlantic.net>1996-12-23 12:58:58 +1200
commit8c634b6ed8dff69ce029df1386a301fb7f8b3062 (patch)
treef78bd37eff687c1aca335c94dd30bd5623927bdc /pod/pod2latex.PL
parentb4730b2b81770bcc392cf36505f77d68a1f5e9f7 (diff)
downloadperl-8c634b6ed8dff69ce029df1386a301fb7f8b3062.tar.gz
Better support for =for
private-msgid: <Pine.LNX.3.93.961220163747.298T-100000@kjahds.com>
Diffstat (limited to 'pod/pod2latex.PL')
-rw-r--r--pod/pod2latex.PL26
1 files changed, 26 insertions, 0 deletions
diff --git a/pod/pod2latex.PL b/pod/pod2latex.PL
index ebace22aef..4f79c1297f 100644
--- a/pod/pod2latex.PL
+++ b/pod/pod2latex.PL
@@ -124,11 +124,21 @@ open(LATEX,">$pod.tex");
&do_hdr();
$cutting = 1;
+$begun = "";
while (<POD>) {
if ($cutting) {
next unless /^=/;
$cutting = 0;
}
+ if ($begun) {
+ if (/^=end\s+$begun/) {
+ $begun = "";
+ }
+ elsif ($begun =~ /^(tex|latex)$/) {
+ print LATEX $_;
+ }
+ next;
+ }
chop;
length || (print LATEX "\n") && next;
@@ -146,6 +156,22 @@ while (<POD>) {
next;
}
+ if (/^=for\s+(\S+)\s*/s) {
+ if ($1 eq "tex" or $1 eq "latex") {
+ print LATEX $',"\n";
+ } else {
+ # ignore unknown for
+ }
+ next;
+ }
+ elsif (/^=begin\s+(\S+)\s*/s) {
+ $begun = $1;
+ if ($1 eq "tex" or $1 eq "latex") {
+ print LATEX $'."\n";
+ }
+ next;
+ }
+
# preserve '=item' line with pod quotes as they are.
if (/^=item/) {
($bareitem = $_) =~ s/^=item\s*//;