I want to write a mathematical formula along my text that includes alpha and beta values. How can I do so? If I copy paste the formula of polynomial linear regression from wikipedia to my code, I get this:
{\displaystyle y=\beta _{0}+\beta _{1}x+\beta _{2}x^{2}+\varepsilon .\,}
I read that there's a library 'react-mathjax' but I couldn't figure out how to use alpha beta symbols.
You can check out a new library called better-react-mathjax
that I have written. It is written with the latest standards of React in mind.
The following code accomplishes what you want:
<MathJaxContext config={config}>
<h2>MathJax use with Latex</h2>
<MathJax dynamic>
{"$$y=\\beta _{0}+\\beta _{1}x+\\beta _{2}x^{2}+\\varepsilon$$"}
</MathJax>
</MathJaxContext>
I don't know for what you wanted to keep the last part (.\,
) so I removed it but you can put it back if you want to.
I have prepared a sandbox for you, check it out and hope you like it!