# MathJax has been added in to the SDMB. \[Like TeX/LaTeX\]

**URL:** <https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190>\
**Category:** About This Message Board\
**Created:** [June 28, 2021, 5:08pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190 "2021-06-28T17:08:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![What\_Exit](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/what_exit/32/10652_2.png) [@What\_Exit](https://boards.straightdope.com/u/What_Exit)\
**Post date:** [June 28, 2021, 5:08pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/1 "2021-06-28T17:08:13Z")

</div>

@Hari_Seldon will provide the details about this.

---

<div class="post-metadata">

**Author:** ![Babale](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/babale/32/15666_2.png) [@Babale](https://boards.straightdope.com/u/Babale)\
**Post date:** [June 28, 2021, 5:18pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/2 "2021-06-28T17:18:02Z")

</div>

Now hold up just a minute - animated GIFs are one thing, but now people will flood the boards with mathematical formulas! 😛

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [June 28, 2021, 5:29pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/3 "2021-06-28T17:29:13Z")

</div>

As What Exit said, MathJax has been added. It allows math formulas to be entered using TeX/LaTeX syntax to be used directly. For example to type e = \sum\_0^\infty \frac{1}{n!}, you can input $e=\sum\_0^\infty\frac{1}{n!}$. I have not explored the limits of this in detail. You get some detail if you google mathjax. There is one downside. If you have one dollar sign in a paragraph, you can simply type $. But if a second dollar sign appears everyting in between will be set as a formula, which is _not_ what you want to see. To avoid that problem, simply escape one or both dollar signs using the backslash: \$ (which, in case you wondered I got by three backslashes, followed by a dollar sign).

MathJax should be considered as LaTeX light. For example, in genuine Latex, two backslashes \\ really causes a line break, but not here.

I will be happy to try to help anyone who has trouble using this. Please PM me rather than replying to this thread and I will get back to you.

On second thought, post questions on this thread, as a reply to me, so I will get it as a PM, but can reply for all to see.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [June 28, 2021, 6:09pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/4 "2021-06-28T18:09:11Z")

</div>

> [@Hari\_Seldon](#):
>
> MathJax should be considered as LaTeX light. For example, in genuine Latex, two backslashes \ really causes a line break, but not here.

Mathjax is a successor/offshoot of the old jsMath. It is not a genuine TeX engine— there is no “vertical mode”, therefore macros like `\\` and `\vspace` are not implemented. Automatic line breaking is also not yet implemented.

There is a whole zoo of useful symbols and environments that _are_ defined and work as usual. For instance \bigl(\begin{smallmatrix}a & b \\ c & d\end{smallmatrix}\bigr) works — I typed ` $\bigl(\begin{smallmatrix}a & b \\ c & d\end{smallmatrix}\bigr)$`

---

<div class="post-metadata">

**Author:** ![Stranger\_On\_A\_Train](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Stranger\_On\_A\_Train](https://boards.straightdope.com/u/Stranger_On_A_Train)\
**Post date:** [June 28, 2021, 6:26pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/5 "2021-06-28T18:26:24Z")

</div>

> [@Babale](#):
>
> Now hold up just a minute - animated GIFs are one thing, but now people will flood the boards with mathematical formulas! 😛

\huge{e^{i\pi}+1 = 0}

I’m just getting started. Don’t make me pull out the full 3D unsteady Navier-Stokes equations!

Stranger

---

<div class="post-metadata">

**Author:** ![Joey\_P](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@Joey\_P](https://boards.straightdope.com/u/Joey_P)\
**Post date:** [June 28, 2021, 6:39pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/6 "2021-06-28T18:39:28Z")

</div>

Dear lord, must the context menu that pops up when you right click on the equation be glowing like that?

---

<div class="post-metadata">

**Author:** ![DMC](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dmc/32/18049_2.png) [@DMC](https://boards.straightdope.com/u/DMC)\
**Post date:** [June 28, 2021, 6:43pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/7 "2021-06-28T18:43:45Z")

</div>

I know we’ve discussed this a few times since the switch to Discourse. Happy to see it got the green light!

---

<div class="post-metadata">

**Author:** ![ThelmaLou](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thelmalou/32/390_2.png) [@ThelmaLou](https://boards.straightdope.com/u/ThelmaLou)\
**Post date:** [June 28, 2021, 9:09pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/8 "2021-06-28T21:09:38Z")

</div>

> [@Hari\_Seldon](#):
>
> MathJax should be considered as LaTeX light. For example, in genuine Latex…

What if you’re allergic to latex?

Sorry, I couldn’t resist. I am math illiterate, but happy for those of you who know what this thread is really about and like this New Thing. Leaving now. Sheepishly.

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [June 28, 2021, 9:43pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/9 "2021-06-28T21:43:20Z")

</div>

Yay! Thanks to all that made this happen.

\begin{equation} \begin{aligned} \nabla\cdot\mathbf{E} & = \frac{\rho}{\epsilon\_0} & \text{(Gauss's law)} \\ \nabla\cdot\mathbf{B} & = 0 & \text{(Gauss's law for magnetism)} \\ \nabla\times\mathbf{E} & = -\frac{\partial \mathbf{B}}{\partial t} & \text{(Maxwell–Faraday equation)} \\ \nabla\times\mathbf{B} & = \mu\_0(\mathbf{J} + \epsilon\_0\frac{\partial \mathbf{E}}{\partial t}) & \text{( Ampère's circuital law)} \end{aligned} \end{equation}

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [June 28, 2021, 10:57pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/10 "2021-06-28T22:57:37Z")

</div>

This thread itself isn’t about math. But it is about a tool that will make it easier for us to discuss math in other threads.

With the kind of board this is, I’m sure that folks will find creative non-math ways to use this, too.

And I’m very pleased to see that this works through actual formatting of actual characters, subject to things like copy and paste, and not just through the more common method of generating an image. I would worry about backwards compatibility, but Discourse is inherently not backwards compatible at all, anyway, so shrug.

---

<div class="post-metadata">

**Author:** ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)\
**Post date:** [June 28, 2021, 11:05pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/12 "2021-06-28T23:05:56Z")

</div>

> [@Hari\_Seldon](#):
>
> If you have one dollar sign in a paragraph, you can simply type $. But if a second dollar sign appears everyting in between will be set as a formula, which is _not_ what you want to see.

This doesn’t seem to be a problem for normal usage. It seems the second dollar sign has to be followed by a space or punctuation.

We can easily still type something like this: The cost of widgets is $5, but the cost of gadgets is $10. Is there really any difference?

We just can’t type something like this: $math$, which will become math.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [June 28, 2021, 11:10pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/13 "2021-06-28T23:10:03Z")

</div>

> [@BigT](#):
>
> I have $2. Suzy has $3. How much do we have together?

Looks like the initial $ must have a space before it (or be at the beginning of a line) and the final $ must have a space after it (or be at the end of a line). I typed this paragraph with a back-slash before each $.

> [@BigT](#):
>
> It seems the second dollar sign has to be followed by a space or punctuation.

I think that’s close. I think my observation is more nearly correct. You may be right about the final punctuation.

---

<div class="post-metadata">

**Author:** ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)\
**Post date:** [June 28, 2021, 11:13pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/14 "2021-06-28T23:13:19Z")

</div>

> [@Senegoid](#):
>
> I think that’s close. With just a bit of experimentation, I find that a punctuation mark after the final $ doesn’t work like that. I think my observation is more nearly correct.

My post contains a situation where I posted a dollar sign followed by a period, and it still turned into math.

If I type `$math$.` (with the period), I get math.

I think the only way someone could accidentally stumble on this is if they mix and match using the dollar sign in front and after a number, like this: `I have $2 US and 3$ in some other currency.` would become I have 2 US and 3 in some other currency.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [June 28, 2021, 11:15pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/15 "2021-06-28T23:15:23Z")

</div>

> [@BigT](#):
>
> My post contains a situation

I noted that, and edited my post more-or-less accordingly.

---

<div class="post-metadata">

**Author:** ![Topologist](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/topologist/32/3208_2.png) [@Topologist](https://boards.straightdope.com/u/Topologist)\
**Post date:** [June 28, 2021, 11:56pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/17 "2021-06-28T23:56:00Z")

</div>

Oh, this could be fun.

> \displaystyle e^{ix} = \sum\_{k=0}^\infty \frac{(ix)^k}{k!} = \sum\_{k=0}^\infty (-1)^k\frac{x^{2k}}{(2k)!} + i\sum\_{k=0}^\infty (-1)^k\frac{x^{2k+1}}{(2k+1)!} = \cos x + i\sin x

MathJax doesn’t do nice commutative diagrams, though. Pity.

---

<div class="post-metadata">

**Author:** ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)\
**Post date:** [June 28, 2021, 11:58pm UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/18 "2021-06-28T23:58:41Z")

</div>

> [@Topologist](#):
>
> > \displaystyle e^{ix} = \sum\_{k=0}^\infty \frac{(ix)^k}{k!} = \sum\_{k=0}^\infty (-1)^k\frac{x^{2k}}{(2k)!} + i\sum\_{k=0}^\infty (-1)^k\frac{x^{2k+1}}{(2k+1)!} = \cos x + i\sin x

It was interesting watching that one render in front of my eyes. It popped in like some glyphs were images, yet they function like text, allowing normal highlighting.

And there is no more pop-in, so it’s like an image that has been cached.

---

<div class="post-metadata">

**Author:** ![Topologist](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/topologist/32/3208_2.png) [@Topologist](https://boards.straightdope.com/u/Topologist)\
**Post date:** [June 29, 2021, 12:10am UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/19 "2021-06-29T00:10:46Z")

</div>

My guess is that the initial delays came from it fetching the various fonts it uses from the web. Now they’re cached on your machine so it renders immediately.

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [June 29, 2021, 12:24am UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/20 "2021-06-29T00:24:27Z")

</div>

How sad–I was hoping that I would be able to perform arbitrary computations within the rendering engine itself (since \LaTeX is Turing-complete), but it does not seem to be possible. MathJax only supports math-mode rendering, with very few exceptions. It does support defining your own macros, but as best I can tell it does not support any kind of dynamic dispatch, making arbitrary computation impossible. Oh well, my Mandelbrot set renderer is not to be. Probably for the best…

---

<div class="post-metadata">

**Author:** ![superwombat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/superwombat/32/16616_2.png) [@superwombat](https://boards.straightdope.com/u/superwombat)\
**Post date:** [June 29, 2021, 1:33am UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/21 "2021-06-29T01:33:25Z")

</div>

```auto
TREE(3)

```

Am I doing this right? 🙂

---

<div class="post-metadata">

**Author:** ![Northern\_Piper](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/northern_piper/32/5304_2.png) [@Northern\_Piper](https://boards.straightdope.com/u/Northern_Piper)\
**Post date:** [June 29, 2021, 1:57am UTC](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190/22 "2021-06-29T01:57:28Z")

</div>

As dear @Eve once commented, years ago, in a thread far, far away:

« There are people in this thread. »

« Doing math! »

« For fun!! »

« 😱 »

[Next page](https://boards.straightdope.com/t/mathjax-has-been-added-in-to-the-sdmb-like-tex-latex/945190.md?page=2)
