Dragon Arrow written by Tatsuya Nakaji, all rights reserved animated-dragon-image-0164

Mathjax: Write a formula

updated on 2019-08-13

イメージ

Mathjax:  Write a formula


DOCUMENT

https://www.mathjax.org/


When $$a \ne 0$$, there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$


If you use Mathjax, complex formulas can be expressed in their own Regex.


1. Mathjaxの導入

add below script in <head></head>

<script type="text/javascript" async
  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML">
</script>
<script type="text/x-mathjax-config">
 MathJax.Hub.Config({
 tex2jax: {
 inlineMath: [["\\(","\\)"] ],
 displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
 }
 });
</script>



2. Let's use!

in view, add some formula like

=−b±b2−4ac

democracy https://jsbin.com/?html,output 


my recommended site search formula regexp via this site

http://if1.tech/g-mathjax


$$formula$$ # don't forget $$

That's all for now!!