Skip to content

Conversation

@Omikhleia
Copy link
Member

@Omikhleia Omikhleia commented Aug 22, 2025

Placing an accent (say \bar) over a single macro-defined command (say a \Phi, or a \mathbf{x}) caused the engine to crash. The accent logic was incorrectly re-compiling the already compiled argument recursively. We were just lucky in other cases.

Closes #2291

Checks

(All of these were previously crashing)

$$`\Phi' \equiv \Phi - \overline{\Phi}`

$$`\bar{\mathbf{x}}, \bar{\mathbf{abc}}`

$$`\overline{\mathbf{x}}, \overline{\mathbf{abc}}`
image

Details

We were re-compiling an already compiled tree.
Most of the time this would do nothing:

  • for most code paths, the "id" is stripped from the compiled tree in the final return, so most of the logic is just skipped if invoked on an already compiled node.
  • but commands keep the "id" on their evaluated arguments / result, due to an early return in a long sequence of if-elseif... (I have not changed that, though, it's beyond my understanding.)

TL;DR. The key solution anyway is not to perform that useless re-compilation anyway.

Additionally, we were compiling accents from a constructed atom, but we actually know what we eventually want in MathML in that case, so it can be avoided (skipping another recursive evaluation).

My bad, when I implemented accents in Nov. 2024 🙄 (but I don't apologize, it was quite a struggle to get there).

Placing an accent (say `\bar`) over a single macro-defined command
(say a `\Phi`, or a `\mathbf{x}`) caused the engine to crash.
The accent logic was incorrectly re-compiling the already compiled
argument recursively. We were just lucky in other cases.
@Omikhleia Omikhleia added this to the v0.15.14 milestone Aug 22, 2025
@Omikhleia Omikhleia self-assigned this Aug 22, 2025
@Omikhleia Omikhleia requested a review from a team as a code owner August 22, 2025 19:46
@Omikhleia Omikhleia added the bug Software bug issue label Aug 22, 2025
@Omikhleia Omikhleia added this to Math Aug 22, 2025
@github-project-automation github-project-automation bot moved this to In progress in Math Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Software bug issue

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Bolded overline doesn't work in mathmode

2 participants