Install the following packages one-by-one via Command Palette (Shift+Ctrl+P, or Shift+Cmd+P on macOS) > search for “Package Control: Install Package” > search for each package in turn. Close and re-open Sublime Text after each one finishes installing.
{
"extensions":
[
"md"
],
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"save_on_focus_lost": true,
"line_numbers": true,
"translate_tabs_to_spaces": false
}
To create custom key bindings, go to Preferences > Key Bindings and edit the right-hand-side, eg by entering the following:
[
/* Markdown */
// Render Markdown in browser
{ "keys": ["shift+alt+m"], "command": "markdown_preview", "args": {"target": "browser", "parser": "markdown"} },
// Overwrite MardownEditing's key bindings
{ "keys": ["ctrl+1"], "command": "focus_group", "args": { "group": 0 } },
{ "keys": ["ctrl+2"], "command": "focus_group", "args": { "group": 1 } },
{ "keys": ["ctrl+3"], "command": "focus_group", "args": { "group": 2 } },
{ "keys": ["ctrl+4"], "command": "focus_group", "args": { "group": 3 } },
{ "keys": ["ctrl+5"], "command": "focus_group", "args": { "group": 4 } },
]
If you try to build a Markdown file (if you have an .md file open and either press Ctrl+B/Cmd+B or go Tools > Build) and it doesn’t work, take a look at the bottom left corner. If it has the message “No build system” then take a look in the Tools > Build System menu. If that contains “Markdown” then it means that Sublime Text has a problem with the syntax highlighting (color scheme), not the build system. You can double check this by looking in the View > Syntax menu (or at the bottom right corner where the detected syntax is shown - clicking on this will being up the same menu) and seeing that “Markdown” does not exist.
Fix this problem by uninstalling and re-installing the MarkdownEditing package:
How to have Latex equations in your Markdown be rendered by Markdown Preview in Sublime Text:
{
"js": [
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js",
"res://MarkdownPreview/js/math_config.js",
]
}
{
"markdown_extensions": [
{
"pymdownx.arithmatex": {
"generic": true
}
}
]
}
markdown_extensions
settings when
enabling Arithmatex. To avoid this you need to manually enable them all
again: find markdown_extensions
in the Default settings (on
the left-hand side) and copy-paste that section into the User settings
(on the right-hand side).{
"js": [
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js",
"res://MarkdownPreview/js/math_config.js",
],
"markdown_extensions": [
{
"pymdownx.arithmatex": {
"generic": true
}
},
// Python Markdown Extra with SuperFences.
// You can't include "extra" and "superfences"
// as "fenced_code" can not be included with "superfences",
// so we include the pieces separately.
"markdown.extensions.footnotes",
"markdown.extensions.attr_list",
"markdown.extensions.def_list",
"markdown.extensions.tables",
"markdown.extensions.abbr",
"pymdownx.betterem",
{
"markdown.extensions.codehilite": {
"guess_lang": false
}
},
// Extra's Markdown parsing in raw HTML cannot be
// included by itself, but "pymdownx" exposes it so we can.
"pymdownx.extrarawhtml",
// More default Python Markdown extensions
{
"markdown.extensions.toc":
{
"permalink": "\ue157"
}
},
"markdown.extensions.meta",
"markdown.extensions.sane_lists",
"markdown.extensions.smarty",
"markdown.extensions.wikilinks",
"markdown.extensions.admonition",
// PyMdown extensions that help give a GitHub-ish feel
{
"pymdownx.superfences": { // Nested fences and UML support
"custom_fences": [
{
"name": "flow",
"class": "uml-flowchart",
"format": {"!!python/name": "pymdownx.superfences.fence_code_format"}
},
{
"name": "sequence",
"class": "uml-sequence-diagram",
"format": {"!!python/name": "pymdownx.superfences.fence_code_format"}
}
]
}
},
{
"pymdownx.magiclink": { // Auto linkify URLs and email addresses
"repo_url_shortener": true,
"repo_url_shorthand": true
}
},
"pymdownx.tasklist", // Task lists
{
"pymdownx.tilde": { // Provide ~~delete~~
"subscript": false
}
},
{
"pymdownx.emoji": { // Provide GitHub's emojis
"emoji_index": {"!!python/name": "pymdownx.emoji.gemoji"},
"emoji_generator": {"!!python/name": "pymdownx.emoji.to_png"},
"alt": "short",
"options": {
"attributes": {
"align": "absmiddle",
"height": "20px",
"width": "20px"
},
"image_path": "https://github.githubassets.com/images/icons/emoji/unicode/",
"non_standard_image_path": "https://github.githubassets.com/images/icons/emoji/"
}
}
}
]
}
Markdown Preview uses MathJax to turn LaTeX equations into HTML. The settings for how this works are contained in two files:
/Users/<username>/Library/Application Support/Sublime Text/Packages/User/MarkdownPreview.sublime-settings
/home/<username>/.config/sublime-text/Packages/User/MarkdownPreview.sublime-settings