Support Latex in Github Page to show math equations
2 min read
Recently, I started to use Github Page to write a summary on a course that I followed on Edx about Statistics. I am using Jekyll to create static websites. In order to insert lots of math equations, I am using Mathjax.
You can add these scripts in the head to import Mathjax:
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
inlineMath: [['$','$']]
}
});
</script>
By doing so, you can show most of the math functions correctly, except for some inlineMath: math between two $ signs.
| what you want to show | what web shows |
|---|---|
| seperation of table column | |
| (no ”{}”) | |
(<em> tags) |
Solutions:
| what you want to show | What you should enter |
|---|---|
| ` | ` |
{ | \\{ |
} | \\} |
)_ (underscore) | )\_ or add a space between ) and _ |
_( (underscore) | \_\( or add a space between _ and ( |
}_ (underscore) | }\_ or add a space between } and _ |
_{ (underscore) | \_{ or add a space between _ and { |
| more than 1 * in the paragraphe | \* |
\Leftrightarrow (not \Harr) | |
\arg\max (not \argmax) | |
2 { together | { { (add a space between them) |