-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting math equations to work in gatsby #599
Comments
Can you try implementing module.exports = React.createClass({
render () {
// ...
},
componentDidUpdate() {
MathJax.Hub.Queue(['Typeset', MathJax.Hub])
},
}) |
@briancappello Yup, after implementing However, I noticed another problem. The MathJax equations are not typeset when I go to a different page and then come back to he original page. For example, if I have equations on the index page of a simple documentation site, the equations get typeset when I enter the site, but they are not typeset if I go to the documentation page and then back to the index page. For example, see here: http://ostrokach.gitlab.io/gatsby-docs-site/ |
Hmm yes, I see. How about with both componentDidMount() {
MathJax.Hub.Queue(['Typeset', MathJax.Hub])
}
componentDidUpdate() {
MathJax.Hub.Queue(['Typeset', MathJax.Hub])
} |
Yup, everything seems to be working well now! I do get a Thank you very much for your help! |
Is it possible to get math equations to work "dynamically" in Gatsby?
I have followed the README instructions on Extending Markdown Syntax with Plugins, and created the following
index.js
file in theloaders/markdown-loader
folder of my gatsby-starter-documentation site.I also added the following lines to my html.js, in order to load mathjax:
When I run
gatsby develop
, the math equations get rendered fine when I refresh the page, but then they become text again as soon as I make some changes and the page "updates".Any ideas on how I could get math equations to get rendered dynamically like the rest of markdown?
Thanks for the great project, and sorry if this is a stupid question!
The text was updated successfully, but these errors were encountered: