mathjax / MathJax

Beautiful and accessible math in all browsers
http://www.mathjax.org/
Apache License 2.0
10.11k stars 1.16k forks source link

Add suppport for \imageof and \origof #3163

Open Paulemeister opened 7 months ago

Paulemeister commented 7 months ago

Currently the symbols ⊶ (U+22B6 ORIGINAL OF) and ⊷ (U+22B7 IMAGE OF) are not supported. It is used in denoting the Fouriertransformations of functions for example

KaTeX implemented this 4 years ago. Here is the link to the corresponding issue on their side.

dpvc commented 7 months ago

One reason MathJax doesn't have these is that the MathJax TeX fonts don't include the needed unicode characters (the issue you link to indicates that the fonts used by KaTeX also don't have the needed characters for these macros; that is because KaTeX took the MathJax fonts as the basis for theirs).

In general, we do not make macros for characters that we don't have in our fonts (with a few legacy exceptions), so we don't plan to add these macros at the moment. Apparently, KaTeX is willing to do so.

You can, however, define them yourself using

$
\newcommand{\imageof}{\mathrel{\unicode{x22B7}}}
\newcommand{\origof}{\mathrel{\unicode{x22B6}}}
$

before you use them. Alternatively, you can add them to your MathJax configuration using

MathJax = {
  tex: {
    macros: {
      imageof: '\\mathrel{\\unicode{x22B7}}',
      origof:  '\\mathrel{\\unicode{x22B6}}'
    }
  }
};

Note that the character displayed for this will vary from user to user depending on the fonts installed on their system, so they may not be good matches for the rest of the mathematics (and what you see may not be what others see). MathJax v4 (currently out in beta release) has new fonts with wider character coverage, and the default fonts do include these glyphs, so in v4, the results will be more consistent.