Commit Graph

8 Commits

Author SHA1 Message Date
ylemkimon
3dd1ed45b4 Run screenshotter using Chrome 83 and Firefox 76 (#2304)
* Run screenshotter using Chrome 83 and Firefox 76

* Update screenshots

* Update NegativeSpace-chrome screenshot

The new screenshot is correct as per #1194.

* Update Units-chrome screenshot

The new screenshot is correct as per #732 and compared to Firefox.

* Update screenshots
2020-07-14 08:48:55 -07:00
ylemkimon
800cdb2d23 Cleanup font build scripts & minor font updates (#2155)
* Minor font updates

* Update screenshots

* Cleanup build scripts
2019-12-07 13:11:45 +09:00
Erik Demaine
523df299e5 Line breaks for inline formulas (#1287)
* Line breaks for inline formulas

* Basic support for \allowbreak and \nobreak

* Fix spacing around \nobreak, and add documentation

* Backwards-compatibility _getBuilt to fix tests

* Put operator spacing on same line as operator

* One approach to ~

* Simplify \allowbreak/\nobreak, make ~/\nobreakspace prevent line breaks

* Adapt to #1295

* Prevent wrapping within a .base

* Implement \hspace* properly

* Fix flow error

* Update comment for regularSpace

* Update screenshots

* Move `width: min-content` from .katex into .base

* Fix screenshot

* Add min-width rule to .vlist-s

* Factor out hasClass method

* Cleanup nobreak test

* Pull out buildHTMLUnbreakable

* Fix \hspace* test (no longer the same as \hspace)

* Fix \nobreak handling

* Add screenshot test
2018-05-11 01:44:26 +02:00
Ron Kok
c2ae9e0da6 Revert frac-lines to borders (#1249)
* Revert frac-lines to borders

This PR reverts the rendering of frac-lines from SVG paths back to span borders. This solves the thick grey bar reported by @mbourne in issue #1173.

The result is a frac-line similar to KaTeX v0.9.0-alpha1. The frac-lines are span borders and the CSS contains a `min-width: 1px;` rule to keep those borders visible.

There is one difference between this PR and v0.9.0-alpha1. The earlier work contained a second CSS rule:
```
@media screen and (-webkit-min-device-pixel-ratio: 2), screen and (min-resolution: 192dpi) {
      .katex.mfra.fracline {
            min-height:0.5px;
        }
    }

That second CSS rule did not help much. Instead, it caused some lines to disappear. In the thread to issue 1173, people tested the rendering from the proposed approach and reported that frac-lines disappeared only at sized that were already too small to read.

* Fix lint errors

* Remove superfluous SVG paths.

* Remove superfluous CSS

* Removed `rulespan` from `stretchy.js`

* Support Unicode \ll and \lll

Fixes issue #1271

* Fix indent

* update screenshots for fracLineBorder

* Update Arrays-chrome screenshot for fracLineBorder
2018-05-10 16:05:24 +09:00
Ron Kok
95ffb4fad4 Padding over \sqrt and Paths for frac-line (#1143)
* Padding over \sqrt and Paths for frac-line

This replaces two earlier PRs.

* Restore reaction arrows

* regenerate screenshots

* Set line padding in a constant

* Update with latest master

* Fix lint error

* update screenshots
2018-02-17 13:56:13 -05:00
Ron Kok
c62f814765 Fix frac-line (#1025)
* Fix frac lline

For frac-line, use an SVG line in an extra tall span.

I still need to think of a way to adust `vertical-separator`.

* Fix spaces in katex.less

* regenerate screenshots

* update HorizontalBraces and StrikeThrough screenshots
2017-12-26 16:17:06 -07:00
Eddie Kohler
2da06d541e Shrinkwrap vlists in table-like CSS. (#768)
TeX and CSS treat line heights in fundamentally different ways. In
TeX, every character is treated as a box of its precise height and
depth; the line height (\baselineskip) applies after characters have
been assembled into lines. In CSS, in contrast, every character
creates a "line box" corresponding to the accompanying font. When
characters of different fonts and sizes are placed into the same
span, the resulting line box contains the line boxes of all children.

This is unfortunate because, for example, we want `\frac{1}{2}` to
behave in vertical spacing contexts like it is exactly as tall and
deep as the visible fraction (which is the TeX behavior). Given CSS
constraints, though, in most contexts the fraction has extra vertical
space: the line boxes for the numerator and denominator create
padding. For small boxes, this isn't so bad. To really see the
problem put a tall rule in the denominator of a fraction, or check
out the VerticalSpacing screenshotter test, which has way more space
than it should.

Solving this problem in CSS is difficult. There is no easy way to get
rid of the extra line boxes.

But there is *a* way, namely tables. A table-cell with vertical-align
top, bottom, or middle is ignored for the purposes of line height
calculation.

So in this commit, makeVList puts its contents into a
vertical-align:bottom table-cell (to clear unwanted line boxes), with
an extra row used to represent depth.

Many Chrome screenshotter tests change. This is because Chrome rounds
table dimensions to integral numbers of pixels, while it uses
sub-pixel positioning for non-table displayed tabs. That makes many
vlists a fraction of a pixel wider than they used to be.
2017-07-30 11:13:55 -04:00
Erik Demaine
06d6c96894 Add \jot lineskip to aligned environment, switch contents to displaystyle, and add gathered (#725) 2017-06-10 17:10:29 -04:00