Added math notes _doc/math.shtml.
authorW. Trevor King <wking@drexel.edu>
Tue, 14 Sep 2010 06:41:35 +0000 (02:41 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 14 Sep 2010 06:55:34 +0000 (02:55 -0400)
_doc/math.shtml [new file with mode: 0644]

diff --git a/_doc/math.shtml b/_doc/math.shtml
new file mode 100644 (file)
index 0000000..939d74d
--- /dev/null
@@ -0,0 +1,97 @@
+<!--#set var="root_directory" value=".." --><!--#include virtual="$root_directory/shared/header.shtml"-->
+
+<h1>Math Markup</h1>
+
+<h2>Use Unicode instead of entities</h2>
+
+<table>
+  <tr><th>Symbol</th><th>Entity</th>         <th>LaTeX</th>   <th>Unicode</th></tr>
+  <tr><td>—</td>     <td>&amp;mdash;</td>    <td>--- ?</td>   <td>EM DASH, U+2014</td></tr>
+  <tr><td>–</td>     <td>&amp;ndash;</td>    <td>-- ?</td>    <td>EN DASH, U+2013</td></tr>
+  <tr><td>è</td>     <td>&amp;egrave;</td>   <td>?</td>       <td>LATIN SMALL LETTER E WITH GRAVE, U+00E8</td></tr>
+  <tr><td>Γ</td>     <td>&amp;Gamma;</td>    <td>\Gamma</td>  <td>GREEL CAPITAL LETTER GAMMA, U+0393</td></tr>
+  <tr><td>Ω</td>     <td>&amp;Omega;</td>    <td>\Omega</td>  <td>GREEL CAPITAL LETTER OMEGA, U+03A9</td></tr>
+  <tr><td>π</td>     <td>&amp;pi;</td>       <td>\pi</td>     <td>GREEK SMALL LETTER PI, U+03C0</td></tr>
+  <tr><td>∫</td>     <td>&amp;Integral;</td> <td>\int</td>     <td>INTEGRAL, U+222B</td></tr>
+  <tr><td>〈</td>    <td>?</td>              <td>\langle</td> <td>LEFT-POINTING ANGLE BRACKET, U+2329</td></tr>
+  <tr><td>〉</td>    <td>?</td>              <td>\rangle</td> <td>RIGHT-POINTING ANGLE BRACKET, U+232A</td></tr>
+</table>
+
+<p><a href="http://live.gnome.org/Gucharmap">Gucharmap</a> is a useful
+utility for looking up unicode symbols.</p>
+
+<h2>Compiling itex to MathML</h2>
+
+<p>Using <a href="http://golem.ph.utexas.edu/~distler/blog/itex2MML.html">itex2MML</a>:</p>
+
+<pre>
+$ cat index.shtml.itex2MML | itex2MML --forbid-markup --unicode-entities > index.shtml
+</pre>
+
+<p>Or in bulk
+with <a href="../_script/math.sh">math.sh</a>.  <code>--unicode-entities</code>
+is an addition I've made to the original <code>itex2MML</code> to make
+it play more nicely
+with <a href="http://codespeak.net/lxml/">lxml</a>.  Pull my altered
+repository with</p>
+
+<pre>
+$ bzr clone bzr+ssh://einstein/home/einstein/wking/public_html/code/bzr/itexToMML
+</pre>
+
+<h3>blahtex(ml)</h3>
+
+<p>An alternative to itex2MML
+is <a href="http://gva.noekeon.org/blahtexml/">blahtex(ml)</a> which
+is very similar.  In my very haphazard initial testing, I ran into
+some problems with equation lists that itex2MML seemed to handle
+better.  It's easy to try both and pick whichever one you like better.
+I was missing a dependency needed for the full-file
+filter <code>blahtexml</code>, so I only tested the
+single-block <code>blahtex</code> form.</p>
+
+<pre>
+$ echo '...' | blahtex --mathml --mathml-encoding raw --spacing relaxed --displaymath
+</pre>
+
+<p>or for multi-line source</p>
+
+<pre>
+$ cat &lt;&lt; EOF | /tmp/blahtexml-0.8/blahtex --mathml --mathml-encoding raw --spacing relaxed --displaymath  
+&gt;     I = \int_{-1}^{1} dx \int_{-1}^{1} dy
+&gt;         \begin{cases}
+&gt;           1 &amp; \text{if $x^2+y^2 \leq 1$} \\
+&gt;           0 &amp; \text{if $x^2+y^2 \gt 1}
+&gt;         \end{cases}
+&gt; EOF
+</pre>
+
+<p>The output will look something like</p>
+
+<pre>
+&lt;blahtex&gt;
+&lt;mathml&gt;
+&lt;markup&gt;
+...
+&lt;/markup&gt;
+&lt;/mathml&gt;
+&lt;/blahtex&gt;
+</pre>
+
+<p>Pull the <code>...</code> section out and paste it (and your source
+LaTeX) into</p>
+
+<pre>
+&lt;math xmlns="http://www.w3.org/1998/Math/MathML" display="block"&gt;
+  &lt;!--annotation encoding="LaTeX"&gt;                                             
+    ...source LaTeX...
+  &lt;/annotation--&gt;
+  ...blahtex output...
+&lt;/math&gt;
+</pre>
+
+<p>I've commented <code>&lt;!--...--&gt;</code> the annotation section
+because <a href="http://w3m.sourceforge.net/">w3m</a> displays both,
+presumably because it doesn't know about MathML.</p>
+
+<!--#include virtual="$root_directory/shared/footer.shtml"-->