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

\color{navy}{\text {Okay, this looks like an easier way to do it}} \\ \color{RoyalBlue}{\text {There are a lot of named colors}} \\ \color{purple}{\text {Dozens of them}} \\ \color{ForestGreen}{\text {And if you use the text command, then it handles spaces correctly}} \\
Here’s a list of colors.

And this is the the way to do it:

$\color{navy}{\text {Put your text here}}$

\textsf{This is a Sans Serif font}

\small \textsf{This is Sans Serif smaller}

\large \textit{Large Italics}

\small \color{blue}{\textsf{Small blue Sans Serif}}

Finally, the last missing feature from the old boards is back:
\color{purple}{\text {This post has been graped by The Grapist!}}

\color{orange}\Delta x\Delta p \ge {h\over 4\pi}

Ahhhh, I always felt the Uncertainty Principle should be orange!

Please select your favorite equation:

  • \Delta x \Delta p \ge {h \over 4\pi}
  • E=mc^2
  • 2+2=4

0 voters

Well that didn’t work at all. It rendered just fine in my preview!!!

[poll type=regular results=always chartType=bar name=two]{

  • \Delta x \Delta p \ge {h \over 4\pi}
  • E=mc^2
  • 2+2=4}
    [/poll]

This second attempt doesn’t render the poll in preview.

Third attempt:
{

  • \Delta x \Delta p \ge {h \over 4\pi}
  • E=mc^2
  • 2+2=4

0 voters

}

Fourth attempt:
$[poll type=regular results=always chartType=bar name=four]

  • \Delta x \Delta p \ge {h \over 4\pi}
  • E=mc^2
  • 2+2=4
    [/poll]$

Fifth attempt:

  • $\Delta x \Delta p \ge {h \over 4\pi}
  • E=mc^2
  • 2+2=4$

0 voters

I give up.

Did you surround them in dollar signs? If so, it looks like they were stripped out.

  • 2\pi
  • \tau

0 voters

Very strange. It indeed works in the preview, just not once posted.

Inline test: I would like a \small \color{purple}{\textsf{purple}} car.

Good enough, but I wonder if there’s a way to get it to use the same font as the main text.

A future version will have more support for messing with the fonts. You can also switch around the Math Renderer from the menu and experience different results from some of the settings.

I find that setting Math Settings > Scale All Math to 120% gets me text that matches the inline text.

Edit: nope. It gets the x-height correct, but then the regular height is too large. It’s using its own webfont, not the main font of the theme.

That said, I suspect that this could be tweaked in the theme itself, as I was able to tweak it by changing the CSS property for .MJXc-TeX-sans-R.

Pick your favorite equation:

  • Einstein’s equation: E=mc^2
  • Uncertainty principle: \Delta x \Delta p \ge {h \over 4\pi}
  • Idiot’s equation: 2+2=4

0 voters

Nope.

Weird. I noticed when someone responded to one of my posts that the MathJax dollar signs seemed to have disappeared when quoted, so I wanted to test it here. I highlighted your entire post and clicked quote and it seems to have done the same thing. Bye bye colors. :frowning:

It does seem to strip out the dollar signs when you select text and quote, but it doesn’t if you reply to a post and then click the speech bubble in the edit box to quote the whole post.

But it’s not a big deal. You can always add back the dollar signs manually.


Besides \color{red}{\textsf{colored text }} you can also use boxes for background colors.

\fcolorbox{green}{Goldenrod}{Text in a box}

\large\color{white}\fcolorbox{white}{NavyBlue}{Large white text with blue background 🌠}

Adding them back manually requires the person who quoted me to understand the MathJax syntax, which is probably a bridge too far in many cases.

@codinghorror, I’m assuming that it’s not intentional that the quote function messes up MathJax encoding, correct?

I assume this is a manifestation of the well-known bug that prevents formatted text like italic and bold from being quoted correctly (extra spaces are inserted).

I might be wrong, but I don’t think that @codinghorror was particularly connected to the implementation of MathJax on Discourse.

No, but the actual bug is in how the “highlight text and click quote” function works. It seems it just takes what text is selected and parses it, rather than find it in the post and then copying the markup.

The latter would eliminate this problem, though I understand it would be more difficult to implement.

I really don’t recommend using Mathjax unless you need to talk about hardcore mathematics. Abuse of it to get colors and formatting is just… abuse.

Even for simple math it’s formatted much more beautifully than what’s otherwise possible. x^3 \over 3! just looks better than x3/3!, and is easier to type, too.

That’s fine, use math markup to discuss math. That’s the point. Gratuitous font and color formatting hacks… not so much.