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

Can I config sytax? #11

Open
xiayulu opened this issue Jun 26, 2021 · 3 comments
Open

Can I config sytax? #11

xiayulu opened this issue Jun 26, 2021 · 3 comments
Assignees

Comments

@xiayulu
Copy link

xiayulu commented Jun 26, 2021

Inline math sytax: $...$ and block math sytax $$...$$ are so common in markdown.
If we can config it, that will be awesome.

@mbarkhau
Copy link
Owner

I am open to it in principle and would accept a PR for this. It would require some refactoring in https://github.com/mbarkhau/markdown-katex/blob/master/src/markdown_katex/extension.py

Are you interested in working on this?

@shubhamshah02
Copy link

Can someone please add this in?

@tovrstra
Copy link
Contributor

tovrstra commented Feb 2, 2023

For those looking for a quick workaround in anticipation of a pull request, the following line preprocesses your conventional inline LaTeX equations to a format suitable for this extension:

text_md = re.sub(r"\B\$(\S|\S[^\n\r]*?\S)\$\B", r"$`\1`$", text_md)

It is not ideal for reasons explained by @mbarkhau, but not all use cases give one the freedom to choose the delimiters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants