# Option to use MathJax 3?

#### fiona.alpha137

31 Jan, 2020 09:47 PM

Hi Brett,

I realized recently that MathJax 3.0 has been released, and among many new features, it now has the physics latex package which is crucial for my writing needs. I think MathJax 3.0 has changed how it takes configuration inputs, so it's probably not desirable to switch to MathJax 3 entirely, but would it be possible to add an option to use MathJax 3 in Marked 2?

Thanks,
Fiona

1. Support Staff Posted by Brett on 31 Jan, 2020 09:57 PM

I'll look into it, I hadn't realized there had been a significant
MathJax update. In the meantime you do always have the option of
disabling the internal MathJax integration and using a script tag
sourcing the CDN version of the library.

-Brett

2. Support Staff Posted by Brett on 06 Feb, 2020 04:40 PM

To follow up, if you disable MathJax entirely in preferences, you should be able to add a script tag to your document that loads v3 and any necessary config options. This could be semi-automated by using an external script and the raw include syntax in Marked.

I have not fully tested this, but if you do give it a shot I'm willing to help debug it with you and would be curious if it works for future reference.

3. Posted by fiona.alpha137 on 21 Feb, 2020 09:07 PM

Hi Brett,

Thanks for the response. I tried loading MathJax 3 directly in my markdown file, and that seems to be working: please see the attached test1.md and test1.png files. The \expval and \dd commands are from the physics package that's only available in MathJax 3, and they are rendering correctly.

But I couldn't figure out how the script tag can be moved to an external file. I don't know much about html, so I tried just copy-pasting the html code that loads MathJax 3 to a separate file in the same folder (mathjax.html attached here) and wrote <<{mathjax.html} inside my markdown (see attached test2.md), but then Marked 2 crashes.

Best,
Fiona

4. Posted by fiona.alpha137 on 21 Feb, 2020 09:22 PM

Sorry I realized I was having custom processor turned on; Marked 2 still crashes with the <<{mathjax.html} line, the only difference is that the $$and$$ block needs to be surrounded by . Please find the attached files, test1.md should render in Marked 2 with MathJax turned off$$and$$custom processor turned off,$$and$$test2.md crashes.

5. Posted by fiona.alpha137 on 21 Feb, 2020 09:41 PM

And I realized I didn't have the latest version of Marked 2... I just updated and now <<{mathjax.html} is working when I put this line somewhere below the title line. It would be great if MathJax 3 is an option in Marked 2, but a single additional line is good enough for me. Sorry about all these messages, thanks for the help!

6. Support Staff Posted by Brett on 21 Feb, 2020 11:32 PM

- Brett

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

 31 Jan, 2023 05:10 PM Red Dash on Top of Window 27 Jan, 2023 01:05 AM marked exits on launch 25 Jan, 2023 01:04 PM Offer to purchase grammar add-on not displayed 23 Jan, 2023 07:35 PM custom CSS not applying 06 Jan, 2023 09:58 PM Preview render correct; HTML output isn't

## Recent Articles

 Intra-document links in exported PDFs Using Ulysses with Marked Fenced code blocks inside indented code blocks Using JavaScript in Marked Custom CSS: Writing custom CSS for Marked