KaTeX: Error with subscript or superscript
Typing \log_{10}\left(x\right) into the preview at katex.org results in the error
Invalid markup: Incorrect number of children for <msub/> tag.
Same with
\log^{10}\left(x\right)
I am using Firefox 63.0.3 on Windows. The error does not occur on Chrome or Edge.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (8 by maintainers)
With that instruction, I can reproduce the error. It seems to happen with
\log_5 xbut not\log x.Ah, I see the issue now.
<msub>is supposed to have only two children, but in this example, it has 3. This is caused byop’s MathML builder returning a document fragment: https://github.com/KaTeX/KaTeX/blob/f71f469d4b3ca97654702a0807e736d176f4c4c5/src/functions/op.js#L251-L263I think we need to modify
supsub’s MathML builder to wrap a fragment in anmrow, in this line: https://github.com/KaTeX/KaTeX/blob/f71f469d4b3ca97654702a0807e736d176f4c4c5/src/functions/supsub.js#L204Alternatively, we need to bring the
⁡outside of the subscript…The error shows up if you select CSS under filter output in the console. Is this an issue?