MathJax Equation Demo
by keithphw
HTML
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&dummy=.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("TeX AMSmath Ready",function () {
MathJax.InputJax.TeX.Definitions.environment["myarray"] =
['AMSarray',null,true,true,'c',".2em"];
});
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
I'm trying to achieve the following equation,
\[\beta_V = \frac{D}{V}\beta_D + \frac{E}{V}\beta_E\]
but with up or down arrows centered above the terms.
<br/><br/>
<b>Update 28/6/13:</b> Fred has kindly posted a very neat solution that creates a custom array environment variable. See the mathjax config script above and the application of the custom array below:
\[\begin{myarray}
\cdot & & \uparrow & \uparrow & & \downarrow & \uparrow \\
\beta_V &=& \frac{D}{V} & \beta_D &+& \frac{D}{E} & \beta_E \\
\end{myarray}\]
<br/><br/>
<b>Update 27/6/13:</b> thanks to Frederic Wang and William Hammond for their pointers. Here is the new best-case version. The only problem is that there's too much space between the fraction and beta terms.
\[\begin{array}{c c c c c c c}
\cdot & & \uparrow & \uparrow & & \downarrow & \uparrow \\
\beta_V &=& \frac{D}{V} & \beta_D &+& \frac{D}{E} & \beta_E \\
\end{array}\]
Using Frederic's advice, it sounds as though the only way to adjust the column spacing is to provide my own custom mathjax configuratiuon file which changes the column spacing for all 'array' environments in a latex document. This has the disadvantage that it affects all array environments.
Or I could make my own new environment such as array_no_space, but this will result in non-portable latex code that only works on my web site.
<br/>
It would be great if mathjax supported a way to change the column spacing in a portable way, such as specifying the following...