[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Fri, 12 Mar 2004 16:23:23 -0000


This is a MIME encoded message

--sakharuk1079108603
Content-Type: text/plain

sakharuk		Fri Mar 12 11:23:23 2004 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Changed math environment from $..$ to \ensuremath{..}. That allow just escape dollar sign in thext without special care about math environment.
  
  
--sakharuk1079108603
Content-Type: text/plain
Content-Disposition: attachment; filename="sakharuk-20040312112323.txt"

Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.280 loncom/interface/lonprintout.pm:1.281
--- loncom/interface/lonprintout.pm:1.280	Thu Feb 26 15:50:00 2004
+++ loncom/interface/lonprintout.pm	Fri Mar 12 11:23:23 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.280 2004/02/26 20:50:00 albertel Exp $
+# $Id: lonprintout.pm,v 1.281 2004/03/12 16:23:23 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -89,8 +89,8 @@
     $result =~ s/&\#0?58;/:/g;
     $result =~ s/&\#0?59;/;/g;
     $result =~ s/&(\#0?60|lt|\#139);/\$<\$/g;
-    $result =~ s/&\#0?61;/\$=\$/g;
-    $result =~ s/&(\#0?62|gt|\#155);/\$>\$/g;
+    $result =~ s/&\#0?61;/\\ensuremath\{=\}/g;
+    $result =~ s/&(\#0?62|gt|\#155);/\\ensuremath\{>\}/g;
     $result =~ s/&\#0?63;/\?/g;
     $result =~ s/&\#0?65;/A/g;
     $result =~ s/&\#0?66;/B/g;
@@ -119,9 +119,9 @@
     $result =~ s/&\#0?89;/Y/g;
     $result =~ s/&\#0?90;/Z/g;
     $result =~ s/&\#0?91;/[/g;
-    $result =~ s/&\#0?92;/\$\\setminus\$/g;
+    $result =~ s/&\#0?92;/\\ensuremath\{\\setminus\}/g;
     $result =~ s/&\#0?93;/]/g;
-    $result =~ s/&\#(0?94|136);/\$\\wedge\$/g;
+    $result =~ s/&\#(0?94|136);/\\ensuremath\{\\wedge\}/g;
     $result =~ s/&\#(0?95|138|154);/\\underline{\\makebox[2mm]{\\strut}}/g;
     $result =~ s/&\#(0?96|145);/\`/g;
     $result =~ s/&\#0?97;/a/g;
@@ -156,17 +156,17 @@
     $result =~ s/&\#126;/\~/g;
     $result =~ s/&\#131;/\\textflorin /g;
     $result =~ s/&\#132;/\"/g;
-    $result =~ s/&\#133;/\$\\ldots\$/g;
-    $result =~ s/&\#134;/\$\\dagger\$/g;
-    $result =~ s/&\#135;/\$\\ddagger\$/g;
+    $result =~ s/&\#133;/\\ensuremath\{\\ldots\}/g;
+    $result =~ s/&\#134;/\\ensuremath\{\\dagger\}/g;
+    $result =~ s/&\#135;/\\ensuremath\{\\ddagger\}/g;
     $result =~ s/&\#137;/\\textperthousand /g;
     $result =~ s/&\#140;/{\\OE}/g;
     $result =~ s/&\#147;/\`\`/g;
     $result =~ s/&\#148;/\'\'/g;
-    $result =~ s/&\#149;/\$\\bullet\$/g;
+    $result =~ s/&\#149;/\\ensuremath\{\\bullet\}/g;
     $result =~ s/&\#150;/--/g;
     $result =~ s/&\#151;/---/g;
-    $result =~ s/&\#152;/\$\\sim\$/g;
+    $result =~ s/&\#152;/\\ensuremath\{\\sim\}/g;
     $result =~ s/&\#153;/\\texttrademark /g;
     $result =~ s/&\#156;/\\oe/g;
     $result =~ s/&\#159;/\\\"Y/g;
@@ -181,20 +181,20 @@
     $result =~ s/&(\#168|uml);/\\texthighdieresis /g;
     $result =~ s/&(\#169|copy);/\\copyright /g;
     $result =~ s/&(\#170|ordf);/\\textordfeminine /g;
-    $result =~ s/&(\#172|not);/\$\\neg\$/g;
+    $result =~ s/&(\#172|not);/\\ensuremath\{\\neg\}/g;
     $result =~ s/&(\#173|shy);/ - /g;
     $result =~ s/&(\#174|reg);/\\textregistered /g;
-    $result =~ s/&(\#175|macr);/\$^{-}\$/g;
-    $result =~ s/&(\#176|deg);/\$^{\\circ}\$/g;
-    $result =~ s/&(\#177|plusmn);/\$\\pm\$/g;
-    $result =~ s/&(\#178|sup2);/\$^2\$/g;
-    $result =~ s/&(\#179|sup3);/\$^3\$/g;
+    $result =~ s/&(\#175|macr);/\\ensuremath\{^{-}\}/g;
+    $result =~ s/&(\#176|deg);/\\ensuremath\{^{\\circ}\}/g;
+    $result =~ s/&(\#177|plusmn);/\\ensuremath\{\\pm\}/g;
+    $result =~ s/&(\#178|sup2);/\\ensuremath\{^2\}/g;
+    $result =~ s/&(\#179|sup3);/\\ensuremath\{^3\}/g;
     $result =~ s/&(\#180|acute);/\\textacute /g;
-    $result =~ s/&(\#181|micro);/\$\\mu\$/g;
+    $result =~ s/&(\#181|micro);/\\ensuremath\{\\mu\}/g;
     $result =~ s/&(\#182|para);/\\P/g;
-    $result =~ s/&(\#183|middot);/\$\\cdot\$/g;
+    $result =~ s/&(\#183|middot);/\\ensuremath\{\\cdot\}/g;
     $result =~ s/&(\#184|cedil);/\\c{\\strut}/g;
-    $result =~ s/&(\#185|sup1);/\$^1\$/g;
+    $result =~ s/&(\#185|sup1);/\\ensuremath\{^1\}/g;
     $result =~ s/&(\#186|ordm);/\\textordmasculine /g;
     $result =~ s/&(\#188|frac14);/\\textonequarter /g;
     $result =~ s/&(\#189|frac12);/\\textonehalf /g;
@@ -222,7 +222,7 @@
     $result =~ s/&(\#212|Ocirc);/\\^{O}/g;
     $result =~ s/&(\#213|Otilde);/\\~{O}/g;
     $result =~ s/&(\#214|Ouml);/\\\"{O}/g;    
-    $result =~ s/&(\#215|times);/\$\\times\$/g;
+    $result =~ s/&(\#215|times);/\\ensuremath\{\\times\}/g;
     $result =~ s/&(\#216|Oslash);/{\\O}/g;
     $result =~ s/&(\#217|Ugrave);/\\\`{U}/g;    
     $result =~ s/&(\#218|Uacute);/\\\'{U}/g;
@@ -246,14 +246,14 @@
     $result =~ s/&(\#237|iacute);/\\\'{i}/g;
     $result =~ s/&(\#238|icirc);/\\^{i}/g;
     $result =~ s/&(\#239|iuml);/\\\"{i}/g;
-    $result =~ s/&(\#240|eth);/\$\\partial\$/g;
+    $result =~ s/&(\#240|eth);/\\ensuremath\{\\partial\}/g;
     $result =~ s/&(\#241|ntilde);/\\~{n}/g;
     $result =~ s/&(\#242|ograve);/\\\`{o}/g;
     $result =~ s/&(\#243|oacute);/\\\'{o}/g;
     $result =~ s/&(\#244|ocirc);/\\^{o}/g;
     $result =~ s/&(\#245|otilde);/\\~{o}/g;
     $result =~ s/&(\#246|ouml);/\\\"{o}/g;
-    $result =~ s/&(\#247|divide);/\$\\div\$/g;
+    $result =~ s/&(\#247|divide);/\\ensuremath\{\\div\}/g;
     $result =~ s/&(\#248|oslash);/{\\o}/g;
     $result =~ s/&(\#249|ugrave);/\\\`{u}/g; 
     $result =~ s/&(\#250|uacute);/\\\'{u}/g;
@@ -261,114 +261,114 @@
     $result =~ s/&(\#252|uuml);/\\\"{u}/g;
     $result =~ s/&(\#253|yacute);/\\\'{y}/g;
     $result =~ s/&(\#255|yuml);/\\\"{y}/g;
-    $result =~ s/&\#952;/\$\\theta\$/g;
+    $result =~ s/&\#952;/\\ensuremath\{\\theta\}/g;
 #Greek Alphabet
-    $result =~ s/&(alpha|\#945);/\$\\alpha \$/g;
-    $result =~ s/&(beta|\#946);/\$\\beta \$/g;
-    $result =~ s/&(gamma|\#947);/\$\\gamma \$/g;
-    $result =~ s/&(delta|\#948);/\$\\delta \$/g;
-    $result =~ s/&(epsilon|\#949);/\$\\epsilon \$/g;
-    $result =~ s/&(zeta|\#950);/\$\\zeta \$/g;
-    $result =~ s/&(eta|\#951);/\$\\eta \$/g;
-    $result =~ s/&(theta|\#952);/\$\\theta \$/g;
-    $result =~ s/&(iota|\#953);/\$\\iota \$/g;
-    $result =~ s/&(kappa|\#954);/\$\\kappa \$/g;
-    $result =~ s/&(lambda|\#955);/\$\\lambda \$/g;
-    $result =~ s/&(mu|\#956);/\$\\mu \$/g;
-    $result =~ s/&(nu|\#957);/\$\\nu \$/g;
-    $result =~ s/&(xi|\#958);/\$\\xi \$/g;
+    $result =~ s/&(alpha|\#945);/\\ensuremath\{\\alpha\}/g;
+    $result =~ s/&(beta|\#946);/\\ensuremath\{\\beta\}/g;
+    $result =~ s/&(gamma|\#947);/\\ensuremath\{\\gamma\}/g;
+    $result =~ s/&(delta|\#948);/\\ensuremath\{\\delta\}/g;
+    $result =~ s/&(epsilon|\#949);/\\ensuremath\{\\epsilon\}/g;
+    $result =~ s/&(zeta|\#950);/\\ensuremath\{\\zeta\}/g;
+    $result =~ s/&(eta|\#951);/\\ensuremath\{\\eta\}/g;
+    $result =~ s/&(theta|\#952);/\\ensuremath\{\\theta\}/g;
+    $result =~ s/&(iota|\#953);/\\ensuremath\{\\iota\}/g;
+    $result =~ s/&(kappa|\#954);/\\ensuremath\{\\kappa\}/g;
+    $result =~ s/&(lambda|\#955);/\\ensuremath\{\\lambda\}/g;
+    $result =~ s/&(mu|\#956);/\\ensuremath\{\\mu\}/g;
+    $result =~ s/&(nu|\#957);/\\ensuremath\{\\nu\}/g;
+    $result =~ s/&(xi|\#958);/\\ensuremath\{\\xi\}/g;
     $result =~ s/&(omicron|\#959);/o/g;
-    $result =~ s/&(pi|\#960);/\$\\pi \$/g;
-    $result =~ s/&(rho|\#961);/\$\\rho \$/g;
-    $result =~ s/&(sigma|\#963);/\$\\sigma \$/g;
-    $result =~ s/&(tau|\#964);/\$\\tau \$/g;
-    $result =~ s/&(upsilon|\#965);/\$\\upsilon \$/g;
-    $result =~ s/&(phi|\#966);/\$\\phi \$/g;
-    $result =~ s/&(chi|\#967);/\$\\chi \$/g;
-    $result =~ s/&(psi|\#968);/\$\\psi \$/g;
-    $result =~ s/&(omega|\#969);/\$\\omega \$/g;
-    $result =~ s/&(thetasym|\#977);/\$\\vartheta \$/g;
-    $result =~ s/&(piv|\#982);/\$\\varpi \$/g;
+    $result =~ s/&(pi|\#960);/\\ensuremath\{\\pi\}/g;
+    $result =~ s/&(rho|\#961);/\\ensuremath\{\\rho\}/g;
+    $result =~ s/&(sigma|\#963);/\\ensuremath\{\\sigma\}/g;
+    $result =~ s/&(tau|\#964);/\\ensuremath\{\\tau\}/g;
+    $result =~ s/&(upsilon|\#965);/\\ensuremath\{\\upsilon\}/g;
+    $result =~ s/&(phi|\#966);/\\ensuremath\{\\phi\}/g;
+    $result =~ s/&(chi|\#967);/\\ensuremath\{\\chi\}/g;
+    $result =~ s/&(psi|\#968);/\\ensuremath\{\\psi\}/g;
+    $result =~ s/&(omega|\#969);/\\ensuremath\{\\omega\}/g;
+    $result =~ s/&(thetasym|\#977);/\\ensuremath\{\\vartheta\}/g;
+    $result =~ s/&(piv|\#982);/\\ensuremath\{\\varpi\}/g;
     $result =~ s/&(Alpha|\#913);/A/g;
     $result =~ s/&(Beta|\#914);/B/g;
-    $result =~ s/&(Gamma|\#915);/\$\\Gamma \$/g;
-    $result =~ s/&(Delta|\#916);/\$\\Delta \$/g;
+    $result =~ s/&(Gamma|\#915);/\\ensuremath\{\\Gamma\}/g;
+    $result =~ s/&(Delta|\#916);/\\ensuremath\{\\Delta\}/g;
     $result =~ s/&(Epsilon|\#917);/E/g;
     $result =~ s/&(Zeta|\#918);/Z/g;
     $result =~ s/&(Eta|\#919);/H/g;
-    $result =~ s/&(Theta|\#920);/\$\\Theta \$/g;
+    $result =~ s/&(Theta|\#920);/\\ensuremath\{\\Theta\}/g;
     $result =~ s/&(Iota|\#921);/I/g;
     $result =~ s/&(Kappa|\#922);/K/g;
-    $result =~ s/&(Lambda|\#923);/\$\\Lambda \$/g;
+    $result =~ s/&(Lambda|\#923);/\\ensuremath\{\\Lambda\}/g;
     $result =~ s/&(Mu|\#924);/M/g;
     $result =~ s/&(Nu|\#925);/N/g;
-    $result =~ s/&(Xi|\#926);/\$\\Xi \$/g;
+    $result =~ s/&(Xi|\#926);/\\ensuremath\{\\Xi\}/g;
     $result =~ s/&(Omicron|\#927);/O/g;
-    $result =~ s/&(Pi|\#928);/\$\\Pi \$/g;
+    $result =~ s/&(Pi|\#928);/\\ensuremath\{\\Pi\}/g;
     $result =~ s/&(Rho|\#929);/P/g;
-    $result =~ s/&(Sigma|\#931);/\$\\Sigma \$/g;
+    $result =~ s/&(Sigma|\#931);/\\ensuremath\{\\Sigma\}/g;
     $result =~ s/&(Tau|\#932);/T/g;
-    $result =~ s/&(Upsilon|\#933);/\$\\Upsilon \$/g;
-    $result =~ s/&(Phi|\#934);/\$\\Phi \$/g;
+    $result =~ s/&(Upsilon|\#933);/\\ensuremath\{\\Upsilon\}/g;
+    $result =~ s/&(Phi|\#934);/\\ensuremath\{\\Phi\}/g;
     $result =~ s/&(Chi|\#935);/X/g;
-    $result =~ s/&(Psi|\#936);/\$\\Psi \$/g;
-    $result =~ s/&(Omega|\#937);/\$\\Omega \$/g;
+    $result =~ s/&(Psi|\#936);/\\ensuremath\{\\Psi\}/g;
+    $result =~ s/&(Omega|\#937);/\\ensuremath\{\\Omega\}/g;
 #Arrows (extended HTML 4.01)
-    $result =~ s/&(larr|\#8592);/\$\\leftarrow \$/g;
-    $result =~ s/&(uarr|\#8593);/\$\\uparrow \$/g;
-    $result =~ s/&(rarr|\#8594);/\$\\rightarrow \$/g;
-    $result =~ s/&(darr|\#8595);/\$\\downarrow \$/g;
-    $result =~ s/&(harr|\#8596);/\$\\leftrightarrow \$/g;
-    $result =~ s/&(lArr|\#8656);/\$\\Leftarrow \$/g;
-    $result =~ s/&(uArr|\#8657);/\$\\Uparrow \$/g;
-    $result =~ s/&(rArr|\#8658);/\$\\Rightarrow \$/g;
-    $result =~ s/&(dArr|\#8659);/\$\\Downarrow \$/g;
-    $result =~ s/&(hArr|\#8660);/\$\\Leftrightarrow \$/g;
+    $result =~ s/&(larr|\#8592);/\\ensuremath\{\\leftarrow\}/g;
+    $result =~ s/&(uarr|\#8593);/\\ensuremath\{\\uparrow\}/g;
+    $result =~ s/&(rarr|\#8594);/\\ensuremath\{\\rightarrow\}/g;
+    $result =~ s/&(darr|\#8595);/\\ensuremath\{\\downarrow\}/g;
+    $result =~ s/&(harr|\#8596);/\\ensuremath\{\\leftrightarrow\}/g;
+    $result =~ s/&(lArr|\#8656);/\\ensuremath\{\\Leftarrow\}/g;
+    $result =~ s/&(uArr|\#8657);/\\ensuremath\{\\Uparrow\}/g;
+    $result =~ s/&(rArr|\#8658);/\\ensuremath\{\\Rightarrow\}/g;
+    $result =~ s/&(dArr|\#8659);/\\ensuremath\{\\Downarrow\}/g;
+    $result =~ s/&(hArr|\#8660);/\\ensuremath\{\\Leftrightarrow\}/g;
 #Mathematical Operators (extended HTML 4.01)
-    $result =~ s/&(forall|\#8704);/\$\\forall \$/g;
-    $result =~ s/&(part|\#8706);/\$\\partial \$/g;
-    $result =~ s/&(exist|\#8707);/\$\\exists \$/g;
-    $result =~ s/&(empty|\#8709);/\$\\emptyset \$/g;
-    $result =~ s/&(nabla|\#8711);/\$\\nabla \$/g;
-    $result =~ s/&(isin|\#8712);/\$\\in \$/g;
-    $result =~ s/&(notin|\#8713);/\$\\notin \$/g;
-    $result =~ s/&(ni|\#8715);/\$\\ni \$/g;
-    $result =~ s/&(prod|\#8719);/\$\\prod \$/g;
-    $result =~ s/&(sum|\#8721);/\$\\sum \$/g;
-    $result =~ s/&(minus|\#8722);/\$-\$/g;
-    $result =~ s/&(lowast|\#8727);/\$*\$/g;
-    $result =~ s/&(radic|\#8730);/\$\\surd \$/g;
-    $result =~ s/&(prop|\#8733);/\$\\propto \$/g;
-    $result =~ s/&(infin|\#8734);/\$\\infty \$/g;
-    $result =~ s/&(ang|\#8736);/\$\\angle \$/g;
-    $result =~ s/&(and|\#8743);/\$\\wedge \$/g;
-    $result =~ s/&(or|\#8744);/\$\\vee \$/g;
-    $result =~ s/&(cap|\#8745);/\$\\cap \$/g;
-    $result =~ s/&(cup|\#8746);/\$\\cup \$/g;
-    $result =~ s/&(int|\#8747);/\$\\int \$/g;
-    $result =~ s/&(sim|\#8764);/\$\\sim \$/g;
-    $result =~ s/&(cong|\#8773);/\$\\cong \$/g;
-    $result =~ s/&(asymp|\#8776);/\$\\approx \$/g;
-    $result =~ s/&(ne|\#8800);/\$\\not= \$/g;
-    $result =~ s/&(equiv|\#8801);/\$\\equiv \$/g;
-    $result =~ s/&(le|\#8804);/\$\\leq \$/g;
-    $result =~ s/&(ge|\#8805);/\$\\geq \$/g;
-    $result =~ s/&(sub|\#8834);/\$\\subset \$/g;
-    $result =~ s/&(sup|\#8835);/\$\\supset \$/g;
-    $result =~ s/&(nsub|\#8836);/\$\\not\\subset \$/g;
-    $result =~ s/&(sube|\#8838);/\$\\subseteq \$/g;
-    $result =~ s/&(supe|\#8839);/\$\\supseteq \$/g;
-    $result =~ s/&(oplus|\#8853);/\$\\oplus \$/g;
-    $result =~ s/&(otimes|\#8855);/\$\\otimes \$/g;
-    $result =~ s/&(perp|\#8869);/\$\\perp \$/g;
-    $result =~ s/&(sdot|\#8901);/\$\\cdot \$/g;
+    $result =~ s/&(forall|\#8704);/\\ensuremath\{\\forall\}/g;
+    $result =~ s/&(part|\#8706);/\\ensuremath\{\\partial\}/g;
+    $result =~ s/&(exist|\#8707);/\\ensuremath\{\\exists\}/g;
+    $result =~ s/&(empty|\#8709);/\\ensuremath\{\\emptyset\}/g;
+    $result =~ s/&(nabla|\#8711);/\\ensuremath\{\\nabla\}/g;
+    $result =~ s/&(isin|\#8712);/\\ensuremath\{\\in\}/g;
+    $result =~ s/&(notin|\#8713);/\\ensuremath\{\\notin\}/g;
+    $result =~ s/&(ni|\#8715);/\\ensuremath\{\\ni\}/g;
+    $result =~ s/&(prod|\#8719);/\\ensuremath\{\\prod\}/g;
+    $result =~ s/&(sum|\#8721);/\\ensuremath\{\\sum\}/g;
+    $result =~ s/&(minus|\#8722);/\\ensuremath\{-\}/g;
+    $result =~ s/&(lowast|\#8727);/\\ensuremath\{*\}/g;
+    $result =~ s/&(radic|\#8730);/\\ensuremath\{\\surd\}/g;
+    $result =~ s/&(prop|\#8733);/\\ensuremath\{\\propto\}/g;
+    $result =~ s/&(infin|\#8734);/\\ensuremath\{\\infty\}/g;
+    $result =~ s/&(ang|\#8736);/\\ensuremath\{\\angle\}/g;
+    $result =~ s/&(and|\#8743);/\\ensuremath\{\\wedge\}/g;
+    $result =~ s/&(or|\#8744);/\\ensuremath\{\\vee\}/g;
+    $result =~ s/&(cap|\#8745);/\\ensuremath\{\\cap\}/g;
+    $result =~ s/&(cup|\#8746);/\\ensuremath\{\\cup\}/g;
+    $result =~ s/&(int|\#8747);/\\ensuremath\{\\int\}/g;
+    $result =~ s/&(sim|\#8764);/\\ensuremath\{\\sim\}/g;
+    $result =~ s/&(cong|\#8773);/\\ensuremath\{\\cong\}/g;
+    $result =~ s/&(asymp|\#8776);/\\ensuremath\{\\approx\}/g;
+    $result =~ s/&(ne|\#8800);/\\ensuremath\{\\not=\}/g;
+    $result =~ s/&(equiv|\#8801);/\\ensuremath\{\\equiv\}/g;
+    $result =~ s/&(le|\#8804);/\\ensuremath\{\\leq\}/g;
+    $result =~ s/&(ge|\#8805);/\\ensuremath\{\\geq\}/g;
+    $result =~ s/&(sub|\#8834);/\\ensuremath\{\\subset\}/g;
+    $result =~ s/&(sup|\#8835);/\\ensuremath\{\\supset\}/g;
+    $result =~ s/&(nsub|\#8836);/\\ensuremath\{\\not\\subset\}/g;
+    $result =~ s/&(sube|\#8838);/\\ensuremath\{\\subseteq\}/g;
+    $result =~ s/&(supe|\#8839);/\\ensuremath\{\\supseteq\}/g;
+    $result =~ s/&(oplus|\#8853);/\\ensuremath\{\\oplus\}/g;
+    $result =~ s/&(otimes|\#8855);/\\ensuremath\{\\otimes\}/g;
+    $result =~ s/&(perp|\#8869);/\\ensuremath\{\\perp\}/g;
+    $result =~ s/&(sdot|\#8901);/\\ensuremath\{\\cdot\}/g;
 #Geometric Shapes (extended HTML 4.01)
-    $result =~ s/&(loz|\#9674);/\$\\Diamond \$/g;
+    $result =~ s/&(loz|\#9674);/\\ensuremath\{\\Diamond\}/g;
 #Miscellaneous Symbols (extended HTML 4.01)
-    $result =~ s/&(spades|\#9824);/\$\\spadesuit \$/g;
-    $result =~ s/&(clubs|\#9827);/\$\\clubsuit \$/g;
-    $result =~ s/&(hearts|\#9829);/\$\\heartsuit \$/g;
-    $result =~ s/&(diams|\#9830);/\$\\diamondsuit \$/g;
+    $result =~ s/&(spades|\#9824);/\\ensuremath\{\\spadesuit\}/g;
+    $result =~ s/&(clubs|\#9827);/\\ensuremath\{\\clubsuit\}/g;
+    $result =~ s/&(hearts|\#9829);/\\ensuremath\{\\heartsuit\}/g;
+    $result =~ s/&(diams|\#9830);/\\ensuremath\{\\diamondsuit\}/g;
     return $result;
 }
 

--sakharuk1079108603--