Outils pour utilisateurs

Outils du site


pele_mele:stack_exchange:stackoverflow-62270358

How to define a macro to interpret a unicode character with Mathjax

I have the following markup in my page:

<p>$$\textbf{P} = \left⌊ \frac{\left( \left⌊ \frac{\textbf{A}}{100}\right⌋  \times 8 + 13 \right)}{25}\right⌋  - 5$$</p>

When MathJax tries to render it, I have the following error:

Missing or unrecognized delimiter for \left

I figured that the left floor (⌊) and right floor (⌋) unicode characters are what is not recognized in my expression because when I replace them with \lfloor and \rfloor, it's working properly.

My MathJax configuration is the following:

window.MathJax = {
  tex: {
    inlineMath: [['$', '$'], ['\\(', '\\)']],
    displayMath: [['$$', '$$']]
  }
};

I've tried to add macros to interpret the unicode characters with the following configuration with no luck:

window.MathJax = {
  tex: {
    inlineMath: [['$', '$'], ['\\(', '\\)']],
    displayMath: [['$$', '$$']],
    macros: {
      "⌊": '{\\lfloor}',
      "⌋": '{\\rfloor}'
    }
  }
};

Knowing that I can't change the markup because I not the one maintaining it and I have no way of changing it, is there a configuration that will allows me to make it work.

pele_mele/stack_exchange/stackoverflow-62270358.txt · Dernière modification : 2020/11/18 10:09 de alexis