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
use mathjax config to left-align output #5371
Conversation
Hmnn, I believe the |
The onload hack it is necessary... if you don't load MathJax at the end, and try to load some other js libraries too (ie. reveal.js), some math is not rendered OK. |
It's not relevant to this PR, so I have removed the mathjax patch here. We can continue the discussion of that in #5375. |
OK, for this one I am 👍 |
Do we need to make s similar change to nbviewer and nbconvert to make sure equations there are handled the same way? |
I just did a test and nbconvert/nbviewer latex output will be centered by this PR. We will have to update the MathJax config/calling there as well to get this behavior with no CSS. We keep running into this issue: because we config/call MathJax in multiple places, it is easy for them to fall out of sync. Can we consolidate this logic into one place? |
Rather than having this call to typesetting save and reset state, what if we simply had each call to typesetting in our code base first make a call to |
I don't know how expensive calling config is for ever render. It makes more sense to me to only call it when deviating from the norm, but we can do it every time if you prefer. |
Here are the three places that we using MathJax to typeset:
It is not at all obvious to me which of these is the "normal" case. With this PR, the one in Do you think this analysis is right? Trying to convince myself... |
By 'normal', I just mean based on the following statements: In notebooks, equations and images are centered. The exception to this is when those things are outputs, in which case they are left-aligned. |
I don't have a strong feeling about it, so if attaching a This stuff is weird and fragile enough that I think maybe we should hold it until after 2.0. The only (known) adversely affected case in master is very long lines that auto-line-break won't break (e.g. long tuples or lists in sympy). |
I am fine holding this until after 2.0. Expecially because we still have to On Thu, Mar 20, 2014 at 3:07 PM, Min RK notifications@github.com wrote:
Brian E. Granger |
Recent work on master has added a number of new calls to MathJax in the widgets. All of these additional calls to MathJax should be left aligned. Because of this I think the approach that is in this PR is fine. However, we do need to make sure that nbconvert output and nbviewer will still center output equations after this PR. |
OK, my last comment was pure craziness. I forgot, the global config for MathJax is centering and this PR gets left alignment in output areas by calling MathJax's config logic (rather than the older CSS approach). Right now if this PR is merged, it will mean that all LaTeX in widget descriptions will be center aligned. I am not sure that makes sense. @minrk why don't you rebase on master so we can test the widget LaTeX stuff with this PR. |
Looking at how MathJax is configured on nbconvert/nbviewer and run globally there, I don't see how we can make this approach work there. I think we should reconsider possibly just using centered equations everywhere. Adding to the next dev meeting agenda. |
We discussed this one at the dev meeting on June 12, but didn't put a note here. I just looked back and we said that "Min will investigate how to get this working in nbconvert by setting the MathJax config separately for output LaTeX". I think the issue with the current approach is that it won't give the same result on nbviewer/nbconvert. |
Closing here, I might come back to it later. |
instead of css
closes #5365