MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

Implement TeX commands for Contour Integral

Open fred-wang opened this issue 11 years ago • 13 comments

See http://tug.org/pipermail/texhax/2004-September/002706.html

\oiint and \oiiint are discussed here: https://bugzilla.wikimedia.org/show_bug.cgi?id=35477

(but texvc does not support them)

fred-wang avatar Sep 10 '13 14:09 fred-wang

That comes down to the MathJax fonts not having the glyph, correct?

pkra avatar Sep 11 '13 13:09 pkra

Yes, the TeX parsing is trivial. Here is an example from Wikipedia where a hack is used:

https://en.wikipedia.org/wiki/Gauss%27s_law#Integral_form_2

If you enable MathJax, you see an ugly image of the contour integral inside the beautiful MathJax rendering... :-(

fred-wang avatar Sep 12 '13 07:09 fred-wang

Right, so the question is: where do we find a ComputeModern-like glyph?

pkra avatar Sep 16 '13 15:09 pkra

I guess in the Latin Modern fonts.

fred-wang avatar Sep 16 '13 16:09 fred-wang

Ah, good idea.

pkra avatar Sep 16 '13 16:09 pkra

This issue could use some love. Over on Stack Exchange, it comes up with some regularity:

http://meta.math.stackexchange.com/questions/9973/how-do-you-render-a-closed-surface-double-integral/ http://meta.physics.stackexchange.com/questions/6779/oiint-doesnt-seem-to-work http://meta.physics.stackexchange.com/questions/9307/rendering-of-the-double-surface-integral-tex http://meta.math.stackexchange.com/questions/19594/oiint-symbol-how-does-it-work

episanty avatar Nov 01 '16 09:11 episanty

Thanks. It's not a default macro because the default fonts do not have glyphs. You might want to ask physics.SE to add a custom macro to its MathJax configuration to add it anyway (and ask for a change in fonts if the community thinks that's important enough).

We plan to work on the fonts next year as part of v3.0 and that might enable us to make this a default macro.

pkra avatar Nov 01 '16 10:11 pkra

Thanks for the quick response. Can you suggest specific macros that would be able to achieve this? Or do you mean hacking something together with circles and spaces?

episanty avatar Nov 01 '16 12:11 episanty

You could use the equivalent of

\def\oint{\mathop{\vcenter{\mathchoice{\huge\unicode{x222E}\,}{\unicode{x222E}}{\unicode{x222E}}{\unicode{x222E}}}\,}\nolimits}
\def\oiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x222F}\,}{\unicode{x222F}}{\unicode{x222F}}{\unicode{x222F}}}\,}\nolimits}
\def\oiiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x2230}\,}{\unicode{x2230}}{\unicode{x2230}}{\unicode{x2230}}}\,}\nolimits}

to allow \oint, \oiint, and \oiiint to work with their respective unicode characters, with sizing reasonably for displaystyle, and being the proper TeX class to allow limits to be placed appropriately (though the lower limit will be a bit too far to the right, because this won't get the proper italic correction).

dpvc avatar Nov 01 '16 12:11 dpvc

Any progress on getting this natively into MathJax 3?

Contour integrals are quite common in physics, and support for this would be really appreciated!

JeppeKlitgaard avatar Jun 02 '21 15:06 JeppeKlitgaard

We are planning a release at the end of the summer that includes new fonts. We will consider adding new glyphs at that time, so may be able to give better coverage at that point.

dpvc avatar Jun 02 '21 16:06 dpvc

Just ran into this issue, was anything implemented?

a2k42 avatar Jul 10 '22 12:07 a2k42

@Andy2K11, it has taken longer than expected, and is still in progress, but should be in the next release.

dpvc avatar Jul 11 '22 10:07 dpvc