-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
See the discussion at sympy/sympy#15329.
Right now, outputs that are text/latex are left aligned, for instance, from SymPy:
from sympy import *
init_printing()
sqrt(3)
SymPy produces $$\sqrt{3}$$
, which according to LaTeX, should be centered. Indeed, if you nbconvert the notebook to PDF, it centers it, because it just inserts the LaTeX literally. But the notebook uses CSS to force all text/latex outputs to be non-centered.
At sympy/sympy#15329, a change was suggested for SymPy's output to use $\displaystyle \sqrt{3}$
, which makes no difference in the HTML notebook due to the CSS, but forces left alignment in the PDF output. I argued that nbconvert should be changed instead to left align all math outputs, regardless if they use \displaystyle or not, since nbconvert should try to produce a PDF that matches the HTML as closely as possible.
However, @mgeier argues that perhaps it is more correct for the notebook to not force math to be left-aligned, and respect equation style vs. inline style, and for things that output math to choose which one to output appropriately.
I would like input from the notebook devs on what they think is the appropriate fix here. Depending on which fix is decided upon, this is either a notebook issue or an nbconvert issue, but I'm opening this here for maximum visibility.
Relevant issues:
sympy/sympy#15329
ipython/ipython#11357
jupyter/nbconvert#892
jupyter/nbconvert#275
jupyterlab/jupyterlab#3938