# Anki 2.1.55 Beta, MathJax Preview

I’ve noticed several problems with the new “Toggle MathJax Rendering” feature. I’m creating this new thread so that all of the issues will be collected in one place instead of being mixed with all of the other comments.

When the MathJax rendering is turned off, adding a new equation using CTRL+M, M or CTRL+M, E (on Windows), inserts an equation that is still rendered.

Here are steps to reproduce:

1. Type an equation and select it.

2. Type CTRL+M, M or CTRL+M, E. Expected: there should be $$...$$ or $...$ inserted around the equation. Actual: the equation is rendered using MathJax:

3. After hitting ENTER, the MathJax preview is still displayed:

1 Like

Copied from Anki 2.1.55 Beta.

Clicking the trash can in the MathJax equation editor does not do anything.

1 Like

I’m running into a problem with the MathJax editor where when I start to edit an equation, the editor box jumps to the position shown in this screenshot, making it nearly impossible to edit the equation.

I was editing a MathJax equation today, and it started to glitch. In particular, the size of the MathJax editor kept changing size without any interaction from me.

A video is available here.

It appears that this happens when the right edge of the MathJax editor extends beyond the right edge of the Add window.

Thanks for the reports, added to Various issues with MathJax editor · Issue #2106 · ankitects/anki · GitHub

It looks like the MathJax editor doesn’t always close when it loses focus. In the following screenshot, “Kripke struct” was highlighted after the MathJax editor was opened. I would expect the editor to close when I click anywhere outside of it.

EDIT: This is actually a more severe problem than I initially thought. The displayed field isn’t accurately displaying its contents. After clicking “add” the first (displayed) field didn’t clear but when I clicked “add” a second time, a warning said “The first field is empty”.

Closing and reopening the Add window fixed the problem.

Edit 2: This problem has occurred several times, now. I’ve not yet isolated what is causing it.

1 Like

Can you avoid it for now by clicking outside the fields area to hide the mathjax editor prior to adding the card?

Ah, yes, it looks like having the MathJax editor open and hitting “CTRL+ENTER” to add the card causes the card to be added without clearing the “Text” field.

@pwintz would you be able to provide a 1 card apkg that demonstrates the jump-to-top-left behaviour?

I’ll try to produce steps to reproduce it, but it was intermittent so no promises.

Some equations become so small, I don’t know if it’s bug or new feature.

I’m guessing the image resizing feature is affecting the MathJax images - you can probably toggle that off with the settings button?

Yes, that is right. Changing this toggle changes the width of the MathJax previews for wide equations.

Shrink Images On:

Shrink Images Off:

Scaling the previews to fit is a nice feature, but could we use the entire width of the text box? Right now the equations scale to a fixed width, namely the width of the text box when the window is shrunk to its narrowest allowed width.

1 Like

Summary of Fixes

The Beta 2 release fixed most the problems reported on this page. Namely, the following reports are all resolved

Summary of Outstanding Reports

I haven’t observed the following defect again, yet, but I’ll keep an eye out for it.

There was no change related to this report:

Overall, the improvements to the MathJax preview and editor are very nice. Well done!

1 Like

In the MathJax editor, when ENTER is pressed (e.g., after typing an equation), then the editor closes and the cursor is moved to the start of the text box. I would expect, instead, that the cursor would be placed immediately after the equation that was just edited.

[Edit: This issue is also reported here.]

On a related note, when ESC while the MathJax editor is open, it should close the MathJax editor but instead it opens a prompt to close the Add/Edit window.

# Update on previous bug reports as of beta 6.

@dae, here is an update on previously outstanding problems with the MathJax preview.

This is fixed.

This hasn’t been fixed, yet. It wouldn’t be so bad if equations were shrunk to fill the entire width of the text box, but they instead shrink to fit the minimum width (that is, the width of the text box when the window is resized to its narrowest allowed width).

This hasn’t been fixed, yet.

Thanks, the resizing should be addressed, and @abdo has sent a fix for the Esc issue.

1 Like