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 config: Allow single $ delimiters, only apply to CSS "math" class #5504
base: master
Are you sure you want to change the base?
Conversation
1427fa1
to
d30694f
Compare
Codecov Report
@@ Coverage Diff @@
## master #5504 +/- ##
==========================================
+ Coverage 83.23% 83.26% +0.02%
==========================================
Files 296 294 -2
Lines 39622 39585 -37
Branches 5882 5879 -3
==========================================
- Hits 32981 32961 -20
+ Misses 5277 5262 -15
+ Partials 1364 1362 -2
Continue to review full report at Codecov.
|
This modifies expected behaviour of math directive. It should not be used for arbitrary text. The At least that's how I have always considered it. |
-0: I also feel strange because |
In above comment, I said "block" equations. But "display" equations would be much better to describe it. |
The example I quoted from @mgeier uses non-math paragraphs, in LaTeX encoding, inside |
I agree that it is "strange" and it even "feels wrong" to write such Is it possible to add this MathJax config from an extension without interfering when users have their own But apart from "being strange" and "feeling wrong", is there a real downside to my suggestion? And what about the second part of this PR, about restricting MathJax to I think it isn't a huge problem, but it would be more "correct" to enable MathJax only in This would be an admittedly quite unrealistic case where MathJax would be wrongly used in normal text: I love $$ Money $$! Interestingly it is still processed by MathJax if the dollars are escaped: I love \$\$ Money \$\$! |
Some background on why I need support for single The reason for this PR here is to display this properly in Sphinx's HTML output when using Jupyter notebooks as source files (using the |
d30694f
to
4421621
Compare
I've just re-based my commits for your merging convenience. |
4421621
to
4381462
Compare
4381462
to
c07938e
Compare
Just a little update: I've found out that using Also, I've included the change directly into ... so I don't really need this PR anymore. Feel free to close it! |
@mgeier if possible, please could you add a CHANGES entry to this (& a potentially a test, though that might not be as easy, not a requirement) -- if this is useful to people beyond A |
I'm not quite sure if that's the right thing to do. This should be understood as a question, but I made this PR so that it's easy to test the suggested behavior.
Feature or Bugfix
Something inbetween.
Purpose
$
as math delimiters (probably only relevant in:nowrap:
math directives).math
class.Detail
This is some example reST code to check this out:
Note that this PR mainly fixes the
:nowrap:
cases above. This might not be important for most "normal" users. But when auto-generating reST files which have arbitrary math markup (out of my control), this is the only way I found to make it work.