--- loncom/xml/londefdef.pm 2001/11/29 19:03:58 1.34 +++ loncom/xml/londefdef.pm 2001/12/28 20:41:01 1.37 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.34 2001/11/29 19:03:58 www Exp $ +# $Id: londefdef.pm,v 1.37 2001/12/28 20:41:01 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,7 +51,7 @@ sub BEGIN { } -#===================================================================== TAG SUBROUTINES +#======================= TAG SUBROUTINES ===================== #-- sub start_output { my ($target) = @_; @@ -70,13 +70,18 @@ sub start_m { if ($target eq 'web') { my $inside = &Apache::lonxml::get_all_text("/m",$$parser[-1]); $inside ='\\documentstyle{article}'.$inside; - #&Apache::lonxml::debug("M is starting with:$inside:"); + &Apache::lonxml::debug("M is starting with:$inside:"); my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval); if ($eval eq 'on') { $inside=&Apache::run::evaluate($inside,$safeeval,$$parstack[-1]); #&Apache::lonxml::debug("M is evaulated to:$inside:"); } $currentstring = &Apache::lontexconvert::converted(\$inside); + if ($Apache::lontexconvert::errorstring) { + &Apache::lonxml::warning("tth error: ". + $Apache::lontexconvert::errorstring); + $Apache::lontexconvert::errorstring=''; + } #&Apache::lonxml::debug("M is ends with:$currentstring:"); } elsif ($target eq 'tex') { $currentstring = ""; @@ -93,14 +98,25 @@ sub end_m { } return $currentstring; } -#-------------------------------------------------------------------------- tag +#-- tag sub start_html { my ($target,$token) = @_; my $currentstring = ''; if ($target eq 'web') { $currentstring = &Apache::lonxml::xmlbegin(). &Apache::lonxml::fontsettings(); - } + } elsif ($target eq 'tex') { + $currentstring .= '\documentclass[letterpaper]{article} + \setlength{\oddsidemargin}{-40pt} + \setlength{\evensidemargin}{-60pt} + \setlength{\topmargin}{200pt} + \setlength{\textwidth}{4.4in} + \setlength{\textheight}{6.8in} + \setlength{\parindent}{20pt} + \setlength{\marginparwidth}{90pt} + \setlength{\textfloatsep}{8pt plus 2.0pt minus 4.0pt} + \newcommand{\keephidden}[1]{}'; + } return $currentstring; } sub end_html { @@ -108,10 +124,10 @@ sub end_m { my $currentstring = ''; if ($target eq 'web') { $currentstring = &Apache::lonxml::xmlend(); - } + } return $currentstring; } -#-------------------------------------------------------------------------- tag +#-- tag sub start_head { my ($target,$token) = @_; my $currentstring = ''; @@ -129,7 +145,7 @@ sub end_m { } return $currentstring; } -#--------------------------------------------------------------------------- tag +#-- tag sub start_map { my ($target,$token) = @_; my $currentstring = ''; @@ -146,8 +162,7 @@ sub end_m { } return $currentstring; } - -#------------------------------------------------------------------------ tag sub start_select { my ($target,$token) = @_; my $currentstring = ''; @@ -164,7 +179,7 @@ sub end_m { } return $currentstring; } -#------------------------------------------------------------------------