janraasch / hugo-bearblog

🧸 A Hugo theme based on »Bear Blog«. Free, no-nonsense, super-fast blogging. This theme now includes a dark color scheme to support dark mode 🦉 ⬛️!
https://themes.gohugo.io/hugo-bearblog/
MIT License
887 stars 218 forks source link

Does this blog supports latex equations? #47

Closed underdogliu closed 2 years ago

underdogliu commented 2 years ago

Hello and first of all, thanks for the work! Very nice and minimal blog.

I have a simple Q: So after going through the website and samples, I still don't know if it can write latex equations. In markdown usually we are allowed to embed them but not sure if it is the case here.

rexarski commented 2 years ago

In short, you probably need to add mathjax support yourself, which can be done by add the following to your local layouts/partials/custom_head.html

<script>
    MathJax = {
        tex: {
            inlineMath: [
                ['$', '$'],
                ['\\(', '\\)'],
            ],
        },
        svg: {
            fontCache: 'global',
        },
    };
</script>
<script
    id="MathJax-script"
    async
    src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
></script>

This would guarantee mathjax is loaded on every page of your site. Then you can write your $\LaTeX$ the usual way in any .md file. But I think what makes bearblog stand out is its minimalism and simplicity, and mathjax will, for sure, increases the load time a tiny little bit (maybe).

Reference

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.