#3942·KaTeX

KaTeX dies when attempting to render `\begin\displaystyle`

Author: AresielCreated Apr 3, 2024Updated Sep 16, 2026
Labelsbug

Before reporting a bug

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:

  1. Go to https://katex.org/
  2. Write \begin\displaystyle in the demo box
  3. 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: image

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.