9
\$\begingroup\$

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.

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


If MathJax were enabled for Photo-SE, the standard delimiter of $ ... $ would be an issue (because we often mention gear prices), so we could instead use delimiters of \$ ... \$ for inline MathJax. (The $$ ... $$ block-level MathJax delimiters is fixed).


\$\endgroup\$
5
  • \$\begingroup\$ Have you example questions that would need it? \$\endgroup\$
    – Rowland Shaw Mod
    Commented Jun 5, 2015 at 8:04
  • \$\begingroup\$ @RowlandShaw I added the two of my own that sparked the idea and an additional one. \$\endgroup\$
    – null
    Commented Jun 5, 2015 at 10:38
  • \$\begingroup\$ I think our current markdown handles the third example just fine. I don't think we need special plugins for that. \$\endgroup\$
    – dpollitt
    Commented Aug 22, 2015 at 15:03
  • \$\begingroup\$ 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. \$\endgroup\$
    – Rob
    Commented Jan 29, 2018 at 8:45
  • \$\begingroup\$ testing \$\sin \theta\$ \$\endgroup\$
    – scottbb Mod
    Commented Jul 24, 2023 at 21:21

5 Answers 5

4
\$\begingroup\$

Another "better late than never" classic... :)

MathJax has been enabled, using \$ for inline delimiters as suggested. Please let us know if you see any issues.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Given the rare circumstances, I'd like to take the opportunity to suggest a theme for the photo contest: "ice skating in hell". Or what about "the (flash) light at the end of the tunnel"? \$\endgroup\$
    – null
    Commented Jul 25, 2023 at 19:34
8
\$\begingroup\$

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) (Markdown tables have been implemented as of December 2020)
  3. Load times: this is Photography.SE. We often have images on our pages. Those take load time as well.
  4. Several people unanimously upvoted having TeX support in our Markdown as far back as 2011.

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. How to get the best results for landscape and stars photographs?
  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?
  12. How can I calculate what the effect of an extension tube will be?
  13. I'm hoping to prove this distance to camera equation:
  14. Is the formula for object image size given focal length, etc. independent of sensor size?
  15. How do I calculate the distance of an object in a photo?
  16. Calculation for getting dimension of object in image not working
  17. Can we measure size of an object using EXIF data from a photo?
\$\endgroup\$
2
\$\begingroup\$

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

For mathematical formulas, standard whitelisted tags work:

M = (di - f) / f

Image magnficiation

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.

\$\endgroup\$
2
  • \$\begingroup\$ 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. \$\endgroup\$
    – scottbb Mod
    Commented Jul 21, 2016 at 5:20
  • \$\begingroup\$ 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. \$\endgroup\$
    – scottbb Mod
    Commented Dec 20, 2018 at 22:35
0
\$\begingroup\$

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.

\$\endgroup\$
-1
\$\begingroup\$

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.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .