summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Jenness <tjenness@cpan.org>2000-08-20 13:09:48 -1000
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-21 13:34:51 +0000
commit4d4a0c668304428e2ef73f3f276e8de37cc9ee32 (patch)
treed6a1e63beb4be3f73460bf5cdc83239dbe162ae1
parent47344f21a57f17ac209f999d58248caf273d2a74 (diff)
downloadperl-4d4a0c668304428e2ef73f3f276e8de37cc9ee32.tar.gz
Update to Pod::LaTeX 0.53.
Subject: [PATCH] lib/Pod/LaTeX.pm updates Message-ID: <Pine.LNX.4.21.0008202308040.12047-100000@lapaki.jach.hawaii.edu> p4raw-id: //depot/perl@6742
-rw-r--r--lib/Pod/LaTeX.pm34
1 files changed, 29 insertions, 5 deletions
diff --git a/lib/Pod/LaTeX.pm b/lib/Pod/LaTeX.pm
index 208a1130b7..c909d21f35 100644
--- a/lib/Pod/LaTeX.pm
+++ b/lib/Pod/LaTeX.pm
@@ -36,7 +36,7 @@ use Carp;
use vars qw/ $VERSION %HTML_Escapes @LatexSections /;
-$VERSION = '0.52';
+$VERSION = '0.53';
# Definitions of =headN -> latex mapping
@LatexSections = (qw/
@@ -57,6 +57,8 @@ $VERSION = '0.52';
'lt' => '$<$', # ' left chevron, less-than
'gt' => '$>$', # ' right chevron, greater-than
'quot' => '"', # double quote
+ 'sol' => '/',
+ 'verbar' => '$|$',
"Aacute" => "\\'{A}", # capital A, acute accent
"aacute" => "\\'{a}", # small a, acute accent
@@ -952,6 +954,9 @@ sub verbatim {
# Clean trailing space
$paragraph =~ s/\s+$//;
+ # Clean tabs
+ $paragraph =~ s/\t/ /g;
+
$self->_output('\begin{verbatim}' . "\n$paragraph\n". '\end{verbatim}'."\n");
}
}
@@ -1248,7 +1253,7 @@ sub add_item {
$paragraph =~ s/^\s+//;
my $type;
- if ($paragraph eq '*') {
+ if (substr($paragraph, 0,1) eq '*') {
$type = 'itemize';
} elsif ($paragraph =~ /^\d/) {
$type = 'enumerate';
@@ -1264,10 +1269,21 @@ sub add_item {
my $type = $self->lists->[-1]->type;
if ($type eq 'description') {
+ # Handle long items - long items do not wrap
+ if (length($paragraph) < 40) {
+ # A real description list item
+ $self->_output("\\item[$paragraph] \\mbox{}");
+ } else {
+ # The item is now simply bold text
+ $self->_output(qq{\\item \\textbf{$paragraph}});
+ }
- $self->_output("\\item[$paragraph] \\mbox{}");
} else {
- $self->_output('\item ');
+ # If the item was '* Something' we still need to write
+ # out the something
+ my $extra_info = $paragraph;
+ $extra_info =~ s/^\*\s*//;
+ $self->_output("\\item $extra_info");
}
# Store the item name in the object. Required so that
@@ -1392,6 +1408,8 @@ Special characters and the C<latex> equivalents are:
& \&
\ $\backslash$
^ \^{}
+ ~ \~{}
+ | $|$
=cut
@@ -1412,6 +1430,12 @@ sub _replace_special_chars {
# Replace ^ characters with \^{} so that $^F works okay
$paragraph =~ s/(\^)/\\$1\{\}/g;
+ # Replace tilde (~) with \texttt{\~{}}
+ $paragraph =~ s/~/\\texttt\{\\~\{\}\}/g;
+
+ # Replace | with $|$
+ $paragraph =~ s'\|'$|$'g;
+
# Now add the dollars around each \backslash
$paragraph =~ s/(\\backslash)/\$$1\$/g;
@@ -1560,7 +1584,7 @@ under the same terms as Perl itself.
=head1 REVISION
-$Id: LaTeX.pm,v 1.4 2000/05/16 01:26:55 timj Exp $
+$Id: LaTeX.pm,v 1.6 2000/08/21 09:05:03 timj Exp $
=end __PRIVATE__