DSPRelated.com
Forums

How to render formulas?

Started by DanBoschen 1 month ago3 replieslatest reply 1 month ago185 views

I am able to render mathjax in posts but have had to do that by enclosing the code in two dollar signs which puts the equations on a new line by themselves such as $$x\cos(\omega t)$$ Elsewhere I have also been able to render equations in line by using single dollar signs but that doesn’t appear to work here. Does anyone know if there is a way to render equations inline

[ - ]
Reply by stephanebMarch 16, 2025

Hi Dan!

From: https://www.dsprelated.com/thread/1114/forums-upda...


2- If you want your equation to be displayed inline, use:

\(  e^{i\pi}+1=0 \)

\( e^{i\pi}+1=0 \)

[ - ]
Reply by jms_nhMarch 17, 2025

Also would like to recommend the MathJax / KaTeX sandbox pages; it's a lot easier to develop equations in real-time there, and add here.

KaTeX: https://katex.org/

MathJax: https://jbergknoff.github.io/mathjax-sandbox/

The KaTeX sandbox is live-update, but KaTeX isn't 100% compatible with MathJax. (Generally if you can get something to work with KaTeX it will work with MathJax, but not necessarily the other way around.)

\begin{aligned}\int_{-\infty}^\infty\int_{-\infty}^\infty e^{-(x^2+y^2)} dx\, dy &=\int_0^\infty\int_0^{2\pi} e^{-r^2} r\, dr\, d\theta \\ &= 2\pi \int_0^\infty e^{-r^2} r\, dr \\ &= -\pi \left[ e^{-r^2} \right]_0^\infty \\ &= \pi \end{aligned}

Bizarre... why does it render when there is no $ or \[ ?

OK, also it has to be on one paragraph in the forum posts; can't span more than one paragraph. (use shift+Enter instead of Enter for a linebreak)

\begin{aligned}
\int_{-\infty}^\infty\int_{-\infty}^\infty e^{-(x^2+y^2)} dx\, dy &=\int_0^\infty\int_0^{2\pi} e^{-r^2} r\, dr\, d\theta \\ 
&= 2\pi \int_0^\infty e^{-r^2} r\, dr \\ 
&= -\pi \left[ e^{-r^2} \right]_0^\infty \\ 
&= \pi 
\end{aligned}

source:

\begin{aligned}
\int_{-\infty}^\infty\int_{-\infty}^\infty e^{-(x^2+y^2)} dx\, dy
&=\int_0^\infty\int_0^{2\pi} e^{-r^2} r\, dr\, d\theta \\
&= 2\pi \int_0^\infty e^{-r^2} r\, dr \\
&= -\pi \left[ e^{-r^2} \right]_0^\infty \\
&= \pi  \end{aligned}
[ - ]
Reply by neiroberMarch 15, 2025

I think single dollar signs worked for me in the past.  $ a = 6*b + 2$  The quick brown fox jumps over the lazy dog.  But it doesn't seem to work now, as you said.  Stephane, can you help?