Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AsciiMath support #2069

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

expikr
Copy link
Contributor

@expikr expikr commented Apr 16, 2023

This pull request adds an option to let users additionally enable the more concise AsciiMath syntax supported by MathJax.

Usage:

[output.html]
mathjax-support = true
asciimath-support = true

To type an equation, the user simply use the \`...\` delimiter.

So for example:

Output:

image

Input:

Euler's Formula \` e^(ix) = cosx + isinx \` defines fractional signs.

Matrix:

\`
[ [a,b],
  [c,d] ] 
\`

Fourier Transform:

\`
f(x) = int_(-infty)^(infty) F(s) e^(2 pi i x s) ds 
\`

\`
F(s) = int_(-infty)^(infty) f(x) e^(-2 pi i x s) dx
\`

Dirac Delta:

\`
delta (x) = {
    ( \infty , "," , x=0 ) ,
    ( 0      , "," , "otherwise" )
:} 
\`

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Apr 16, 2023
@expikr expikr changed the title Add asciimath support Add AsciiMath support Apr 16, 2023
@expikr
Copy link
Contributor Author

expikr commented Apr 26, 2023

Tangentially relevant discussion: KaTeX/KaTeX#1472 (comment)

Quick note about \`...\`: the parser actually just looks for `...` in html, the user types backslash backtick in Markdown to escape it so that it shows up as bare backtick in html output. It elegantly solves the problem of dollar delimiter collision and cumbersome backslash-bracket escaping -- taking a symbol already used for something else in Markdown, and using its escaped version to create complementary distribution for a concise symbol that you know the user will rarely type deliberately.

Update mathjax.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-MathJax Area: MathJax S-waiting-on-review Status: waiting on a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants