Giter Club home page Giter Club logo

Comments (5)

muzimuzhi avatar muzimuzhi commented on August 29, 2024 1

This is a "feature" of GitHub Flavored Markdown (GFM), aka, how GitHub converts markdown to html.

First, GitHub converts every pair of \ + <symbol> in markdown into the <symbol> in html, where the <symbol> is a non-letter symbol. See Backslash Escapes - GFM Spec.

Then the github-mathjax extension uses what GitHub outputs as its input. Hence, for github-mathjax to get a \{, you need type \\{ as the input of GitHub.

  • Your input (at the same time, input of GitHub): \\{
  • Output of Github (at the same time, input of github-mathjax): \{(\\ -> \, { -> {)
  • Output of github-mathjax: the left brace math symbol

Since github-mathjax can only see what GitHub outputs, this "feature" hardly can repair.

from github-mathjax.

 avatar commented on August 29, 2024

Duplicate of #10 . See this.

U=$\lbrace1,2,3\rbrace$

$U=\lbrace1,2,3\rbrace$

from github-mathjax.

muzimuzhi avatar muzimuzhi commented on August 29, 2024

For commands having backslash and single non-letter symbol as its name, e.g. \{, \,..., it seems the backslash should be escaped. For example, use

$\\{a, b\\}$

to get
$\{a, b\}$.

from github-mathjax.

 avatar commented on August 29, 2024

Which editor are you using? I am using VSCode with vscode-markdown extension. Because this extension doesn't show \\{ appropriately in a live preview pane, I am typing \lbrace instead of \\{.

from github-mathjax.

muzimuzhi avatar muzimuzhi commented on August 29, 2024

Which editor are you using?

@jinbeomhong

A program uses markdown text as input and outputs html is called a markdown previewer/engine. Every time you "see" the html version (with a plenty of text styles) of some markdown text, you actually "see" the output of some markdown engine.

Here, the vscode extension implements its own markdown engine, which acts, as you have found out, not the same as the engine used by GitHub. Actually, almost every markdown engine acts a bit different with each other, and most of those engines does not have a detailed specification. To this point, GitHub, with its GFM, does a good job.

Bad news is, I have not find any fully-offline markdown engine which acts 100% the same as the one used by GitHub. For example, try the examples in Tables (extension) - GFM in your vscode extension.

from github-mathjax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.