abricotine
abricotine copied to clipboard
Custom delimiters for math fomulas (inline and display)
From #7
Would it be possible to display math when wrapped only in single '$'s too (or is there an easy way to hack to config to allow this)? Doing so would help to make Abricotine more compatible with Pandoc Markdown.
More generally, the idea would be to allow the use of any delimiter with a new option in config.
Inline and display math should be supported.
Katex supports custom delimiters, here is the syntax:
<script>
renderMathInElement(
document.getElementById("test"),
{
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "\\[", right: "\\]", display: true},
{left: "$", right: "$", display: false},
{left: "\\(", right: "\\)", display: false}
]
}
);
</script>
#16
This would be a great feature! As indicated in the issue, it would be very helpful to be able to use both $ and $$ as math delimiters in Abricotine, since Pandoc/Latex requires the single $ for inline math and double for displayed equations.
It can also be achieved in MathJaX:
<!-- Scripts to handle MathJax -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script async src="http://markdownedit.com/assets/js/mathjax-scripts.js"></script>
What really needed is making difference between Inline Math and Display Math.
If custom delimiters are supported, \begin{equation} and \end{equation} would be great to add :smile:
@Hugo-Trentesaux, No need. Once you warp the Math around a label which you guide MathJaX to handle you'll get support for those environments "For Free" (It's built in MathJax).