Skip to content

Commit

Permalink
Test KaTeX math rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
lukstafi committed Oct 26, 2023
1 parent 5536b8a commit c1c2379
Showing 1 changed file with 39 additions and 16 deletions.
55 changes: 39 additions & 16 deletions site/index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,44 @@
<!DOCTYPE html>
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
<html>
<head>
<title>A Curious OCaml Book</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">

<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
<head>
<title>A Curious OCaml Book</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">

<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>
</head>
<body>
<h4>Curious OCaml</h4>
<a href="new_book.html">Curious OCaml</a> -- work in progress.
<h4>Functional Programming 2012-2013</h4>
<a href="old_lectures_as_book.html">Functional Programming Course 2012-2013</a> slides converted to a book format -- conversion cleanup in progress.
</body>
</html>
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"
integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8"
crossorigin="anonymous"></script>

<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js"
integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>
</head>

<body>
<h4>Curious OCaml</h4>
<a href="new_book.html">Curious OCaml</a> -- work in progress.
<h4>Functional Programming 2012-2013</h4>
<a href="old_lectures_as_book.html">Functional Programming Course 2012-2013</a> slides converted to a book format --
conversion cleanup in progress.
<h4>Test math rendering</h4>
<p>How can we define them? Think in terms of <em>derivation trees</em>:
</p>
<p><span class="math display"> \frac{\begin{array}{ll}
\frac{\begin{array}{ll}
\frac{\,}{\text{a premise}} &amp; \frac{\,}{\text{another premise}}
\end{array}}{\text{some fact}} &amp; \frac{\frac{\,}{\text{this we have by default}}}{\text{another fact}}
\end{array}}{\text{final conclusion}} </span></p>
<p>Define by providing rules for using the connectives: for example, a
rule <span class="math inline">\frac{\begin{array}{ll} a &amp; b
\end{array}}{c}</span> matches parts of the tree that have two premises,
represented by variables <span class="math inline">a</span> and <span class="math inline">b</span>, and have any
conclusion, represented by
variable <span class="math inline">c</span>.
</p>
</body>

</html>

0 comments on commit c1c2379

Please sign in to comment.