Commit Graph

12 Commits

Author SHA1 Message Date
Ron Kok
64d1c4e590 Fix nested \dfrac (#1825)
* Fix nested \dfrac

* Update screen shots
2019-03-20 14:20:01 -04:00
Ron Kok
db585fae54 Support \genfrac and \above (#1458)
* Support \genfrac and \above

* Accommodate delimiters inside groups

* Update screenshots take one`

* Update screenshots take two

* Fix flow error

* Fix lint error
2018-07-07 17:01:37 -07:00
Ron Kok
8621f5b76a Support \brace and \brack (#1453)
* Support \brace and \brack

* Update screenshots
2018-06-28 03:43:02 +09:00
Ron Kok
08b0045b92 Support \cfrac (#1392)
* Support \cfrac

This was an easier PR to write than #135 since KaTeX now has well established methods for pt-to-em conversions and nulldelimiter.

As in #135, this does not support the LaTeX optional argument for numerator justification.  It supports a `\cfrac #1 #2 ` syntax.

* Added screenshotter files

* fix ref to context in genfrac handler
2018-06-03 16:38:19 -04: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
Ron Kok
b2698d35ec Change frac-line from border to full span (#976)
* Change frac-line from border to full span

Change `frac-line`  and `vertical-separator`.  Instead of using span borders, fill entire span using a `box-shadow`.

This change will enable more dependable engagement of the `min-height` CSS.

* Fix indentation

* Fix indent again

* Change box shadow to inline SVG

* Fix lint error

* regenerate screenshots after switching to SVG for fraction bars
2017-11-24 11:41:53 -05:00
Eddie Kohler
e0407a19a0 Support \atop.
Add Jasmine test and update screenshotter test.
2016-12-05 15:58:26 -05:00
Martin von Gagern
2e002ff37a Use jspngopt and pako to create reproducible PNG files for Chrome as well
The combination of jspngopt and pako should eliminate possible causes for
different PNG encodings, although the core reason for #325 remains unknown.
Pako has poorer compression rates than native libz, but optimization can
counter that effect, and actually reduce the size of the screenshots.

The screenshots for LimitControls and UnsupportedCmds on Firefox used to
exhibit subpixel rendering before, for reasons unknown.  The regenerated
versions don't exhibit this.  See #324 for a discussion.
2015-08-30 02:12:55 +02:00
Martin von Gagern
7dc8b68092 Improve horizontal spacing of fractions
A fraction is surrounded by a box of width \nulldelimiterspace on either side.
That size is 1.2pt and does not scale with the style or font size.
Furthermore, a \frac creates a brace-enclosed group which results in a
\mathord, not a \mathinner.
2015-07-07 10:03:34 +02:00
Emily Eisenberg
2f552af02d Make our own screenshotting script instead of using huxley
Summary:
Create our own screenshotting script which takes screenshots. This
improves over huxley for a couple reasons:
 - It makes the screenshots the correct size (for some reason, huxley struggles
   with this).
 - Its configuration matches more with what we want (we don't need multiple
   screenshots or interaction, we just want a single static shot)
 - It runs faster

I also changed the docs to reflect this change.

Test Plan:
 - Make sure all of the tests that were in the Huxleyfile are now in ss_data.json
 - Run the screenshotter docker
 - Make sure all of the images look reasonable and don't change (except
   sometimes the Lap test, which has some strange pixel-positioning
   differences...)

Reviewers: kevinb

Reviewed By: kevinb

Differential Revision: https://phabricator.khanacademy.org/D16731
2015-03-12 16:40:15 -07:00