[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm
foxr
lon-capa-cvs@mail.lon-capa.org
Mon, 03 Jul 2006 10:34:31 -0000
foxr Mon Jul 3 06:34:31 2006 EDT
Modified files:
/loncom/xml lonxml.pm
Log:
Adjust latex_special_symbols so that instead of mapping some stuff to " "
it gets mapped to LaTeX to generate the correct characters.
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.413 loncom/xml/lonxml.pm:1.414
--- loncom/xml/lonxml.pm:1.413 Tue Jun 27 10:22:39 2006
+++ loncom/xml/lonxml.pm Mon Jul 3 06:34:30 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.413 2006/06/27 14:22:39 albertel Exp $
+# $Id: lonxml.pm,v 1.414 2006/07/03 10:34:30 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -366,9 +366,10 @@
return $string;
}
if ($where eq 'header') {
- $string =~ s/(\\|_|\^)/ /g;
+ $string =~ s/\\/\$\\backslash\$/g; # \ -> $\backslash$ per LaTex line by line pg 10.
+ $string =~ s/_/\\_/g; # _ -> \_
+ $string =~ s/\^/\\\^{}/g; # ^ -> \^{}
$string =~ s/(\$|%|\{|\})/\\$1/g;
- $string =~ s/_/ /g;
$string=&Apache::lonprintout::character_chart($string);
# any & or # leftover should be safe to just escape
$string=~s/([^\\])\&/$1\\\&/g;