Katex: Not rending latex modifiers

Created on 25 Aug 2019  路  6Comments  路  Source: KaTeX/KaTeX

Before reporting a bug

Describe the bug:
There is rendering issue when using katex and latex modifiers

(La)TeX code:
The code of (La)TeX you tried to render:

${\displaystyle |\psi \rangle =\alpha |0\rangle +\beta |1\rangle }$

Expected behavior:

_from: latex.codecogs.com_

Screenshots:

image

le of displaystyle is rendered :man_facepalming:

Environment (please complete the following information):

  • KaTeX Version: ^0.10.1 with showdown-katex
  • Device: Desktop
  • OS: Arch Linux
  • Browser: Any
  • Version: Any
bug

Most helpful comment

@tbhaxor You need to raise this issue in a showdown-katex forum, not here. We don't know showdown-katex here and we can't tell if such a configuration is well formed or not.

If you get to the point where you have successfully invoked KaTeX and not AsciiMath, and then KaTeX is still acting improperly, then please come back and raise a new KaTeX issue here.

All 6 comments

showdown-katex can render either KaTeX or AsciiMath. I can reproduce the faulty rendering on the showdown-katex demo page by submitting the input string to an AsciiMath field instead of to a KaTeX field.

showdown

The same imput string, when submitted to a latex field on the demo page, renders correctly.

I would speculate that your installation is set so that the $...$ delimiters are programmed to invoke AsciiMath instead of KaTeX.

The demo on katex.org renders the correct thing. This seems like an issue with showdown-katex and not katex itself.

So how do i fix it
the showdown-katex is using 0.10 version of katex

As @ronkok wrote above, the fix is likely to change the configuration in showdown-katex to use LaTeX mode instead of ASCII math mode. If it's not clear from the documentation, perhaps you should open an issue for showdown-katex. We know KaTeX but unfortunately not as much about showdown-katex.

@ronkok

    {
      displayMode: true,
      throwOnError: false, // allows katex to fail silently
      errorColor: '#ff0000',
      delimiters: [
        { left: "$", right: "$", display: false }, // katex default
        { left: '~', right: '~', display: false, asciimath: true },
      ],
    }

This is my configuration

@tbhaxor You need to raise this issue in a showdown-katex forum, not here. We don't know showdown-katex here and we can't tell if such a configuration is well formed or not.

If you get to the point where you have successfully invoked KaTeX and not AsciiMath, and then KaTeX is still acting improperly, then please come back and raise a new KaTeX issue here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mbourne picture mbourne  路  3Comments

mpolyak picture mpolyak  路  3Comments

ylemkimon picture ylemkimon  路  3Comments

hagenw picture hagenw  路  3Comments

pvnr0082t picture pvnr0082t  路  4Comments