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

Mathjax render conflits #93

Closed
upupming opened this issue Jun 6, 2018 · 3 comments
Closed

Mathjax render conflits #93

upupming opened this issue Jun 6, 2018 · 3 comments

Comments

@upupming
Copy link
Contributor

@upupming upupming commented Jun 6, 2018

I want to create a new issue

Melody Information

Melody Version:

Platform: Ubuntu 18.04

Browser: Chrome

Expected behavior

I'm writng with mathjax on another website, and this is two pieces of code I write:

$\{0^n1^n\,|\,n \ge 1 \}$
$$\begin{align}
S &\to \epsilon\, \\
S &\to 001A\,|\,00A1\,|0A01\,|\,A001 \\ 
S &\to 010A\,|\,01A0\,|0A10\,|\,A010 \\ 
S &\to 100A\,|\,10A0\,|1A00\,|\,A100 \\ 
\end{align}$$

They are rendered as:
screenshot from 2018-06-06 09-42-16
screenshot from 2018-06-06 09-43-59

This is my expected behavior, but not the case in melody.

Actual behavior

screenshot from 2018-06-06 09-45-55

screenshot from 2018-06-06 09-46-27

I found that I have to change all \{ to \\{, and all \\ to \\\\ to make melody works, which is believed to be a confilct between mathjax and markdown engine melody is using now.

Could you please fix this bug or give some advice? Thanks in advance!

@Molunerfinn
Copy link
Owner

@Molunerfinn Molunerfinn commented Jun 6, 2018

Find a solution:
https://www.npmjs.com/package/hexo-renderer-kramed
image
And this is my test result:
image
I think may be I need to update the docs.

@upupming
Copy link
Contributor Author

@upupming upupming commented Jun 6, 2018

This still not works(expected { wasn't rendered):

$\{a = 0\}$

screenshot from 2018-06-06 22-03-55

But this is okay:

$$\{a = 0\}$$

screenshot from 2018-06-06 22-03-15


kramed render suggests inline equations using this format, which is difficult to be compatible with the usual tex syntax:

`$\{a = 0\}$`

I cannot find any better solution, so I will use

`$$`

tag for inline equation.

@Molunerfinn
Copy link
Owner

@Molunerfinn Molunerfinn commented Jun 13, 2018

@upupming To have MathJax on hexo is a hard work. Not only should the theme do some work to fit it, but also the hexo and the plugin of it need to fit it. Since I didn't write mathJax in my blog, may be I won't meet problem. May be someone has solved this problem, and I will appreciate it if he can give the project a PR~

@upupming upupming mentioned this issue Jun 26, 2018
4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants