softloud / cantabile

write something, anything, every day
2 stars 0 forks source link

solve LaTeX display #4

Open softloud opened 6 years ago

softloud commented 6 years ago

Apparently some themes don't support LaTeX. Perhaps this is why it is not showing.

Which is easier or better?

Switch themes or make it compatible with mathjax? Look it up in the book.

softloud commented 6 years ago
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<!-- MathJax configuration -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"] ],
        displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
        processEscapes: true,
        processEnvironments: true
    },
    // Center justify equations in code and markdown cells. Elsewhere
    // we use CSS to left justify single line equations in code cells.
    displayAlign: 'center',
    "HTML-CSS": {
        styles: {'.MathJax_Display': {"margin": 0}},
        linebreaks: { automatic: true }
    }
});
</script>
<!-- End of mathjax configuration --

Copy that script into one of the partials that will get loaded every post - like, say, the sidebar.