WillZ
WillZ

Reputation: 3965

Sublime Text 3 + Markdown Preview / Chrome does not render maths equation

I'm using having problem rendering maths equations in Chrome with its Markdown Viewer plugin.

System Setup

Sublime Text 3 v3.2.1 build 3207 Plugin: Markdown Preview 2.2.4

Ubuntu 18.06

Chrome Version 75.0.3770.142 (Official Build) (64-bit)

Steps to Preview

My normal setups are:

  1. edit in sublime
  2. use Markdown Preivew to generate preview in browser
  3. view the generated html in Chrome

This was working fine until maybe a month or so, I can't remember the exact dates..

Screenshot

Here's is what I see now below. Any pointers would be much appreciated!

enter image description here

Upvotes: 2

Views: 1508

Answers (1)

Corel
Corel

Reputation: 633

I stumbled upon this problem as well. This link helped me. In case it won't be available in the future here are the steps:

  1. Edit MarkdownPreview config

    Add following config to user config of Markdown Preview: Preferences -> Package Settings -> Markdown Preview -> Settings

    {
    "enable_mathjax": true,
    "js": [
    "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js",
            "res://MarkdownPreview/js/math_config.js",
    ],
}
  1. Install Package​Resource​Viewer

    Package Contol: Install Package -> Package​Resource​Viewer.

  2. Edit math_config.js

    Package​Resource​Viewer -> Open Resource -> MarkdownPreview -> js -> math_config.js
    Replace the contents with:

MathJax.Hub.Config({
  config: ["MMLorHTML.js"],
  extensions: ["tex2jax.js"],
  jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
  tex2jax: {
    inlineMath: [ ['$','$'], ["\\(","\\)"] ],
    displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
    processEscapes: true
  },
  TeX: {
    extensions: ["AMSmath.js", "AMSsymbols.js"],
    TagSide: "right",
    TagIndent: ".8em",
    MultLineWidth: "85%",
    equationNumbers: {
      autoNumber: "AMS",
    },
    unicode: {
      fonts: "STIXGeneral,'Arial Unicode MS'"
    }
  },
  displayAlign: "center",
  showProcessingMessages: false,
  messageStyle: 'none'
});

Try it. Did the job for me.

Upvotes: 5

Related Questions