[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm /xml londefdef.pm lontexconvert.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 11 Apr 2006 18:42:58 -0000
albertel Tue Apr 11 14:42:58 2006 EDT
Modified files:
/loncom/xml londefdef.pm lontexconvert.pm
/loncom/homework structuretags.pm
Log:
-making this cmmon usage a simple sub call
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.325 loncom/xml/londefdef.pm:1.326
--- loncom/xml/londefdef.pm:1.325 Wed Mar 29 17:41:39 2006
+++ loncom/xml/londefdef.pm Tue Apr 11 14:42:43 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.325 2006/03/29 22:41:39 albertel Exp $
+# $Id: londefdef.pm,v 1.326 2006/04/11 18:42:43 albertel Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -569,10 +569,7 @@
$currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"';
}
$currentstring.='>';
- &Apache::lontexconvert::jsMath_reset();
- if ($env{'environment.texengine'} eq 'jsMath') {
- $currentstring.=&Apache::lontexconvert::jsMath_header();
- }
+ $currentstring.=&Apache::lontexconvert::init_math_support();
if ($env{'request.state'} ne 'published') {
if ($env{'environment.remote'} eq 'off') {
$currentstring.=
Index: loncom/xml/lontexconvert.pm
diff -u loncom/xml/lontexconvert.pm:1.71 loncom/xml/lontexconvert.pm:1.72
--- loncom/xml/lontexconvert.pm:1.71 Mon Mar 27 15:40:42 2006
+++ loncom/xml/lontexconvert.pm Tue Apr 11 14:42:43 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# TeX Conversion Module
#
-# $Id: lontexconvert.pm,v 1.71 2006/03/27 20:40:42 albertel Exp $
+# $Id: lontexconvert.pm,v 1.72 2006/04/11 18:42:43 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,7 +42,6 @@
use strict;
use tth();
use vars qw($errorstring);
-use Apache();
use Apache::lonmsg();
use Apache::lonxml();
use Apache::lonmenu();
@@ -190,6 +189,15 @@
}
}
+sub init_math_support {
+ &Apache::lontexconvert::jsMath_reset();
+ if ($env{'environment.texengine'} eq 'jsMath' ||
+ $env{'form.texengine'} eq 'jsMath' ) {
+ return &Apache::lontexconvert::jsMath_header();
+ }
+ return;
+}
+
sub mimetex_converted {
my $texstring=shift;
my $displaystyle=&displaystyle($texstring);
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.340 loncom/homework/structuretags.pm:1.341
--- loncom/homework/structuretags.pm:1.340 Thu Mar 30 15:16:14 2006
+++ loncom/homework/structuretags.pm Tue Apr 11 14:42:58 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.340 2006/03/30 20:16:14 albertel Exp $
+# $Id: structuretags.pm,v 1.341 2006/04/11 18:42:58 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -89,10 +89,8 @@
}
$body_tag_start.='>'.&Apache::lonmenu::menubuttons(undef,$target,1);
- &Apache::lontexconvert::jsMath_reset();
- if ($env{'environment.texengine'} eq 'jsMath') {
- $body_tag_start.=&Apache::lontexconvert::jsMath_header();
- }
+ $body_tag_start.=&Apache::lontexconvert::init_math_support();
+
return $body_tag_start;
}