KaTeX dies when attempting to render `\begin\displaystyle`
Author: AresielCreated Apr 3, 2024Updated Sep 16, 2026
Labelsbug
Before reporting a bug
- Check common issues.
- Check the bug is reproducible in the demo. If not, check KaTeX is up-to-date and installed correctly.
- Search for existing issues.
Describe the bug:
Attempting to render \begin\displaystyle causes KaTeX to crash with the error message "Expected node of type textord, but got node of type styling".
To Reproduce: Steps to reproduce the behavior:
- Go to https://katex.org/
- Write
\begin\displaystylein the demo box - See error in box directly to the right of demo box
Expected behavior: I expect it to either render correctly as LaTeX (whatever this now entails), or for KaTeX to display it as invalid LaTeX as usual.
Screenshots:
Environment (please complete the following information):
- KaTeX Version: 0.16.10
- Device: Desktop
- OS: Windows 11
- Browser: Firefox
- Version: 125.0b7
Additional context: This issue originally occured on a separate site, but as it's reproducable on https://katex.org/, that ought not matter.
Source: KaTeX/KaTeX