forked from sbrunk/storch
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Laika Math expressions #1
Comments
Options:
Links: Explanation: |
Hack: add script to header of all files. <!DOCTYPE html>
<html lang="${?laika.site.metadata.language}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Laika 0.18.1 + Helium Theme" />
<title>${cursor.currentDocument.title}</title>
...
@:heliumInitPreview(container)
<script> /* for avoiding page load transitions */ </script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-vKruj+a13U8yHIkAyGgK1J3ArTLzrFGBbBc0tDp4ad/EyewESeXE/Iv67Aj8gKZ0" 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-PwRUT/YqbnEjkZO0zZxNqcxACrXe+j766U2amXcgMg5457rve2Y7I6ZJSm2A0mS4" 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>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
// customised options
// • auto-render specific keys, e.g.:
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false},
],
// • rendering keys, e.g.:
throwOnError : false
});
});
</script>
</head> |
hmf
added a commit
that referenced
this issue
Aug 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The original code changes the Laika templates to add the katex renderer (see
default.template.html
) The problem is that Laika updates may make changes to the templates, so we have to change these too otherwise we run the risk of missing on new features and bug corrections.Can we use a Laika plugin for this?
References:
** https://stackoverflow.com/questions/15996651/is-there-a-way-to-include-math-formulae-in-scaladoc
The text was updated successfully, but these errors were encountered: