You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following markdown works fine in a markdown cell, centering the equation:
The math is centered: $$x$$
But, when placed inside a markdown display method it becomes left aligned (any way you do it, or any number of blank lines, just using this one for brevity):
fromIPythonimportdisplaydisplay.display_markdown("The math is not centered: $$x$$", raw=True)
It starts out in the center, then leaps over to the left. I think this was a problem that got fixed for markdown cells, but not for the display output.
Edit: This appears in the output style:
div.output_area .MathJax_Display {
text-align: left !important;
}
I guess the idea was that an equation by itself (i.e. displayed with the Math class) should be left aligned, like any other output would be. Possibly it doesn't make sense for block equations in markdown. Can you see a way of making the CSS selector more specific so it would differentiate between those cases?
This is markdown instead of latex, so that's one difference that could be used. output_markdown rendered_html is unique to this case, where as just output_latex is on the output of Math (ignoring attributes they both share).
But, really, even for Math, the output does an irritating jump from middle to left of the screen. I think the Math should be inline style ($x$ in markdown) vs. display style ($$x$$) if it is intended to be left aligned as an output, or it should be able to change the the MathJax HTML output <div class="MathJax_Display" style="text-align: center;"> which is causing the jump and forcing the !important rule.
The following markdown works fine in a markdown cell, centering the equation:
But, when placed inside a markdown display method it becomes left aligned (any way you do it, or any number of blank lines, just using this one for brevity):
It starts out in the center, then leaps over to the left. I think this was a problem that got fixed for markdown cells, but not for the display output.
Edit: This appears in the output style:
It is overriding the explicit style in:
Related to #7827, but this is in a vanilla Jupyter notebook with IPython.
It seems to be coming from here:
https://github.com/jupyter/notebook/blob/de92a2b34fc50c090c1c02c3b57dbe882cd64d3c/notebook/static/notebook/less/outputarea.less#L52-L55
The text was updated successfully, but these errors were encountered: