Use of \middle

153 views
Skip to first unread message

Aaron Meurer

unread,
Jul 3, 2011, 8:28:21 PM7/3/11
to mathja...@googlegroups.com
In LaTeX, you can use \middle, like \left(stuff \middle| morestuff \right), but this doesn't seem to be supported by MathJax.

Are there plans to support this?  If not, do you know a good workaround.

Aaron Meurer

Davide P. Cervone

unread,
Jul 5, 2011, 2:40:12 PM7/5/11
to mathja...@googlegroups.com
You are right, MathJax doesn't implement \middle, because I didn't
know that it existed! I will add it in a future release, but for now,
you can use

<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
var TEX = MathJax.InputJax.TeX,
MML = MathJax.ElementJax.mml;
TEX.Definitions.macros.middle = "myMiddle";
TEX.Parse.Augment({
myMiddle: function (name) {
var delim = this.GetDelimiter(name);
this.Push(MML.mo(delim).With({stretchy: true}));
}
});
});
</script>

before the <script> that loads MathJax.js in order to implement it
yourself. (You can also make your own configuration file that
contains the startup hook and load that along with your main
configuration file if that is more convenient).

Davide

Reply all
Reply to author
Forward
0 new messages