--- loncom/xml/londefdef.pm 2016/08/13 20:01:52 1.456.2.2 +++ loncom/xml/londefdef.pm 2016/01/06 16:44:37 1.457 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.456.2.2 2016/08/13 20:01:52 raeburn Exp $ +# $Id: londefdef.pm,v 1.457 2016/01/06 16:44:37 damieng Exp $ # # # Copyright Michigan State University Board of Trustees @@ -638,6 +638,12 @@ sub edit_controls { } $result .= '
'; + if ($env{'browser.type'} ne 'explorer' || $env{'browser.version'} > 9) { + my $uri = $env{'request.uri'}; + my $daxeurl = '/daxepage'.$uri; + $result .= ''; + } if (($env{'request.course.id'}) && ($env{'form.forceedit'})) { my $url=&Apache::lonnet::hreflocation('',$env{'request.filename'}); if ($url =~ /\.html?$/i) { @@ -2063,8 +2069,8 @@ sub end_dt { sub item_cleanup { my $item=&Apache::lonxml::endredirection(); - $item=~s/\\begin\{center}//g; - $item=~s/\\end\{center}//g; + $item=~s/\\begin{center}//g; + $item=~s/\\end{center}//g; return $item; } @@ -4440,17 +4446,17 @@ sub LATEX_length { $garbage=~s/^\s+(\S.*)/$1/;#space before $garbage=~s/(.*\S)\s+$/$1/;#space after $garbage=~s/(\s)+/$1/;#only one space - $garbage=~s/(\\begin\{([^\}]+)}|\\end\{([^\}]+)})//g;#remove LaTeX \begin{...} and \end{...} - $garbage=~s/(\$\_\{|\$\_|\$\^\{|\$\^|\}\$)//g;#remove $_{,$_,$^{,$^,}$ + $garbage=~s/(\\begin{([^\}]+)}|\\end{([^\}]+)})//g;#remove LaTeX \begin{...} and \end{...} + $garbage=~s/(\$\_\{|\$\_|\$\^{|\$\^|\}\$)//g;#remove $_{,$_,$^{,$^,}$ $garbage=~s/([^\\])\$/$1/g;#$ - $garbage=~s/(\\ensuremath\{\_\{|\\ensuremath\{\_|\\ensuremath\{\^\{|\\ensuremath\{\^|\})//g;#remove \ensuremath{...} + $garbage=~s/(\\ensuremath\{\_\{|\\ensuremath\{\_|\\ensuremath\{\^{|\\ensuremath\{\^|\})//g;#remove \ensuremath{...} $garbage=~s/(\\alpha|\\beta|\\gamma|\\delta|\\epsilon|\\verepsilon|\\zeta|\\eta|\\theta|\\vartheta|\\iota|\\kappa|\\lambda|\\mu|\\nu|\\xi|\\pi|\\varpi|\\rho|\\varrho|\\sigma|\\varsigma|\\tau|\\upsilon|\\phi|\\varphi|\\chi|\\psi|\\omega|\\Gamma|\\Delta|\\Theta|\\Lambda|\\Xi|\\Pi|\\Sigma|\\Upsilon|\\Phi|\\Psi|\\Omega)/1/g; $garbage=~s/(\\pm|\\mp|\\times|\\div|\\cdot|\\ast|\\star|\\dagger|\\ddagger|\\amalg|\\cap|\\cup|\\uplus|\\sqcap|\\sqcup|\\vee|\\wedge|\\oplus|\\ominus|\\otimes|\\circ|\\bullet|\\diamond|\\lhd|\\rhd|\\unlhd|\\unrhd|\\oslash|\\odot|\\bigcirc|\\Box|\\Diamond|\\bigtriangleup|\\bigtriangledown|\\triangleleft|\\triangleright|\\setminus|\\wr)/1/g; $garbage=~s/(\\le|\\ll|\\leq|\\ge|\\geq|\\gg|\\neq|\\doreq|\\sim|\\simeq|\\subset|\\subseteq|\\sqsubset|\\sqsubseteq|\\in|\\vdash|\\models|\\supset|\\supseteq|\\sqsupset|\\sqsupseteq|\\ni|\\dash|\\perp|\\approx|\\cong|\\equiv|\\propto|\\prec|\\preceq|\\parallel|\\asymp|\\smile|\\frown|\\bowtie|\\succ|\\succeq|\\mid)/1/g; $garbage=~s/(\\not<|\\\\not\\le|\\not\\prec|\\not\\preceq|\\not\\subset|\\not\\subseteq|\\not\\sqsubseteq|\\not\\in|\\not>|\\not\\ge|\\not\\succ|\\notsucceq|\\not\\supset|\\notsupseteq|\\not\\sqsupseteq|\\notin|\\not=|\\not\\equiv|\\not\\sim|\\not\\simeq|\\not\\approx|\\not\\cong|\\not\\asymp)/1/g; $garbage=~s/(\\leftarrow|\\gets|\\Leftarrow|\\rightarrow|\\to|\\Rightarrow|\\leftrightarrow|\\Leftrightarrow|\\mapsto|\\hookleftarrow|\\leftharpoonup|\\leftkarpoondown|\\rightleftharpoons|\\longleftarrow|\\Longleftarrow|\\longrightarrow|\\Longrightarrow|\\longleftrightarrow|\\Longleftrightarrow|\\longmapsto|\\hookrightarrow|\\rightharpoonup|\\rightharpoondown|\\uparrow|\\Uparrow|\\downarrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\nearrow|\\searrow|\\swarrow|\\nwarrow)/11/g; $garbage=~s/(\\aleph|\\hbar|\\imath|\\jmath|\\ell|\\wp|\\Re|\\Im|\\mho|\\prime|\\emptyset|\\nabla|\\surd|\\partial|\\top|\\bot|\\vdash|\\dashv|\\forall|\\exists|\\neg|\\flat|\\natural|\\sharp|\\\||\\angle|\\backslash|\\Box|\\Diamond|\\triangle|\\clubsuit|\\diamondsuit|\\heartsuit|\\spadesuit|\\Join|\\infty)/11/g; - $garbage=~s/(\\hat\{([^}]+)}|\\check\{([^}]+)}|\\dot\{([^}]+)}|\\breve\{([^}]+)}|\\acute\{([^}]+)}|\\ddot\{([^}]+)}|\\grave\{([^}]+)}|\\tilde\{([^}]+)}|\\mathring\{([^}]+)}|\\bar\{([^}]+)}|\\vec\{([^}]+)})/$1/g; + $garbage=~s/(\\hat{([^}]+)}|\\check{([^}]+)}|\\dot{([^}]+)}|\\breve{([^}]+)}|\\acute{([^}]+)}|\\ddot{([^}]+)}|\\grave{([^}]+)}|\\tilde{([^}]+)}|\\mathring{([^}]+)}|\\bar{([^}]+)}|\\vec{([^}]+)})/$1/g; #remove some other LaTeX command $garbage=~s|\\(\w+)\\|\\|g; $garbage=~s|\\(\w+)(\s*)|$2|g; @@ -4552,34 +4558,40 @@ sub latex_header { ($mode eq 'batchmode')) {$currentstring .='\batchmode';} $currentstring .= '\newcommand{\keephidden}[1]{}'. '\renewcommand{\deg}{$^{\circ}$}'. - '\usepackage{multirow}'."\n". - '\usepackage{longtable}'."\n". - '\usepackage{textcomp}'."\n". - '\usepackage{makeidx}'."\n". - '\usepackage[dvips]{graphicx}'."\n". - '\usepackage{wrapfig}'."\n". - '\usepackage{picins}'."\n". + '\usepackage{multirow}'. + '\usepackage{longtable}'. + '\usepackage{textcomp}'. + '\usepackage{makeidx}'. + '\usepackage[dvips]{graphicx}'. + '\usepackage{wrapfig}'. + '\usepackage{picins}'. '\usepackage[T1]{fontenc}'."\n". '\usepackage{lmodern}'."\n". '\usepackage[postscript]{ucs}'."\n". '\usepackage[utf8x]{inputenc}'."\n". - '\usepackage{pifont}'."\n". + '\usepackage{pifont}' ."\n". '\usepackage{latexsym}'."\n". - '\usepackage{epsfig}'."\n". - '\usepackage{xtab}'."\n". - '\usepackage{tabularx}'."\n". - '\usepackage{booktabs}'."\n". - '\usepackage{array}'."\n". - '\usepackage{colortbl}'."\n". - '\usepackage{xcolor}'."\n". - '\usepackage{calc}'."\n". - '\usepackage{amsmath}'."\n". - '\usepackage{soul}'."\n". - '\usepackage{amssymb}'."\n". - '\usepackage{amsfonts}'."\n". - '\usepackage{amsthm}'."\n". - '\usepackage{amscd}'."\n". - '\usepackage{actuarialangle}'."\n"; + '\usepackage{epsfig}'. + "\\usepackage{xtab}\n". + "\\usepackage{tabularx}\n". + "\\usepackage{booktabs}\n". + "\\usepackage{array}\n". + "\\usepackage{colortbl}\n". + "\\usepackage{xcolor}\n". + '\usepackage{calc}'. + '\usepackage{amsmath}'. + '\usepackage{soul}'. + '\usepackage{amssymb}'. + '\usepackage{amsfonts}'. + '\usepackage{amsthm}'. + '\usepackage{amscd}' + .'\usepackage{picins}\usepackage{calc}'."\n". # From lonprintout.pm + '\usepackage[T1]{fontenc}'."\n". + '\usepackage{lmodern}'."\n". + '\usepackage[postscript]{ucs}'."\n". + '\usepackage[utf8x]{inputenc}'."\n". + '\usepackage{pifont}' . "\n"; + if($env{'form.pdfFormFields'} eq 'yes') { $currentstring .= '\usepackage{hyperref}'. '\usepackage{eforms}'.