Skip to content
Colin Moldenhauer edited this page Oct 14, 2026 · 4 revisions

LaTeX commands rendered as the symbols they produce: math symbols, arrows, Greek letters and blackboard bold. Requires an extension that provides the language id latex (e.g. LaTeX Workshop).

Where to put it

The rules go into your VS Code settings.json. Open the command palette (Ctrl+Shift+P) and run Preferences: Open User Settings (JSON) to enable them for all projects, or edit .vscode/settings.json to enable them for one workspace. Add an entry for this language to the prettifySymbols.substitutions array (if the setting already exists, add the entry to the existing array; entries for different languages sit side by side):

"prettifySymbols.substitutions": [
    {
        "language": ["latex", {"pattern": "**/*.tex"}],
        "substitutions": [
            // paste the rules from below here
        ]
    }
]

Changes take effect as soon as you save settings.json. The extension is enabled by default; the animation at the bottom starts with it switched off only to show the difference.

Language setting

"language": ["latex",  {"pattern": "**/*.{tex}"}],

A language id together with a file pattern, so the rules also apply when a .tex file is not detected as LaTeX.

Rules

Basic math symbols:

{ "ugly": "\\\\forall",             "pretty": "∀" },
{ "ugly": "\\\\exists",             "pretty": "∃" },
{ "ugly": "\\\\nexists",            "pretty": "∄" },
{ "ugly": "\\\\nexi",               "pretty": "∄" },
{ "ugly": "\\\\leq",                "pretty": "≤" },
{ "ugly": "\\\\geq",                "pretty": "≥" },
{ "ugly": "\\\\in",                 "pretty": "∈", "post": "(?![a-zA-Z])" },
{ "ugly": "\\\\subseteq",           "pretty": "⊆" },
{ "ugly": "\\\\subset",             "pretty": "⊂" },
{ "ugly": "\\\\supseteq",           "pretty": "⊇" },
{ "ugly": "\\\\supset",             "pretty": "⊃" },
{ "ugly": "\\\\cup",                "pretty": "∪" },
{ "ugly": "\\\\cap",                "pretty": "∩" },
{ "ugly": "\\\\times",              "pretty": "×" },
{ "ugly": "\\\\infty",              "pretty": "∞" },
{ "ugly": "\\\\bot",                "pretty": "⊥"  },
{ "ugly": "\\\\top",                "pretty": "⊤" },
{ "ugly": "\\\\land",               "pretty": "∧" },
{ "ugly": "\\\\lor",                "pretty": "∨" },

Arrows:

{ "ugly": "\\\\leftarrow",          "pretty": "←" },
{ "ugly": "\\\\longleftarrow",      "pretty": "⟵" },
{ "ugly": "\\\\Leftarrow",          "pretty": "⇐" },
{ "ugly": "\\\\Longleftarrow",      "pretty": "⟸" },
{ "ugly": "\\\\rightarrow",         "pretty": "→" },
{ "ugly": "\\\\longrightarrow",     "pretty": "⟶" },
{ "ugly": "\\\\Rightarrow",         "pretty": "⇒" },
{ "ugly": "\\\\Longrightarrow",     "pretty": "⟹" },
{ "ugly": "\\\\iff",                "pretty": "⇔" },
{ "ugly": "\\\\leftrightarrow",     "pretty": "↔" },
{ "ugly": "\\\\uparrow",            "pretty": "↑" },
{ "ugly": "\\\\downarrow",          "pretty": "↓" },
{ "ugly": "\\\\Uparrow",            "pretty": "⇑" },
{ "ugly": "\\\\Downarrow",          "pretty": "⇓" },

Greek letters:

{ "ugly": "\\\\alpha",              "pretty": "α" },
{ "ugly": "\\\\beta",               "pretty": "β" },
{ "ugly": "\\\\gamma",              "pretty": "γ" },
{ "ugly": "\\\\delta",              "pretty": "δ" },
{ "ugly": "\\\\Delta",              "pretty": "Δ" },
{ "ugly": "\\\\eta",                "pretty": "η" },
{ "ugly": "\\\\varepsilon",         "pretty": "ε" },
{ "ugly": "\\\\rho",                "pretty": "ρ" },
{ "ugly": "\\\\sigma",              "pretty": "σ" },
{ "ugly": "\\\\Sigma",              "pretty": "Σ" },
{ "ugly": "\\\\sum",                "pretty": "Σ" },
{ "ugly": "\\\\theta",              "pretty": "θ" },
{ "ugly": "\\\\Theta",              "pretty": "Θ" },
{ "ugly": "\\\\phi",                "pretty": "φ" },
{ "ugly": "\\\\varphi",             "pretty": "ϕ" },
{ "ugly": "\\\\Phi",                "pretty": "Φ" },
{ "ugly": "\\\\lambda",             "pretty": "λ" },
{ "ugly": "\\\\mu",                 "pretty": "μ" },
{ "ugly": "\\\\psi",                "pretty": "ψ" },
{ "ugly": "\\\\pi",                 "pretty": "π" },
{ "ugly": "\\\\Pi",                 "pretty": "Π" },
{ "ugly": "\\\\omega",              "pretty": "ω" },
{ "ugly": "\\\\Omega",              "pretty": "Ω" },

Mathbb:

{ "ugly": "\\\\mathbb{A}",          "pretty": "𝔸" },
{ "ugly": "\\\\mathbb{B}",          "pretty": "𝔹" },
{ "ugly": "\\\\mathbb{C}",          "pretty": "ℂ" },
{ "ugly": "\\\\mathbb{D}",          "pretty": "ⅅ" },
{ "ugly": "\\\\mathbb{E}",          "pretty": "𝔼" },
{ "ugly": "\\\\mathbb{F}",          "pretty": "𝔽" },
{ "ugly": "\\\\mathbb{G}",          "pretty": "𝔾" },
{ "ugly": "\\\\mathbb{H}",          "pretty": "ℍ"  },
{ "ugly": "\\\\mathbb{I}",          "pretty": "𝕀" },
{ "ugly": "\\\\mathbb{J}",          "pretty": "𝕁" },
{ "ugly": "\\\\mathbb{K}",          "pretty": "𝕂" },
{ "ugly": "\\\\mathbb{L}",          "pretty": "𝕃" },
{ "ugly": "\\\\mathbb{M}",          "pretty": "𝕄" },
{ "ugly": "\\\\mathbb{N}",          "pretty": "ℕ" },
{ "ugly": "\\\\mathbb{O}",          "pretty": "𝕆" },
{ "ugly": "\\\\mathbb{P}",          "pretty": "ℙ" },
{ "ugly": "\\\\mathbb{Q}",          "pretty": "ℚ" },
{ "ugly": "\\\\mathbb{R}",          "pretty": "ℝ" },
{ "ugly": "\\\\mathbb{S}",          "pretty": "𝕊" },
{ "ugly": "\\\\mathbb{T}",          "pretty": "𝕋" },
{ "ugly": "\\\\mathbb{U}",          "pretty": "𝕌" },
{ "ugly": "\\\\mathbb{V}",          "pretty": "𝕍" },
{ "ugly": "\\\\mathbb{W}",          "pretty": "𝕎" },
{ "ugly": "\\\\mathbb{X}",          "pretty": "𝕏" },
{ "ugly": "\\\\mathbb{Y}",          "pretty": "𝕐" },
{ "ugly": "\\\\mathbb{Z}",          "pretty": "ℤ" },

What is what

Each rule is one line: ugly is a regular expression for the text to hide, pretty is what is shown instead, and the optional pre and post are regular expressions that must match the text just before and after, without being replaced themselves. Backslashes are written twice because the value is parsed by JSON and then as a regular expression. See Settings for all fields.

  • A LaTeX command starts with a backslash, which has to be escaped twice, hence \\\\forall in the JSON for \forall.
  • The rules replace commands wherever they appear, inside and outside math mode, so a \in in running text is also shown as ∈.
  • \in has a post that excludes a following letter, so that \int and \infty are not cut into ∈t and ∈fty.
  • Rules are tried in order, and the first match wins: a command that is the beginning of another one (\subset and \subseteq) must be listed after the longer one.
  • Add your own symbols the same way, for example { "ugly": "\\\\mathcal{O}", "pretty": "𝒪" }.
  • The blackboard bold letters rely on your font or a fallback font that has the Unicode block Mathematical Alphanumeric Symbols.

In action

Latex example: plain code, extension enabled, clicking a symbol reveals the original

The animation is rendered from the rules on this page. The code is never modified: clicking into a symbol (or moving the cursor onto it) shows the original text again, and the symbol returns when the cursor leaves.

Clone this wiki locally