# Can we have MathJax please to format mathematical formulas?

Other SEs can format mathematical formulas in a way called mathjax. It makes fractions and equations and pretty much everything mathematical look good.

It's a subset of tex for the internet and it makes those formulas (as ugly as their content may be) look rather pretty. (that is, the prettiness of typeset text)

I agree that this is not the most important thing, because formulas only show up occasionally in photography, but they still do show up from time to time.

It shouldn't be hard to implement either, because the functionality already exists.

thanks

Here are some example posts in which I wanted to use it and which in turn caused me to ask this question here.

This question involves optical formulas

This seems to be the most obvious use case, because photography is in part applied physics.

In this question, I'd rather build a table as seen in the original link

Tables are great for comparison.

This great question about different terms used by different manufacturers could benefit from using tables, to give a quick overview and comparison. Like a chart that has one manufacturer per row and one feature per column, e.g.

       stabilisation     mount
Canon       IS            EF, EF-S,...
Nikon       VR            AI, AI-S...        ...
Sony        OSS           E

.
.
.

• Have you example questions that would need it? Jun 5 '15 at 8:04
• @RowlandShaw I added the two of my own that sparked the idea and an additional one.
– null
Jun 5 '15 at 10:38
• I think our current markdown handles the third example just fine. I don't think we need special plugins for that. Aug 22 '15 at 15:03
• A nasty hack I came up with is to edit your Mathjax where it works, screenshot, crop off the edges and upload it as an image. It looks nice. I voted up for this as it would be better to have it and easy to implement, I also appreciate that some don't feel we're at the tipping point. I got the idea because I wanted to upload an .SVG image (and the preview works perfectly, while 1/2 a dozen online converters wouldn't convert it without errors). So I screenshotted the zoomed in preview, cropped, cancelled the .SVG upload and replaced it with the .PNG . -- Whew.
– Rob
Jan 29 '18 at 8:45

100% in favor of enabling MathJax.

1. 31 Stack Exchange sites support MathJax (https://meta.stackexchange.com/a/216607/175991)
2. Tables: LaTeX arrays can be used for table data. (ex: https://rpg.stackexchange.com/a/67007/8083)
3. Load times: this is Photography.SE. We often have images on our pages. Those take load time as well.

Addressing the concept of only loading MathJax if necessary: unfortunately, that's not practical. MathJax is a client-side JavaScript library. This part of the issue has been addressed many times on other SE sites. For SE sites, it's all or nothing. But we can choose to turn it on. So, let's.

## Questions that would benefit from having MathJax enabled

Out of the top 200 voted questions on the site, the formatting and readability of the following questions would benefit from having MathJax enabled:

1. What is the "exposure triangle"? — this barely needs better formatting of lots of fractions, but if they were cleaned up with MathJax, some of the answers would read better.
2. How do I generate high quality prints with an ink jet printer? — 9 equations, 2 tables in 2 answers.
3. How do I set the proper exposure for nighttime moon photos?
4. Tips for landscape+stars photography?
5. What does f-stop mean?
6. What is a "diffraction limit"?
7. What exactly determines depth of field?
8. Why do light sources appear as stars sometimes?
9. How do I convert lens focal length (mm) to x-times optical zoom?
10. Is there a general formula for image size vs. print size?
11. How can I get dramatic shallow DOF with a kit lens?

I'm not sure if tables are part of MathJax or not.

For mathematical formulas, standard whitelisted tags work:

M = (di - f) / f

ho is the height of the object
do is the distance from the lens to the object
f  is the focal length
di is the distance from the lens to the image

Yea, the background kind of sucks here for code format so I tossed it in a block quote. The above text is:

> <code>h<sub>o</sub></code> is the height of the object
<code>d<sub>o</sub></code> is the distance from the lens to the object
<code>f<sub>&nbsp;</sub></code> is the focal length
<code>d<sub>i</sub></code> is the distance from the lens to the image


Consider also reading There's seriously no reason why LaTeX markup via MathJax shouldn't be enabled on SO where Nick gives demonstrable numbers of how long it takes to load MathJax on the page load. Even with no Mathjax on the page, it takes an additional 0.3 seconds for the page to load. If there is mathjax in the content, it takes another second for it to load.

MathJax also significantly impacts the editing experience by causing the preview to be reloading the text and attempting to re-render it with MathJax each key click.

• Your formatting for the block of variable definitions is pretty nice. But on the main Photo.SE site, blockquotes are light blue. So the variables still have a light gray background, while embedded in a light blue blockquote region. It doesn't look nearly as nice there as your example here does.
– scottbb Mod
Jul 21 '16 at 5:20
• Things have changed since my previous comment. For the last several months (perhaps around 1 year?), blockquote backgrounds on the main site are light yellow now. Still doesn't look nearly as nice as the light gray background in this answer.
– scottbb Mod
Dec 20 '18 at 22:35

While this won't help with writing formulas, at least as far as simple tables go, as of early December 2020, the Stack Exchange network has implemented GitHub-flavored Markdown table syntax support.

So for the example in the question, the following syntax...

|       | stabilisation | mount        |
|-------|---------------|--------------|
| Canon | IS            | EF, EF-S,... |
| Nikon | VR            | AI, AI-S...  |
| Sony  | OSS           | E            |


... will produce this table:

stabilisation mount
Canon IS EF, EF-S,...
Nikon VR AI, AI-S...
Sony OSS E

You can't do anything complex with the GHF Markdown table syntax, such as combining/spanning cells vertically or horizontally. But for basic tabular data, it can sure help.

I came to the conclusion that the best thing would be to allow mathjax only if necessary.

Ideally, one would have to click some checkbox in the editor to explicitly include it. This checkbox would remind the user that this has some drawbacks on the performance and should only be used if necessary.

I think this is best, because while it is true that it is rarely needed, it is very useful in those rare occasions.