-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[auto-render] add an option to ignore \$ outside of latex expressions #437
Comments
We already have logic that should skip over backslashes: |
Maybe it's not working? |
That only works for escaping |
Rendering this text:
with this delimiter: { left: '$', right: '$', display: false } results in <#text>I will give you \</#text>
<span>KATEX MATH</span>
<#text>y = x^2</#text>
<#text>$.</#text> where |
Agreed, can not write dollar sign outside of math equations... |
@paulsohn can you use different delimiters, e.g. |
I'm going to close this since it's going to be very difficult to implement something that handles the different behaviors people want. Also, there is a workaround by using different delimiters. |
There is more than one way to do this. If you are using the KaTeX auto-render extension, then you can delimit your math with Some markdown parsers only recognize the closing |
Thanks for replying. I simply replaced my |
Would be nice for MathJax |
@Trass3r can you open a new issue for |
Isn't it exactly this issue?
|
I'm re-opening and have changed the title to indicate that we'd like an option to ignore |
To have <script>
document.addEventListener("DOMContentLoaded", function() {
// https://sixthform.info/katex/guide.html
document.body.innerHTML = document.body.innerHTML.replace(/\\\$/g, '<span>$</span>');
renderMathInElement(document.body, {
// ... https://katex.org/docs/autorender.html
});
});
</script> |
…tside of LaTeX math mode (KaTeX#437)
I have made a pull request that changes the autorender in the following way:
I think this is safe and sane enough behavior to have as a default. The only way existing users are affected by this is if they have a backslash immediately (no whitespace or anything) followed by a delimiter that enters math mode. I can't think of any scenario where one would want that, and if one still does one can do This also means that |
…tside of LaTeX math mode (KaTeX#437)
…tside of LaTeX math mode (KaTeX#437)
…tside of LaTeX math mode (KaTeX#437)
…tside of LaTeX math mode (KaTeX#437)
…tside of LaTeX math mode (KaTeX#437)
…tside of LaTeX math mode (KaTeX#437)
…tside of LaTeX math mode (KaTeX#437)
If it's possible for escaping
\$
to normal$
, then latex$ (expressions) $
would not be any problem.I wanted to make my own hack for this, but I'm not used to string so far.
Is there any plan to support dollar sign escaping?
The text was updated successfully, but these errors were encountered: