[LON-CAPA-cvs] cvs: modules /TexConvert/algebra AlgParser.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 24 Feb 2005 08:34:52 -0000
albertel Thu Feb 24 03:34:52 2005 EDT
Modified files:
/modules/TexConvert/algebra AlgParser.pm
Log:
- fix up logten, and a(rc)sin
Index: modules/TexConvert/algebra/AlgParser.pm
diff -u modules/TexConvert/algebra/AlgParser.pm:1.7 modules/TexConvert/algebra/AlgParser.pm:1.8
--- modules/TexConvert/algebra/AlgParser.pm:1.7 Thu Feb 24 03:32:11 2005
+++ modules/TexConvert/algebra/AlgParser.pm Thu Feb 24 03:34:52 2005
@@ -594,13 +594,21 @@
# added missing trig functions
#
#$specialfunc = '(?:abs|logten|asin|acos|atan|sech|sgn|step|fact)';
- my $specialfunc = '(?:abs|logten|a(?:sin|cos|tan|sec|csc|cot)h?|sgn|step|fact)';
+ my $specialfunc = '(?:abs|(logten)|a(sin|cos|tan|sec|csc|cot)(h)?|sgn|step|fact)';
#
# End DPVC
#
if ($args[0] =~ /$specialfunc/) {
- return ('\mbox{' . $args[0] .'}'. $p1 . $args[1]->tolatex() . $p2);
+ if (defined($1)) {
+ return ('\mbox{log}_{10}'. $p1 . $args[1]->tolatex() . $p2);
+ }
+ elsif (defined($2)) {
+ return ('\mbox{' . $2.$3 .'}^{-1}'. $p1 . $args[1]->tolatex() . $p2);
+ }
+ else {
+ return ('\mbox{' . $args[0] .'}'. $p1 . $args[1]->tolatex() . $p2);
+ }
}
else {
return ('\\' . $args[0] . $p1 . $args[1]->tolatex() . $p2);