X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2FreLyX%2FVerbatim.pm;h=e8161fdbc6797f732f06bee6d638b1d9b397cb6b;hb=46ee486bdaf2a39538d9cabd2e7af722a4ede97d;hp=c03770f07bde124680fd83cfaaf09558ccd0ade9;hpb=27de1486ca34aaad446adb798d71a77d6f6304da;p=features.git diff --git a/lib/reLyX/Verbatim.pm b/lib/reLyX/Verbatim.pm index c03770f07b..e8161fdbc6 100644 --- a/lib/reLyX/Verbatim.pm +++ b/lib/reLyX/Verbatim.pm @@ -1,5 +1,5 @@ ####################### VERBATIM COPYING SUBROUTINES ######################## -# This file is part of reLyX. +# This file is part of reLyX. # Copyright (c) 1998-9 Amir Karger karger@post.harvard.edu # You are free to use and modify this code under the terms of # the GNU General Public Licence version 2 or later. @@ -12,6 +12,8 @@ package Verbatim; use strict; +my $debug_on; # package-wide variable set if -d option is given + sub copy_verb { # This subroutine handles a \verb token. Text is guaranteed to be on one line. # \verb must be followed by a non-letter, then copy anything until the next @@ -27,6 +29,9 @@ sub copy_verb { } sub copy_verbatim { + # Was -d option given? + $debug_on = (defined($main::opt_d) && $main::opt_d); + # This subroutine eats text verbatim until a certain text is reached # The end text itself is not eaten; this is necessary so that # environments are properly nested (otherwise, TeX.pm complains) @@ -35,7 +40,10 @@ sub copy_verbatim { # Arg 0 is the Text::TeX::OpenFile file object, arg 1 is the beginning token my $fileobject = shift; my $begin_token = shift; - my %endtokentbl = ( '\(' => '\)' , '\[' => '\]' ); + my %endtokentbl = ( '\(' => '\)', + '\[' => '\]', + '$' => '$', + '$$' => '$$' ); my $type = ref($begin_token); $type =~ s/^Text::TeX:://o or die "unknown token type $type?!";