question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with subscript or superscript

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
edemainecommented, Dec 3, 2018

With that instruction, I can reproduce the error. It seems to happen with \log_5 x but 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 by op’s MathML builder returning a document fragment: https://github.com/KaTeX/KaTeX/blob/f71f469d4b3ca97654702a0807e736d176f4c4c5/src/functions/op.js#L251-L263

I think we need to modify supsub’s MathML builder to wrap a fragment in an mrow, in this line: https://github.com/KaTeX/KaTeX/blob/f71f469d4b3ca97654702a0807e736d176f4c4c5/src/functions/supsub.js#L204

Alternatively, we need to bring the &ApplyFunction; outside of the subscript…

1reaction
JMSS-Unknowncommented, Dec 3, 2018

The error shows up if you select CSS under filter output in the console. Is this an issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Superscript/Subscript Issue - Microsoft Community
I tried to open an older document in which the superscripts/subscripts looked "normal" and the older document opened with them looking as they ......
Read more >
Known Typographical and Other Errors
All of the errors listed below except the last 11 and the errors in Table 10.2 ... Delete double-occurrence of "c-subscript-s-superscript-s-capital-psi" in ...
Read more >
Superscript-subscript uncertainty notation
Superscript-subscript uncertainty notation · 2 · 1 · can this simply mean like +/- error where two values of error are possible like...
Read more >
Microsoft Word: Using Subscript and Superscript - YouTube
Learn how to easily add subscripts and superscripts into your Microsoft Word documents. These are great for adding math equations into ...
Read more >
HOW TO DO SUBSCRIPT IN WORD | Superscript text and ...
Learn how convert normal text into superscript and subscript text with ... to find the solution and developed a way to solve the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found