Skip to content

Commit

Permalink
geekbook speaks latex
Browse files Browse the repository at this point in the history
  • Loading branch information
mmagnus committed Apr 25, 2023
1 parent 161dff4 commit 3206cf7
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engine/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def collect_to_pdf_save(self):
def get_html(self):
"""Compile md to get html"""
self.html = markdown.markdown(
self.md, extensions=[GithubFlavoredMarkdownExtension(), 'footnotes']) # (linenums=False)'])
self.md, extensions=[GithubFlavoredMarkdownExtension(),
'mdx_math', 'footnotes']) # (linenums=False)'])
# html = '<link rel="stylesheet" href="/home/magnus/Dropbox/lb_v2/templates/Pygments/css/pygments.css" type="text/css">' + html

def compile(self):
Expand Down
1 change: 1 addition & 0 deletions themes/default/notes/css/math/katex.min.css

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions themes/default/notes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,28 @@
<script src="js/bootstrap-toc.js"></script>
<script src="js/highlight.min.js"></script>

<!-- math -->
<script type="text/javascript" src="js/math/MathJax.js"></script>

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
extensions: ["MathMenu.js", "MathZoom.js"]
});
</script>

<script type="text/javascript" src="js/lightbox2/src/js/lightbox.js"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/katex/dist/contrib/mathtex-script-type.min.js" defer></script>

<link rel="stylesheet" href="css/math/katex.min.css" crossorigin="anonymous">
<script src="js/math/katex.min.js" crossorigin="anonymous"></script>
<script src="js/math/mathtex-script-type.min.js" defer></script>
<!-- math -->

<link rel="stylesheet" href="js/lightbox2/src/css/lightbox.css" type="text/css">

<link rel="icon" type="image/x-icon" href="img/favicon.png">
Expand Down
19 changes: 19 additions & 0 deletions themes/default/notes/js/math/MathJax.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions themes/default/notes/js/math/katex.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions themes/default/notes/js/math/mathtex-script-type.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3206cf7

Please sign in to comment.