[IPython-User] [notebook] centered equations

Brian Granger ellisonbg@gmail....
Fri Apr 26 23:55:54 CDT 2013

I agree that there is soms serious history and weight towards centered
latex equations.  But there are a few features that makes the notebook
quite different from traditional latex in its visual language:

1) Traditional latex document have a relatively fixed aspect ratio
that is much taller than wide (Legal, Letter, etc.).  Because of the
dimensions of modern monitors, the aspect ratio of the typical
notebook is opposite: much wider than tall - but also not fixed.
2) While traditional latex uses left or fill justify for paragraphs,
the narrow/tall aspect ratio means that visually most paragraphs
appear to be centered on the page.  In combination with the centered
equations and figures, this means that all content in a math heavy
book/journal is essentially centered on the page.  In contrast, most
content in the notebook is left justified and strongly so: code (even
80 column code only takes up a small amount of the full notebook
width), output, images, even Markdown (unless paragraphs are very long
or the aspect ratio is narrowed).
3) The visual flow of a traditional latex document is down the middle
of the page.  Because of the way code is entered interactively and
inputy/output is displayed with prompts, the visual flow of the
notebook is down the left wide of the notebook area.

In my mind, these differences cause centered equations to look really
out of place in the notebook unless:

* The aspect ratio of the notebook area is narrowed artificially
* There are long blocks of markdown text that uniformly fill
horizontal space - creating the illusion of visually centered text
like latex.
* The code and output present in the notebook has significant
horizontal weight that shifts the visual flow more towards the center
of the page.

IOW, if the notebook page+text+content take on the visual dimensions
that regular latex documents have, equation centering makes *perfect*
sense.  Otherwise, I don't think they do make sense.  At most, we
should make this easier to configure on a per notebook level -
preferrably with embedded CSS so it follows the notebook to nbviewer,
etc.  But I do think the default is correct on this one.

[as a separate note, I think there are other visual problems with the
overly wide aspect ratio of the notebook and that we should think
about that]



On Fri, Apr 26, 2013 at 9:18 PM, Fernando Perez <fperez.net@gmail.com> wrote:
> On Tue, Apr 2, 2013 at 1:13 PM, Brian Granger <ellisonbg@gmail.com> wrote:
>> It was a deliberate design choice.  Here was my logic:
>> * In ipython all output is left justified
>> * Output can be latex
>> * Latex output should be left justified to be consistent with other output
>> * Latex in markdown should also be left justified to be consistent with that
> I'm actually not convinced by this argument: it is internally
> consistent, but it's inconsistent with over 100 years of accepted
> practice in mathematical typography.  I went over some materials on
> this matter, including Knuth's seminal lecture on the creation of TeX
> (http://www.math.lsa.umich.edu/~millerpd/docs/501_Winter08/Knuth79.pdf)
> where he shows samples from the AMS Transactions going as far back as
> 1900, and not a single one uses left-aligned equations.
> Similarly, every physics book and paper I can find uses centered
> equations, and so do all the major journals in the world I can think
> of, from PRL to Nature, Science and PNAS, and they do so consistently
> regardless of what field the paper belongs to (hence these conventions
> apply even for equations in papers in the life sciences, of which
> Science, Nature and PNAS have a lot).
> I've had several mathematicians complain to me about this as well, and
> I think they are right: it's important to be consistent, but it's also
> important to choose *what* to be consistent with.  I'd argue that
> consistency with all established typographic convention on this matter
> should carry more weight than consistency with Python's output...
> Cheers,
> f
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

More information about the IPython-User mailing list