]> git.lyx.org Git - lyx.git/commitdiff
Merge branch 'betterspacing'
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 17 Nov 2016 08:28:33 +0000 (09:28 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 17 Nov 2016 08:44:01 +0000 (09:44 +0100)
The purpose of this branch is to improve the spacing in math equations

* do not use hardcoded pixel values, but math units that depend on
  zoom and dpi. This should be good for HiDPI systems.

* implement as much as possible the math typesetting algorithm
  described in Appendix G of the TeXbook.

One typical example of the spacing algorithm is that ``-a'' has no
spacing, contrary to ``a + b''. This reflects the unitary/binary
minus that will indeed happen in typeset output.

Together with the better character substitution that has already been
implemented by Guillaume, we get a nice improvement of mathed looks.

What makes this code complicated is that it handles macros properly:
the spacing inside the macro will depend on the values of the
arguments and the elements that are before and after the macro.

As a result, many definitions in lib/symbols are now just copy/pasted
from the relevant sty file. In particular, it is now possible to make
use of \mathrel, \mathbin, etc. macros to specify spacing.

This merge is a starting point. Remaining work includes

* proper handling of sub/superscript nucleus and of font-changing
  insets (as is done in the TeX algorithm).
* proper typesetting of fractions

Thanks to Guillaume for extensive testing.


Trivial merge