yousinix / portfolYOU

A beautiful portfolio Jekyll theme that works with GitHub Pages.
https://yousinix.github.io/portfolYOU
MIT License
987 stars 595 forks source link

add support for katex? #98

Open sakgoyal opened 2 years ago

sakgoyal commented 2 years ago

I wonder if its possible to add support for katex math rendering. markdown is quite limited and I really want a way to be able to display math properly. Im going to be writing up blog posts on lots of math heavy topics so being able to render equations is extremely useful. I would strongly perfer to avoid javascript if possible. I want the least amount of js possible on my site.

ChiBei commented 1 year ago

Could you please support Latex?

SydianAndrewChen commented 1 year ago

Also in need of latex.

SydianAndrewChen commented 1 year ago

Just figure out how to add latex quickly. Got help from this post.

In the markdown file that requires latex, add this code after the front matter:

---
title: some title
tags: [some tags]
style: fill
color: primary
description: some description
---

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

# Write some latex here. It should appear normal now.