• Resolved Steeven

    (@steeven)


    The [katex]…[/katex] shortcode is default, and [latex]...[/latex] should also work according to the documentation in order to be compatible with other latex plugins.

    But will or can it also be compatible with usual Dollar sign wrapping, $…$ and $$…$$ as typical tex compilers accept?

    I have for a while been using Simple Mathjax that allows for these Dollar signs. So all math on my entire site is made with these. I’d like to keep my Dollar signs not just to avoid the huge task of changing all occurences of them, but also because it is much neater in user input fields to guide users to use Dollar signs, which they may be familiar with from latex compilers, rather than shortcode syntax.

    I’d be grateful if I have it confirmed whether Dollar sign wrapping is supporting. Thank you very much.

    • This topic was modified 4 years ago by Steeven.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Thomas Churchman

    (@beskhue)

    Unfortunately this is not supported.

    For security and code maintainability considerations, the plugin intentionally uses only WordPress shortcodes and WordPress blocks, such that WordPress decides which parts should be rendered by KaTeX. In contrast, the MathJax plugin does a site-wide search for $...$ on the browser. This would actually have created a vulnerability in older versions: https://snyk.io/vuln/SNYK-JS-MATHJAX-451470.

    Also note that in a default WordPress installation, shortcodes are not supported in comments (again due to security considerations, as well as performance). That means this plugin cannot be used as-is to support TeX rendering in comments.

    You could enable shortcodes in comments by registering the right filters in functions.php (but be careful).

    Thread Starter Steeven

    (@steeven)

    Thank you very much @beskhue for your informative answer.

    I use a theme that allows for internal chat messaging among users, and it is in these chat-fields that Dollar-signs are used by users to write math within their messages to each other (such as between tutors and students). Such Dollar-math works fine with Simple Mathjax, but that plugin in general has issues both with speed and heaviness and once in a while reliability, which is why I was excited to find the Katex plugin.

    I will have to think over how to allow for users’ input of math in their chat messaging.

    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can we use Dollar signs $…$ and $$…$$?’ is closed to new replies.