Skip to content

Commit

Permalink
Add MathJax support
Browse files Browse the repository at this point in the history
  • Loading branch information
tnemoz committed Dec 26, 2022
1 parent 69826f0 commit 54bf0d4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
28 changes: 28 additions & 0 deletions _includes/mathjax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
// displayMath: [['$$','$$']],
processEscapes: true,
processEnvironments: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
TeX: { equationNumbers: { autoNumber: "AMS" },
extensions: ["AMSmath.js", "AMSsymbols.js"] }
}
});
MathJax.Hub.Queue(function() {
// Fix <code> tags after MathJax finishes running. This is a
// hack to overcome a shortcoming of Markdown. Discussion at
// https://github.com/mojombo/jekyll/issues/199
var all = MathJax.Hub.getAllJax(), i;
for(i = 0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});

MathJax.Hub.Config({
// Autonumbering by mathjax
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
</script>
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
-->
<html lang="{{ site.locale | slice: 0,2 | default: "en" }}" class="no-js">
<head>
{% if page.use_mathjax %}{% include mathjax.html %}{% endif %}
{% include head.html %}
{% include head/custom.html %}
</head>
Expand Down
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
---
layout: home
author_profile: true
use_mathjax: true
---
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec justo ligula, euismod sit amet fringilla eleifend, tempus eu orci. Pellentesque blandit nunc sem. Vivamus a velit metus. Pellentesque euismod elit enim, sed eleifend metus malesuada et. Curabitur est urna, lobortis a dui vitae, vestibulum maximus erat. Proin rutrum lorem justo. Donec non ex vel erat accumsan laoreet. Donec massa libero, congue vel commodo quis, ornare quis tellus. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur iaculis tortor vitae rhoncus bibendum. Donec fringilla vehicula dolor, a interdum quam.

Donec eu nisl vitae justo imperdiet accumsan nec in risus. Vestibulum sed erat ut lectus lacinia vehicula. Phasellus rhoncus tincidunt diam id molestie. Suspendisse potenti. Nulla erat lacus, mattis non tempor sed, consequat at mi. In hac habitasse platea dictumst. Ut molestie, lectus eu vulputate finibus, dolor risus lobortis nunc, sit amet volutpat ipsum elit quis turpis. Ut mollis nisl lectus, non tristique enim fermentum sed. Vivamus laoreet condimentum nisi, a tincidunt odio dapibus vel. Aenean venenatis congue ex sit amet luctus. In laoreet enim sodales sollicitudin luctus. Aliquam dictum sollicitudin elit, vitae tincidunt tellus egestas nec.

Proin sit amet vulputate dolor. Ut cursus suscipit neque, vel dignissim urna mollis ac. Pellentesque mollis, justo eu elementum ultricies, mauris lorem luctus nunc, tempus bibendum lacus neque vel eros. Fusce sollicitudin lacus eu nisi fermentum, sed mattis mauris egestas. In vitae mauris ac magna auctor blandit. Suspendisse potenti. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nulla fringilla tincidunt dolor congue viverra.

$$\sum_{k=1}^n\frac1k-\ln(n)\xrightarrow[n\to+\infty]{}\gamma$$

In consectetur in mauris iaculis iaculis. Mauris gravida sem sapien, ac congue sapien pellentesque quis. Proin tincidunt mauris enim, in porta justo interdum sit amet. Nam tincidunt orci vitae eros egestas, in ultrices risus congue. Donec blandit sapien ex, non faucibus odio ultrices et. Nullam porta sodales justo, vel pharetra metus bibendum sed. Nam porttitor venenatis ante vel varius. Suspendisse ut neque elit. In ac ipsum volutpat eros faucibus molestie. Morbi venenatis mi sed ipsum convallis volutpat. Mauris at facilisis metus. Sed a commodo ex, sed fermentum nisl. Etiam libero turpis, tincidunt mattis iaculis non, suscipit sit amet arcu. Integer iaculis iaculis elit ut tempus. Ut ultrices, turpis nec imperdiet consectetur, lectus odio tempus dui, et molestie lorem orci lobortis urna. Praesent aliquet pulvinar tortor, ullamcorper posuere eros viverra at.

Donec at velit congue, pulvinar dui id, porta mauris. Cras pulvinar pharetra rhoncus. Vestibulum id luctus orci, quis elementum justo. Duis feugiat ut massa vel tristique. Donec sed sollicitudin lorem. Pellentesque tempor pulvinar augue, eget tincidunt justo laoreet ut. Nunc vel nibh vel dolor laoreet fringilla in quis nibh. Vestibulum vel tortor vel justo feugiat laoreet congue et metus. Vivamus a neque in dui pellentesque eleifend. Integer congue turpis ex, in molestie lectus sagittis eu. Vivamus tempor dictum vulputate. Pellentesque id condimentum eros, ac sagittis lacus. Integer porta risus a ipsum varius dignissim. Quisque tincidunt dolor ullamcorper turpis ornare dapibus.
Expand Down

0 comments on commit 54bf0d4

Please sign in to comment.