# MathJax rendering problem

#### fiona.alpha137

03 Aug, 2018 11:57 PM

// Please enter a detailed description of the issue // Description of the issue:

I have a very simple equation that I'd like to render with MathJax, but the position of the overhead arrow and the overhead wedge is at the wrong place (see the attached image of "Marked_preview"). Now, this isn't really a Marked problem nor MathJax problem, but seems to be a bug in Safari (see https://github.com/mathjax/MathJax/issues/1766). I've sort of verified that Safari has the problem, by exporting the html from Marked, adding a line to load MathJax with the same configuration as I use in Marked, and opening the html in Safari and Chrome. You can see in the picture (named "Safari" and "Chrome") that Chrome renders it correctly, while Safari doesn't. So my question is, is Marked using Safari in the preview? Is it possible to use Chrome in the preview instead? (I'm not very tech-savvy, sorry if the question doesn't make any sense.) Right now the only workaround I've found is to export the html, add the MathJax line by hand, open in Chrome and print to pdf, which is quite cumbersome.

// Please enter a list of steps required to reproduce the issue // Steps to reproduce:

1. open the attached example.md file in Marked 2
2. turn on MathJax in Marked 2, with configuration TeX-MML-AM_HTMLorMML-full

// If applicable please attach a sample document that causes the issue for you.

// Configuration (do not edit) Marked 2 953 (Direct)

## macOS Version: 10.13.6

inlineMath: [["$","$"],["$$","$$"]], displayMath: [["$$","$$"],["$","$"]], processEscapes: true }, allowPageBreakInCode: TRUE
bookTxtIsLeanpub: TRUE
summaryMdIsGitBook: TRUE
codeIsPoetry: TRUE
codeCanWrap: TRUE
convertGithubCheckboxes: TRUE
convertYAMLToMMD: TRUE
defaultMathJaxConfig: TeX-MML-AM_HTMLorMML-full
defaultPreviewStyle: 4
defaultProcessor: MultiMarkdown
enableMiniMap: TRUE
excludeBlockQuotesFromCounts: TRUE
excludeFootnotesFromCounts: TRUE
excludeVerbatimFromCounts: TRUE
excludeCaptionsFromCounts: TRUE
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: TRUE
h1IsPageBreak: TRUE
h2IsPageBreak: TRUE
hrIsPageBreak: TRUE
includeMathJax: TRUE
limitTextWidth: TRUE
minimalJavaScript: TRUE
outlineModeExtensions:
permissionGranted: TRUE
printFooterFirstPage: TRUE
processHTMLFiles: TRUE
scrollToEdit: TRUE
shouldDetectCritic: TRUE
shouldHighlightMarkupErrors: TRUE
syntaxHighlight: TRUE

1. Support Staff Posted by Brett on 04 Aug, 2018 03:05 PM

Hi Fiona,

Almost all macOS applications with web views use the same rendering
engine as Safari (Apple's Webkit). There's really no alternative to
this. I can definitely see how having to export to Chrome to get proper
output is a huge inconvenience, but I'm not sure I can do anything about
it within Marked.

-Brett

2. Support Staff Posted by Brett on 04 Aug, 2018 03:13 PM

I did just test changing the MathJax configuration in the dropdown to TeX-MML-AM_SVG-full and it seems to correct the issue. Is that an acceptable solution for you?

3. Posted by fiona.alpha137 on 05 Aug, 2018 07:39 PM

Hi Brett,

I see, I was expecting something along that line, but thanks for confirming.

So with SVG I have a different problem that the exported pdf has all equations looking bold, although it looks very nice in the Marked preview; please see the attached image, left is preview in Marked, right is the exported pdf. I've also attached a snippet of the Markdown file used to generate the text. For this both Chrome and Safari act the same way: it looks very nice in the browser, but gets bold when exported/printed to pdf.

-Fiona

4. Support Staff Posted by Brett on 06 Aug, 2018 01:11 PM

I'm afraid I have no idea how to work around that. I'm sincerely sorry I
can't be of more help on this.

-Brett

5. Posted by fiona.alpha137 on 06 Aug, 2018 03:21 PM

Please don't worry, it's not a Marked 2 problem in the first place.

After a bit more googling though, I found that the MathJax team has already hacked a workaround to the Safari problem in one of the later 2.7 release. Indeed the hat and the arrow are not displaced anymore in Safari if I load the latest 2.7.5 Mathjax (please see the attached html code, MathJax is loaded at the very top.) I think Marked is using MathJax 2.7.0 from what I see in the exported html with MathJax code included? Is it possible for you to change the default to the latest MathJax?

-Fiona

6. Support Staff Posted by Brett on 06 Aug, 2018 03:35 PM

That I can do. I'll update for the next release.

-Brett

7. Posted by fiona.alpha137 on 06 Aug, 2018 05:41 PM

Great, thank you!

By the way, Marked 2 (and nvALT!) really is a superb app; my life became so much better once I got Marked 2 and made my workflow revolve around it. Thank you for making such a great product!

-Fiona

8. Support Staff Posted by Brett on 06 Aug, 2018 06:00 PM

Thanks for the kind words!

9. fiona.alpha137 closed this discussion on 06 Aug, 2018 08:40 PM.

10. fiona.alpha137 re-opened this discussion on 06 Aug, 2018 08:43 PM

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

### »

• Chrome.png 5.29 KB
• example.html 369 KB
• example.md 35 Bytes
• Marked_preview.png 24.2 KB
• MathJax_configuration.png 256 KB
• Safari.png 5.12 KB

#### 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

 14 Feb, 2019 09:18 PM Unable to use Marked with Bear 13 Feb, 2019 01:06 PM Working a fullscreen editor 12 Feb, 2019 03:58 PM No "close" button for advanced statistics drop-down 08 Feb, 2019 06:03 PM Flashes on update 08 Feb, 2019 05:58 PM Incorrect superscripted or subscripted item at beginning of line using MMD syntax

## 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