KaTeX/KaTeX

Bug: Brackets not rendered when using `\dfrac` inside `\underset` with `output="html"`

fpiou opened this issue · 2 comments

Description:
When using the \dfrac or \frac command within an \underset or \underbrace command inside brackets with the output set to "html", the brackets are not being rendered. Here is the problematic LaTeX code:

1.
\[
\left[\underset{\dfrac{a}{b}}{\alpha}\right]
\]

2. 
\[
f(x)=4\left[ x^2-2\times\left(-\frac{3}{8}\right)x+\underbrace{\left(-\frac{3}{8}\right)^2-\left(-\frac{3}{8}\right)^2}_{\alpha^2-\alpha^2} \right]-7
\]

Expected behavior:
The brackets should be rendered around the symbol with its underset.

Actual behavior:
The brackets are not visible.

Steps to reproduce:

  1. Use the provided LaTeX code in a KaTeX environment with the output set to "html".
  2. Observe that the brackets are not rendered.
  3. Replace \dfrac with \frac in first example and observe that the brackets are rendered correctly.

Both examples render with brackets on the demo site on katex.org:

image

image

So I suspect there's something wrong with your particular setup. Perhaps you're sanitizing SVG elements, which are needed here?

Thank you for pointing that out. You were right, I had a specific CSS rule for SVG elements that was interfering with the formulas on my site. After adjusting that rule, everything is working correctly now. Thanks for your assistance !