Doing Math in Discourse with Latex

@abhishek has kindly agreed to enable the math plugin for our itsFOSS forum posts. There is a description here

I think we have the default MathJax renderer. It based on Latex, but it is only the math rendering part of Latex, not a full Latex.

It is not as if we need to use equations in our replies, but it could be useful occasionally for simple bits of algebra

Example 1:
If I type in

The area of a circle is $\pi r{^2}$

I get
The area of a circle is \pi r{^2}

That is the way to do math in the middle of a sentence… enclose it in $ symbols.

Example2:
Suppose I want a block of equations.
If I type

$$
x = \frac{y + z/2}{y^{2}+1
z = \sqrt{x + y}
$$

I get

x = \frac{y + z/2}{y^{2}+1} \\ z = \sqrt{x + y}

For those not familiar with Latex math cheat sheet here

and the fullLatex documentation is the classic book

I

Do not expect to be able to do non-math Latex commands such as tables. It does not work.

5 Likes

Thanks to you both for that option.

Dont think i will ever need it, i only do simple calculations… take my shoes and socks off and i can count to 37 !

1 Like

You can use it with numbers instead of symbols

so 37/2 = 18.5 is the answer

That came from

so $37/2 = 18.5$ is the answer

Notice the numbers are a different font compared to

so 37/2 = 18.5 is the answer

1 Like

Does it do all the currency symbols as well £€ etc

\pounds 24

Yep, it works

\texteuro 345
\euro does not work ?

According to this
https://docs.mathjax.org/en/latest/input/tex/macros/index.html
\texteuro should work
but it does not work for me here

1 Like

The symbols available in MathJax are summarised here