--- loncom/xml/londefdef.pm 2004/11/13 08:56:53 1.244 +++ loncom/xml/londefdef.pm 2004/11/19 22:16:33 1.247 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.244 2004/11/13 08:56:53 albertel Exp $ +# $Id: londefdef.pm,v 1.247 2004/11/19 22:16:33 albertel Exp $ # # # Copyright Michigan State University Board of Trustees @@ -155,7 +155,7 @@ sub start_html { $currentstring = &Apache::lonxml::xmlbegin(); } elsif ($target eq 'tex') { @Apache::londefdef::table = (); - $currentstring .= '\documentclass[letterpaper]{book}'; + $currentstring .= '\documentclass[letterpaper]{article}'; if ($ENV{'form.latex_type'}=~'batchmode') {$currentstring .='\batchmode';} $currentstring .= '\newcommand{\keephidden}[1]{}'. '\renewcommand{\deg}{$^{\circ}$}'. @@ -531,12 +531,19 @@ sub start_body { $token->[2]->{'onunload'}=&Apache::lonmenu::unloadevents(). ';'.$onUnload; - $currentstring .= '<'.$token->[1]; + if ($ENV{'request.state'} ne 'construct') { + $currentstring .= '<'.$token->[1]; + } foreach (keys %{$token->[2]}) { $currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"'; } - $currentstring.='>'; + if ($ENV{'request.state'} ne 'construct') { + $currentstring.='>'; + } if ($ENV{'request.state'} ne 'published') { + my $remote=($ENV{'environment.remote'} ne 'off'); + $currentstring=&Apache::loncommon::bodytag(undef,undef, + $currentstring,$remote); $currentstring.=(< @@ -2452,7 +2459,7 @@ sub start_img { if (-e $newsrc) { #eps counterpart for image exist if ($path) { - $currentstring .= '\vskip 1 mm \noindent\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; + $currentstring .= '\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; } } else { #there is no eps counterpart for image - check for ps one @@ -2461,11 +2468,11 @@ sub start_img { #ps counterpart for image exist $file =~ s/\.eps$/\.ps/; if ($path) { - $currentstring .= '\vskip 1 mm \noindent\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; + $currentstring .= '\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; } } else { #care about eps dynamical generation - $currentstring.='\vskip 1 mm '.&eps_generation($src,$file,$width_param); + $currentstring.=&eps_generation($src,$file,$width_param); } } } else {