# Using asciimathml

#### Juan

02 Feb, 2016 03:49 PM

Hello,

I am trying to use asciimathml within a document but I cannot make it work consistently.

This is what I am doing:
- I enabled Mathjax and selected the 'AM_HTMLorMML' option. - I create a document with the following content: sum_(i=1)^n i^3=((n(n+1))/2)^2 -The result is that sometimes , not always, it is properly rendered as a formula, but as soon as I edit it, it reverts to plain text.

Any idea of what might be the issue?

Thanks,
Juan

1. Support Staff Posted by Brett on 02 Feb, 2016 03:53 PM

It may be because of the way that Marked handles locating the current
edit point, which inserts a tiny bit of markup in the element that
contains the first change in the document. This markup would be inserted
prior to MathJax rendering, and thus MathJax may break because of it. If
you edit above or below the equation, does it fix the issue?

-Brett

2. Posted by Juan on 02 Feb, 2016 04:19 PM

Yes, it has definitely something to do with it.

This is what I tried:
- if I modify the formula and click out of it and edit some text before saving, I get the formula as plain text - if I modify the formula, save the document, edit some text and saves again, I get a nice formula

Juan

3. Support Staff Posted by Brett on 02 Feb, 2016 04:40 PM

If you edit both at the same time and the equation comes before edited text, the markup will go into the equation. Are you making text changes before or after the math?

This is an issue that I thought I had solved, but I'll take another look at it.

Thanks,

Brett

4. Posted by Juan on 02 Feb, 2016 04:48 PM

Editing formula and text at the same time (without saving in between)
- if I edit text after the equation, I get plain text - if I edit before the equation, I get the formula right

5. Support Staff Posted by Brett on 02 Feb, 2016 05:05 PM

Right, because editing after the equation means the equation is the first change in the document. Thus, it gets the markup.

Thanks,

Brett

## Reply to this discussion

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

### »

#### Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

# Keyboard shortcuts

### Generic

? Show this help Blurs the current field

### Comment Form

r Focus the comment reply box Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

## Recent Discussions

 16 Mar, 2018 11:04 AM Copy&paste and Line breaks 15 Mar, 2018 05:05 PM hang on adding image 13 Mar, 2018 08:20 AM Buy Custom Fly Rods | Lemke Reel Seats | J-Cook Fly Rods 12 Mar, 2018 08:07 PM Unable to use Marked with Bear 11 Mar, 2018 08:43 AM Scrivener 3

## Recent Articles

 Highlight sentences longer than a certain number of words In-app purchase issues (Error Domain=Paddle Code=0 "(null)") License code has already been utilized How do I retrieve a lost license (direct version) Custom CSS: Writing custom CSS for Marked