You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update math-support.md Explains how this mechanism works and adds some ideas on alternatives. * Improve document structure Co-authored-by: Jani Eväkallio <jani.evakallio@gmail.com>
Copy file name to clipboardExpand all lines: docs/math-support.md
+19-4Lines changed: 19 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ layout: mathjax
4
4
5
5
# Math Support
6
6
7
-
The published pages don't support math formulas by default. To enable this feature, you can add the following code snippet to the end of `_layouts/page.html`:
7
+
Published Foam pages don't support math formulas by default. To enable this feature, you can add the following code snippet to the end of `_layouts/page.html`:
@@ -18,11 +18,26 @@ The published pages don't support math formulas by default. To enable this featu
18
18
</script>
19
19
```
20
20
21
-
Example of inline math: $e^{i \pi}+1=0$
22
-
Example of displayed math:
21
+
This approach uses the [MathJax](https://www.mathjax.org/) library to render anything delimited by ```$``` (customizable in the snippet above) pairs to inline math and ```$$``` to blocks of math (like a html div tag) using with the AMS-LaTeX dialect embedded within MathJax.
There are other dialects of LaTeX (instead of AMS), and other JavaScript rendering libraries you may want to use. In a future version of Foam, we may support KaTeX syntax out of the box, but at this time, these integrations are left as an exercise to the user.
38
+
39
+
## Why don't my Math expressions work on my Foam's home page?
40
+
26
41
If you want the index page of your Foam site to render maths, you'll need to add that to `_layouts/home.html` as well, or change the layout of the index page to be "page" instead of "home" by putting this Front Matter on the top of your `readme.md/index.md`:
27
42
28
43
```
@@ -33,4 +48,4 @@ layout: page
33
48
# Your normal title here
34
49
```
35
50
36
-
Reference: [How to support latex in github-pages](https://stackoverflow.com/questions/26275645/how-to-support-latex-in-github-pages)
51
+
Reference: [How to support latex in github-pages](https://stackoverflow.com/questions/26275645/how-to-support-latex-in-github-pages)
0 commit comments