Outils pour utilisateurs

Outils du site


pele_mele:stack_exchange:stack_overflow:62270358

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
pele_mele:stack_exchange:stack_overflow:62270358 [2024/11/23 04:02] – supprimée - modification externe (Date inconnue) 127.0.0.1pele_mele:stack_exchange:stack_overflow:62270358 [2024/11/23 04:02] (Version actuelle) – ↷ Nom de la page changé de pele_mele:stack_exchange:stack_overflow:stackoverflow-62270358 à pele_mele:stack_exchange:stack_overflow:62270358 alexis
Ligne 1: Ligne 1:
 +====== How to define a macro to interpret a unicode character with Mathjax ======
 +I have the following markup in my page:
 +
 +<code html>
 +<p>$$\textbf{P} = \left⌊ \frac{\left( \left⌊ \frac{\textbf{A}}{100}\right⌋  \times 8 + 13 \right)}{25}\right⌋  - 5$$</p>
 +</code>
 +
 +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:
 +
 +<code javascript>
 +window.MathJax = {
 +  tex: {
 +    inlineMath: [['$', '$'], ['\\(', '\\)']],
 +    displayMath: [['$$', '$$']]
 +  }
 +};
 +</code>
 +
 +I've tried to add macros to interpret the unicode characters with the following configuration with no luck:
 +
 +<code javascript>
 +window.MathJax = {
 +  tex: {
 +    inlineMath: [['$', '$'], ['\\(', '\\)']],
 +    displayMath: [['$$', '$$']],
 +    macros: {
 +      "⌊": '{\\lfloor}',
 +      "⌋": '{\\rfloor}'
 +    }
 +  }
 +};
 +</code>
 +
 +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.
 +
 +<WRAP info>
 +[[https://stackoverflow.com/questions/62270358/how-to-define-a-macro-to-interpret-a-unicode-character-with-mathjax|How to define a macro to interpret a unicode character with Mathjax - Stack Overflow]]
 +</WRAP>