cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Surveyor

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
Highlighted
Navigator

aearhart@southeast.edu 

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

<img

  class="equation_image"

  title="\int_a^bf(x)dx"

  src="https://richland.instructure.com/equation_images/%255Cint_a%255Ebf%2528x%2529dx"

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

  data-equation-content="\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. 

Highlighted

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="https://mycourses.southeast.edu/equation_images/R%253D8.3145%255Cfrac%257BJ%257D%257Bmol%255C%252CK%257D" 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="https://mycourses.southeast.edu/equation_images/RNew%253D8.3145%255Cfrac%257BJ%257D%257Bmol%255C%252CK%257D" 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!

Top Kudoed Authors
Labels