-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
docs/_posts/2024-04-06-Integrate-MathJax-into-jekyll.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
layout: post | ||
title: "Integrate MathJax into Jekyll" | ||
date: 2024-04-06 18:11:18 -0500 | ||
categories: github-pages Jekyll MathJax | ||
--- | ||
|
||
Jekyll Markdown Support doesn't includes mathematical equations. If one wants to write mathematical equations, integrating | ||
MathJax might be one possbile solution. | ||
|
||
If you are also using minima as the theme, you can allow mathematical syntax in your post pages by performing following steps: | ||
- Run `bundle info --path` followed by the name of the theme’s gem, e.g., `bundle info --path minima` for Jekyll’s default theme. | ||
This returns the location of the gem-based theme files. For example, the Minima theme’s files might be located in /usr/local/lib/ruby/gems/2.6.0/gems/minima-2.5.1 on macOS. | ||
- Open the themes directory, and find the `default.html` file under the `_layout folder`, `copy` that file into the _layouts folder of your project. If you have `no` `_layouts folder` under the `docs folder` in your project just like me, you might need to `create` that the _layouts folder. | ||
- `Append` the following scirpts tag into the `default.html` file | ||
|
||
{% highlight html %} | ||
<script type="text/javascript" | ||
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> | ||
</script> | ||
{% endhighlight %} | ||
|
||
Now your default.html file under the _layouts folder might look like this: | ||
|
||
![Defaul.html](/berrywhj.github.io/assets/img/defaul-html.png) | ||
|
||
|
||
Then your post pages should be able to render mathematical equations properly. | ||
|
||
![Mathematical Equations](/berrywhj.github.io/assets/img/mathematical-equations.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.