Commit Graph

12 Commits

Author SHA1 Message Date
Ron Kok
34e6458245 Fix underbrace (#1304)
* Fix \underbrace

Fix the vertical alignment so that it correctly takes into account the descender of the lower element.

Fixes issue 1303.

* Update screenshots
2018-05-10 12:50:59 -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
Erik Demaine
d6791b7961 Make accents zero width (#1033)
* Make accents zero width

Make the width of an accented character equal to the width of the character,
by making accents zero width.  In particular, fixes #1028 (`\ddot\imath`).

This involved reworking all of the accent offset machinery, in particular
skew and accent-hungarian.  A bit cleaner now.

Also added support for the new width character metrics in symbolNode.

* Update AccentsText test

* Fix comment
2017-12-25 11:48:32 -07:00
Ron Kok
4410d48d5c Fix \vec (#1018)
* Fix \vec

In accent \vec, replace the combining font glyph with an SVG.

* Fix lint error

* update screenshots containing vectors

* update HorizontalBraces
2017-12-17 22:05:21 -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
Ron Kok
61ec41146c Convert nested SVGs to single-level SVGs (#909)
* Convert nested SVGs to single-level SVGs

This PR evades a Safari bug which causes nested SVGs to zoom improperly.  Fixes the remainder of issue #883.

* Add omitted word

* Fix lint errors

* update screenshots

* Pick up review comments

* Clean up variable names

Remove two more redundant variables.
2017-10-08 15:20:47 -06:00
Ron Kok
ccf09786cc Improve SVG Performance (#841)
* Improve SVG Performance

This PR introduces three new classes:  `svgNode`, `pathNode`, and `lineNode`. SVG data is then loaded into the domTree exclusively via instances of these classes.

`innerHTML` is banished.

* Fix lint errors

* Fix \cancel typo

* Fix sqrt height

* Adjust min-lenght

Adjust some of the extensible arrows to get a min-length that matches glyph length of the long arrows in KaTeX Main font range from Unicode 27F5  to 27FC.

The accent arrows still get min-lengths that match the arrows in the Unicode 2100 range.

* regenerate screenshots after optimizing SVG code

* update DisplayStyle screenshot for Chrome

* update OverUnderset and Smash screenshots for Chrome as well

* Remove escapes from template strings

* Pick up review comments

* Fix lint errors

* Add comments
2017-09-08 23:27:47 -04:00
Ron Kok
a4b1bf01be Use inline SVG for stretchy elements (#807)
* Use inline SVG for stretchy elements

Replace all background-images with inline SVG code.

Pros:

* `\color` works in all browsers, even IE/Edge
* Better printing
* Much simpler CSS
    * No links to background-images
    * No `mask`
    * No browser-detection
* No external SVG files
* Faster first rendering

Cons

* No image caching
* Heavier HTML load
* Larger JavaScript file
* `\cancel` line is in `px` units, not `em` units

* Remove static/images from make file

* Change \cancel from px to em

* regenerate screenshots for functions using inline svg
2017-08-19 21:51:16 -04:00
Erik Demaine
440ba6dd1f Use \displaystyle within \over/\underbrace (#765) 2017-07-15 18:41:00 -04:00
Ron Kok
eff7653c51 Support stretchy wide elements. (#670) 2017-06-15 23:47:51 -04:00