Oh neat, you can.
Here's the code to produce that snippet:
{% katex %}
c = \pm\sqrt{a^2 + b^2}
{% endkatex %}
It's new and there will be kinks that need to be worked out.
Kudos to @maestromac for a really fabulous implementation.
Implement KatexTag
#6237
maestromac
posted on
What type of PR is this? (check all applicable)
- [x] Feature
Description
Used katex-ruby gem to make a Katex Liquid Tag.
- In order to make this work, I had to turn off Redcarpet's superscripts feature. I was more comfortable with this change when I learn that Github and Gitlab shared similar settings.
- I found it impossible to pass our storybook prebuild because it can't resolve
@import _katexas that is a geminifed CSS. I've decided to copy provided CSS into our own app. I'd imagine this would help with serving up CSS for stack bit apps. If this is a bad idea please let me know.
Misc resources:
- similar jekyll implementation
Related Tickets & Documents
Resolves https://github.com/thepracticaldev/dev.to/issues/182 Resolves https://github.com/thepracticaldev/dev.to/issues/97
Mobile & Desktop Screenshots/Recordings (if there are UI changes)
Added tests?
- [x] yes
Added to documentation?
- [x] yes, need to add in the editor guide
[optional] Are there any post-deployment tasks we need to perform?
n/a
Happy coding!


Top comments (19)
Ha!
Cool to see that
Charts would also be really cool. Comments in this thread have some good ideas on that matter...
What's the best charts library with a small bundle size?
Interesting...
Is that fully inline, so
$$x^2$$automatically becomes...?
👏👏👏
What a great feature! Thanks, @maestromac .
No problem 😊
OMG! Fabulous!
Lemme see if it works...
hello
$$\alpha=4$$testing inline equationtesting double dollar notation
Ah crap without code block?
Does this work? $$\text{This would be amazing}\longrightarrow \sqrt{x}$$
Ah I see
LaTeX was a major part of my stint in academia. Have something of a love/hate relationship with it, but this is a welcome feature, nonetheless.
test equation
Damn... I haven't used LaTeX since the mid-90s. :)