# How to use Latex on jekyll?

**URL:** <https://talk.jekyllrb.com/t/how-to-use-latex-on-jekyll/4119>\
**Category:** Uncategorized\
**Created:** [March 23, 2020, 11:23pm UTC](https://talk.jekyllrb.com/t/how-to-use-latex-on-jekyll/4119 "2020-03-23T23:23:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brando90](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brando90/32/1902_2.png) [@brando90](https://talk.jekyllrb.com/u/brando90)\
**Post date:** [March 23, 2020, 11:23pm UTC](https://talk.jekyllrb.com/t/how-to-use-latex-on-jekyll/4119/1 "2020-03-23T23:23:15Z")

</div>

I am currently hosting my webpage on jekyll. What is the easiest way to display equations in my blog?

---

<div class="post-metadata">

**Author:** ![KonVas](https://avatars.discourse-cdn.com/v4/letter/k/ed655f/32.png) [@KonVas](https://talk.jekyllrb.com/u/KonVas)\
**Post date:** [March 24, 2020, 10:27am UTC](https://talk.jekyllrb.com/t/how-to-use-latex-on-jekyll/4119/2 "2020-03-24T10:27:02Z")

</div>

Maybe not exactly what you are looking for, but I recently found this [https://shd101wyy.github.io/markdown-preview-enhanced/#/math](https://shd101wyy.github.io/markdown-preview-enhanced/#/math)

---

<div class="post-metadata">

**Author:** ![ian-whitestone](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/ian-whitestone/32/3297_2.png) [@ian-whitestone](https://talk.jekyllrb.com/u/ian-whitestone)\
**Post date:** [February 28, 2021, 3:47pm UTC](https://talk.jekyllrb.com/t/how-to-use-latex-on-jekyll/4119/3 "2021-02-28T15:47:40Z")

</div>

Instructions from [LaTeX in Jekyll](http://www.iangoodfellow.com/blog/jekyll/markdown/tex/2016/11/07/latex-in-markdown.html) worked fine for me.

**TL,DR**

- Add the following line to `_layouts/post.html`:
  - `<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>`

- Test out by adding the markdown I’ve provided below to one of your posts.

```markdown
# Testing out latex

$$ \nabla_\boldsymbol{x} J(\boldsymbol{x}) $$

```

You should see something like this:

 ![CleanShot 2021-02-28 at 10.44.21@2x](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/f/f4f6dd57557951b9ccf6b5ba169fc3683deeeff1.png)

Code for the jekyll blog I’m using this in can be found [GitHub - ian-whitestone/ian-whitestone.github.io](https://github.com/ian-whitestone/ian-whitestone.github.io), cloned from the github repo barryclark/jekyll-now (discourse isn’t letting me post more than 2 links 🙁 ).

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [March 1, 2021, 8:04am UTC](https://talk.jekyllrb.com/t/how-to-use-latex-on-jekyll/4119/4 "2021-03-01T08:04:55Z")

</div>

@brando90 for future reference, rather add some more info in your question based on the guidelines on StackOverflow or similar.

Such as show some attempts of code you tried or at least links to tutorials or plugins you have already researched and maybe haven’t tried yet. Then we can comment on the quality of what you find or which is more relevant or easy, or we can recommend something you missed but that we like working with.

You can also make your question less broad. Like show some equations you want to use, describe if you are using GH Pages, etc. Or request not just the name of a plugin but request a snippet too.

You can also let us know if you have already searched through [Latex questions](https://talk.jekyllrb.com/search?context=topic&context_id=4119&q=Latex&skip_context=true) on Jekyll forums and why the tools used there are not suitable or if you need guidance on choosing or using one
