]> git.lyx.org Git - features.git/blobdiff - lib/reLyX/Verbatim.pm
Whitespace, only whitespace. Part II.
[features.git] / lib / reLyX / Verbatim.pm
index c03770f07bde124680fd83cfaaf09558ccd0ade9..e8161fdbc6797f732f06bee6d638b1d9b397cb6b 100644 (file)
@@ -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?!";