Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fpiou opened this issue Sep 19, 2023 · 2 comments
Closed

Comments

@fpiou
Copy link

fpiou commented Sep 19, 2023

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.

@edemaine
Copy link
Member

edemaine commented Sep 19, 2023

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?

@fpiou
Copy link
Author

fpiou commented Oct 3, 2023

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants