Difference between r1.2 and the current
@@ -1,7 +1,8 @@
#keywords Math,
[[목차]]
<body>
<math xmlns="http://www.w3.org/1998/Math/MathML">
[[목차]]
=== html code만 있는 경우 ===
{{{#!html
=== html code ===
* 실제 화면 표시
{{{#!html
<html xmlns="http://www.w3.org/1999/xhtml"><body>
<math xmlns="http://www.w3.org/1998/Math/MathML">
@@ -31,176 +32,41 @@
</math>
</body>
</html>
}}}
=== html + java script ===
{{{#!html
<script>
function convertMath(node) {// for Gecko
if (node.nodeType==1) {
var newnode =
document.createElementNS("http://www.w3.org/1998/Math/MathML",
node.nodeName.toLowerCase());
for(var i=0; i < node.attributes.length; i++)
newnode.setAttribute(node.attributes[i].nodeName,
node.attributes[i].nodeValue);
for (var i=0; i<node.childNodes.length; i++) {
var st = node.childNodes[i].nodeValue;
if (st==null || st.slice(0,1)!=" " && st.slice(0,1)!="\n")
newnode.appendChild(convertMath(node.childNodes[i]));
}
return newnode;
}
else return node;
}
function convert() {
var mmlnode = document.getElementsByTagName("math");
var st,str,node,newnode;
for (var i=0; i<mmlnode.length; i++)
if (document.createElementNS!=null)
mmlnode[i].parentNode.replaceChild(convertMath(mmlnode[i]),mmlnode[i]);
else { // convert for IE
str = "";
node = mmlnode[i];
while (node.nodeName!="/MATH") {
st = node.nodeName.toLowerCase();
if (st=="#text") str += node.nodeValue;
else {
str += (st.slice(0,1)=="/" ? "</m:"+st.slice(1) : "<m:"+st);
if (st.slice(0,1)!="/")
for(var j=0; j < node.attributes.length; j++)
if (node.attributes[j].nodeValue!="italic" &&
node.attributes[j].nodeValue!="" &&
node.attributes[j].nodeValue!="inherit" &&
node.attributes[j].nodeValue!=undefined)
str += " "+node.attributes[j].nodeName+"="+
"\""+node.attributes[j].nodeValue+"\"";
str += ">";
}
node = node.nextSibling;
node.parentNode.removeChild(node.previousSibling);
}
str += "</m:math>";
newnode = document.createElement("span");
node.parentNode.replaceChild(newnode,node);
newnode.innerHTML = str;
}
}
</script>
</head>
<body onload="convert()">
<math>
<mstyle mathcolor="Red" displaystyle="true">
<mrow>
<msubsup>
<mo>∫</mo>
<mn>-1</mn>
<mn>1</mn>
</msubsup>
</mrow>
<msqrt>
<mrow>
<mn>1</mn>
<mo>-</mo>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
</mrow>
</msqrt>
<mi>d</mi>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mi>π</mi>
<mn>2</mn>
</mfrac>
</mstyle>
</math>
}}}
=== 모든 소스 코드 c&p ===
{{{#!html
<head>
<title>MathML in HTML files</title>
<script src="http://www1.chapman.edu/~jipsen/mathml/mathhtml/MathMLinHTMLforFirefoxAndIE.js"></script>
</head>
This file loads a separate small script that inserts the MathML in the DOM.
<p>
E.g. <math><msqrt><mi>π</mi></msqrt></math>
<mstyle mathcolor="Red" displaystyle="true">
<mrow>
<msubsup>
<mo>∫</mo>
<mn>-1</mn>
<mn>1</mn>
</msubsup>
</mrow>
<msqrt>
<mrow>
<mn>1</mn>
<mo>-</mo>
<msup>
<mi>x</mi>
<mn>2</mn>
</mrow>
</msqrt>
<mi>d</mi>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mn>2</mn>
<p>
To get a copy of this page that works locally, use <b>View->Source</b>,
then copy and paste the html text into a local <b>.html</b> file. (If you
use File->Save As..., your browser may not save the correct header
information.) Check that your file is viewable with Netscape 7+ (or
other Gecko based browsers) as well as with IE+MathPlayer on MS Windows.
</p>
<p>
<b>Technical Note:</b> this method of displaying MathML in
Netscape/Mozilla/Firefox does not recognize all entity
names in the MathML DTD, but only those that are in the HTML DTD
(see <a href="http://www.w3.org/TR/html4/HTMLsymbol.ent">HTMLsymbol.ent</a>
or <a href="HTMLsymbol.ent.txt">HTMLsymbol.ent.txt</a>).
To get access to all symbols, use numeric entity names
(e.g. ∮ for ∮).
</p>
<p>
<a href="http://www.chapman.edu/~jipsen/asciimath.html">ASCIIMathML</a>
</p>
<hr>
<center>
<a href="http://www.chapman.edu/~jipsen/">Peter Jipsen</a>,
<a href="http://www.chapman.edu/">Chapman University</a>, March 2004
</center>
}}}
</body>
</html>
<html xmlns:m="http://www.w3.org/1998/Math/MathML">
[[br]]
* Html Code
{{{#!gcode html
<html xmlns="http://www.w3.org/1999/xhtml">
<body><h2>MathML in HTML files for Netscape7/Mozilla/Firefox and IE+MathPlayer</h2>
</p>
<p>
<math>
</msup>
<mi>π</mi>
</mfrac>
</mstyle>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<msup>
<mfenced open="[" close="]">
<mrow>
<mi>a</mi>
<mo>+</mo>
<mi>b</mi>
</mrow>
</mfenced>
<mn>260</mn>
</msup>
<mo>+</mo>
<msub>
<mfenced open="{" close="}">
<mrow>
<mi>a</mi>
<mo>+</mo>
<mi>b</mi>
</mrow>
</mfenced>
<mi>i</mi>
</msub>
</mrow>
</math></p>
</body>
</html>== 같이 보기 ==
* [["LaTex"]]
1. html code ¶
- 실제 화면 표시
- Html Code
<html xmlns="http://www.w3.org/1999/xhtml"> <body> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <msup> <mfenced open="[" close="]"> <mrow> <mi>a</mi> <mo>+</mo> <mi>b</mi> </mrow> </mfenced> <mn>260</mn> </msup> <mo>+</mo> <msub> <mfenced open="{" close="}"> <mrow> <mi>a</mi> <mo>+</mo> <mi>b</mi> </mrow> </mfenced> <mi>i</mi> </msub> </mrow> </math> </body> </html>