abricotine icon indicating copy to clipboard operation
abricotine copied to clipboard

Custom delimiters for math fomulas (inline and display)

Open brrd opened this issue 9 years ago • 5 comments
trafficstars

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.

brrd avatar Feb 22 '16 10:02 brrd

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

adiultra avatar Feb 22 '16 11:02 adiultra

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.

joelostblom avatar Aug 15 '16 16:08 joelostblom

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.

RoyiAvital avatar Oct 07 '16 15:10 RoyiAvital

If custom delimiters are supported, \begin{equation} and \end{equation} would be great to add :smile:

Hugo-Trentesaux avatar Aug 29 '18 17:08 Hugo-Trentesaux

@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).

RoyiAvital avatar Aug 29 '18 17:08 RoyiAvital