Showing results for 
Search instead for 
Did you mean: 

Math and LaTeX Problem in Pages

I believe this just happened after the latest update.

I enter math equations and constants for my chemistry classes using the advanced math editor. All of my previously made math equations in LaTeX now have "Latex: " inserted into the editing window. If I don't edit it and just close it, it's ignored.

But, if I edit the equation then I have to delete the "LaTeX: " or it's rendered in the equation.

I just checked and this doesn't happen with any new equations I type up. Only ones which previously existed before the update.

Anyone else seeing this?

2 Replies

I am not seeing this in Chrome on Windows. I think I saw that briefly a couple of years ago, but it's been so long that I might be misremembering.

The code that manages this hasn't changed since October 2019 and that was just a code cleanup, it didn't change any functionality. In fact, most of the changes since 2018 have been code clean up and modernization. If you're hosted by Instructure (and not self-hosting), then it's unlikely the latest upgrade is the culprit.

What you are seeing is the ALT tag. It is prefaced with "LaTeX: " and then the LaTeX code that you entered. I think it used to be that it was just the LaTeX code itself that was shown (the current file was created in 2018 [it changed extensions] and it had the LaTeX: in there).

In the source code for the EquationEditorView.js, there is a function called getEquationText. For images that have a classname of 'equation_image', it tries to return the data-equation-content attribute and if it's not there, then it returns the alt tag.

You didn't show the HTML source of your equation (under HTML Editor). I wonder if it is missing the data-equation-content attribute. Here's what one of my older equation objects (August 2015) looks like





  alt="LaTeX: \int_a^bf(x)dx"



Can you look at your HTML and see if it's missing that data-equation-content attribute? If so, that would explain things. If not, can you include the HTML so we can see what is there -- it might be something else that's off?

How old are these equations? Were they created inside Canvas or were they imported from somewhere else? 

What is actually displayed to the students doesn't come from either the title, alt, or data-equation-content. It comes from the src, which is a double-URIencoded representation of the LaTeX. That means that you should not be seeing the LaTeX: unless you hover to display the Alt tag. It should not be part of the image.

If the data-equation-content is missing on the image tags, then you're going to have to remove the LaTeX: from the beginning to get it to render with out. 


These are all equations which have been written in Canvas in advanced math editing mode between the middle of May and now.

Yep. It's the data-equation-content attribute which is missing!

Here's the old one (end of May)-

<img class="equation_image" title="R=8.3145\frac{J}{mol\,K}" src="" alt="LaTeX: R=8.3145\frac{J}{mol\,K}" />

Here's a new one I just wrote-

<img class="equation_image" title="RNew=8.3145\frac{J}{mol\,K}" src="" alt="LaTeX: RNew=8.3145\frac{J}{mol\,K}" data-equation-content="RNew=8.3145\frac{J}{mol\,K}" />

I went back and looked at some other equations and not all of them are missing the attribute. Very weird. But at least I know why it's doing even if I don't know why it happened.

Thank you so much for your help!