// v0.2 - 19/12/05 kbrunton // Altered 2/5/06 James Gray to change maths colour and the class of the output node to "answer" // This script allows customisations of ASCIIMath - it must appear after the script tag // that imports ASCIIMathML.js // for simple symbol inclusions, use this syntax newcommand("!<=","\u2270"); newcommand("!>=","\u2271"); newcommand("tick","\u2713"); newcommand("cross","\u2717"); // KB: added new definitions for times - overrides the older defn - try a*b and a*.b // JG: commented out KB's times definition because didn't override defn when using IE //AMsymbols = AMsymbols.concat([{input:"*", tag:"mo", output:"\u00D7", tex:"times", ttype:CONST}]) //AMsymbols = AMsymbols.concat([{input:"*.", tag:"mo", output:"\u22C5", tex:"cdot", ttype:CONST}]) AMsymbols = AMsymbols.concat([{input:"cosec", tag:"mo", output:"cosec", tex:null, ttype:UNARY, func:true}]) AMsymbols = AMsymbols.concat([{input:"arcsin", tag:"mo", output:"arcsin", tex:null, ttype:UNARY, func:true}]) AMsymbols = AMsymbols.concat([{input:"arccos", tag:"mo", output:"arccos", tex:null, ttype:UNARY, func:true}]) AMsymbols = AMsymbols.concat([{input:"arctan", tag:"mo", output:"arctan", tex:null, ttype:UNARY, func:true}]) // KB: don't allow double-blank to delimit asciimath - more hassle than its worth doubleblankmathdelimiter = false; // KB: default colour of maths mathcolor=""; // KB: explicitly hide style displaystyle=true; function AMarr2docFrag(arr) { var newFrag=document.createDocumentFragment(); var tutorComment = false; for (var i=0; i\r\r\ \r\ \r...\r\r\r'+outstr+'<\/body>\r<\/html>\r'; var newnode = AMcreateElementXHTML("textarea"); newnode.setAttribute("id",outputNodeId); newnode.setAttribute("rows","30"); var node = document.getElementById(inputNodeId); newnode.setAttribute("cols",node.getAttribute("cols")); newnode.appendChild(document.createTextNode(outstr)); outnode.parentNode.replaceChild(newnode,outnode); }