Commit Graph

234 Commits

Author SHA1 Message Date
Ron Kok
176552a691 fix: Implement \pmb via CSS text-shadow (#3505)
* Fix: Implement \pmb via CSS text-shadow

* Update screen shots

Co-authored-by: ylemkimon <y@ylem.kim>
2022-08-29 21:54:20 +00:00
Ron Kok
8a65a2e1fd fix: Use SVGs for some stacked delims (#3686)
* fix: Use SVGs for some stacked delims

* Account for script level & correct some geometry

* Fix script level adjustment

* Updated screenshotter images

* Change \vert to round cap

* Fix \vert geometry

* Update screenshotter images
2022-08-28 13:21:03 +09:00
Erik Demaine
9e3ae4d5a8 feat: Support \Braket, \set, and \Set (#3214)
* feat: Support \Braket, \set, and \Set

* Update screenshots.

* Rewrite to redefine | via macros

* Update screenshot after merge

* Rename \bra@ket@one -> \bra@set

* Fix spacing in \set and \Set to match braket.sty

* Add || and \| support

* Update tests

* Update screenshots

Co-authored-by: Ron Kok <ronkok@comcast.net>
2022-05-20 17:26:04 +00:00
Erik Demaine
52c4778b15 feat: \nonumber/\notag support, \tag per row of {align} (#2952)
* feat: \nonumber and \notag support

Support `\nonumber` (and equivalent `\notag`) using a global macro
`\@eqnsw` to track whether one occurs in each row, similar to how
amsmath uses global `\@eqnswtrue`/`\@eqnswfalse`.

Fix #2950

* Remove duplicate mention of align*

* Working version of \tag within {align}

* Simpler subparse mechanism

* Fix flow errors, clarifying set-to-undefined

* Document that \tag works in rows

* Add screenshot tests

* Add Jest tests

* Add Safari screenshot

* Commit message about fixing \tag

Fixes #2379

* Apply suggestions from code review

Co-authored-by: ylemkimon <y@ylem.kim>

* Revise and move getAutoTag

* Fix handling of split

* Remove unnecessary feedTokens

Co-authored-by: ylemkimon <y@ylem.kim>

Co-authored-by: ylemkimon <y@ylem.kim>
2021-11-01 06:40:06 +09:00
Ron Kok
09ee1c8867 fix: round dimensions to 4 places (#2460)
* Round distances to 4 places

* Revert numbers in mathMLTree.js

* Update Jest test

* fix: round dimension to 4 places via makeEm

* test: update screenshots

* docs: add link to this PR

Co-authored-by: ylemkimon <y@ylem.kim>
2021-10-31 03:28:45 +09:00
renovate[bot]
9b7f10f7c9 chore(deps): update selenium/standalone-firefox docker tag to v20210929 [skip netlify] (#3294)
* chore(deps): update selenium/standalone-firefox docker tag to v20210929 [skip netlify]

* test: update screenshots

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: ylemkimon <y@ylem.kim>
2021-10-30 16:52:35 +09:00
Erik Demaine
952fb844da feat: text-mode cedilla accent via \c (#3036)
* feat: text-mode cedilla accent via \c

Add text-mode accent function `\c` and corresponding Unicode support.

Part of #638

Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>

* Update screenshots

Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
2021-08-28 22:29:53 +00:00
ylemkimon
ea409eaf1d fix(fonts): update fonts dependencies (#2866)
* fix(fonts): update fonts dependencies

* chore(fonts): fix buildMetrics for Python 3

* fix(fonts): update fonts

* test: update screenshots

* docs: update reference to katex-fonts

* chore: use Python 3

* fix(fonts): update fonts

* test: update screenshots

* Use explicit path

* Command-line arguments aren't actually supported

* Small buildMetrics fixes

* Add build:{fonts,metrics} script

* Lock versions of font-related dependencies

* Install minimal texlive

* Install fontforge

Co-authored-by: Erik Demaine <edemaine@mit.edu>
2021-08-29 07:06:42 +09:00
Kelly Littlepage
910e523633 fix: Correct invalid box-sizing property, adjusting spacing of \angl (#3053)
* fix: Correct invalid box-sizing property

Closes #3052

* Add Safari screenshot

Co-authored-by: Erik Demaine <edemaine@mit.edu>
2021-07-21 10:50:11 -04:00
ylemkimon
67064cd2a4 test(screenshotter): update screenshots (#3032) 2021-05-19 16:13:53 -04:00
renovate[bot]
9c0fd964ee chore(deps): update selenium/standalone-firefox docker tag to v20210422 [skip netlify] (#2999)
* chore(deps): update selenium/standalone-firefox docker tag to v20210422 [skip netlify]

* test(screenshotter): update screenshots

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Young Min Kin <mail@ylem.kim>
2021-05-20 01:51:25 +09:00
ylemkimon
b2a5d77a10 test(screenshotter): update Includegraphics-safari (#3030) 2021-05-18 13:56:21 -04:00
Erik Demaine
93b56cfb0b chore(screenshotter): Improve screenshotter for Safari (#3015)
* Fix when Docker returns IPv4 and IPv6 addresses

* Ensure images load before screenshotting

* Fix bugs from review

* Update test/screenshotter/test.html

Co-authored-by: ylemkimon <y@ylem.kim>
2021-05-17 22:45:11 +00:00
Ron Kok
9b4acc971c fix: Correct for negative margin in integrand lower limits (#2987)
* fix: Correct for negative margin in integrand lower limits.

* Adjust for width limit.

* Update screenshots.

* Update Safari screenshot.

* Catch null subGroup.

* Remove redundant code.
2021-05-11 21:26:35 -04:00
Ron Kok
980b004023 fix: binom delimiter size in scriptscriptstyle. (#2976)
Co-authored-by: Erik Demaine <edemaine@mit.edu>
2021-05-06 18:27:10 +00:00
ylemkimon
c5b06e7eb9 chore: move test fonts to the main repo (#2834)
Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
2021-03-23 06:23:49 +00:00
ylemkimon
7300952ae1 test: update Firefox screenshots (#2845) 2021-03-22 13:54:23 +09:00
renovate[bot]
65cfd4bf86 chore(deps): update dependency js-yaml to v4 [skip netlify] (#2723)
* chore(deps): update dependency js-yaml to v4 [skip netlify]

* Update ss_data.js

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: ylemkimon <y@ylem.kim>
2021-01-12 04:38:18 +09:00
Erik Demaine
6b4e80bfbb fix(builder): combine characters together in all expressions (#2080)
* Combine characters together in all expressions

Call `tryCombineChars` in `buildExpression`

* update screenshots, exclude 'coverage' from lint

* update MathML snapshots

* don't combine two 'mbin's or two 'mord's

* update screenshots

* update screenshots

Co-authored-by: ylemkimon <y@ylem.kim>
Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
2020-12-30 10:34:01 -05:00
Ron Kok
1f509a3b75 feat: Support \underbar (#2713)
* feat: Support \underbar

* Update screenshots
2020-12-30 10:15:17 -05:00
Ron Kok
4a8a6a38ce fix: Use SVGs to avoid gaps in tall delimiters. (#2698)
* fix: Use SVGs to avoid gaps in tall delimiters.

* Add \vert and \Vert

* Update screenshots

* Define verts array outside of function.

* Revert height-finding logic.

* Update screenshots

* Pick up review comments.

* Update CD screen shots
2020-12-28 16:50:09 -05:00
Ron Kok
75a3af9725 feat: Support {CD} (#2396)
* Support {CD}

* Edit screenshotter test to fit on one page

* Update screenshots

* Remove bogus Safari screenshot

* Edit documentation to avoid tag conflicts and explain delimiters

* Add type annotations

* Add bogus safari screenshot

* Update with real Safari screenshot

* Set label vertical alignment

* Revise call to parseExpression() per PR 2085 changes to macro parsing

* Update Firefox screenshot

* Pick up review comments

* Add unit tests and snapshot.

* Tighten up label collection.

* Better loop index

* remove extra space

* Picked up comments. Added a parse check. Added a test.

Co-authored-by: ylemkimon <y@ylem.kim>
Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
Co-authored-by: Kevin Barabash <kevinb7@gmail.com>
2020-12-27 13:45:31 -05:00
Ron Kok
17e86b985a fix: Remove premature CD screenshotter images (#2641)
* Remove premature CD screenshotter images

* Recommit for semantic pull request

Co-authored-by: ylemkimon <y@ylem.kim>
2020-11-15 05:48:48 +09:00
Ron Kok
60aecbdfe2 feat: Support \vcenter and \hbox (#2452)
* Support \vcenter, \raise, \lower, and \hbox

* Update screenshots

* Edit docs for strict and hbox to

* Fix typo for \hbox to

* Update Safari screenshot

* Augment docs for \vcentcolon

* Edit vcenter MathML comment.

* Remove pointless class from vcenter MathML

* Withdraw \raise and \lower

* Updatae Chrome and Firefox screenshots

* Update Safari screenshot

* Delete allowedInArgument setting

Co-authored-by: ylemkimon <y@ylem.kim>

* Update Chrome and Firefox screenshots

* Update Chrome and Firefox screenshots take 2

* Update screenshot

Co-authored-by: ylemkimon <y@ylem.kim>
2020-11-14 18:45:14 +09:00
renovate[bot]
7418057e3a chore(deps): update selenium/standalone-firefox docker tag to v3.141.59-20200826 [skip netlify] (#2544)
* chore(deps): update selenium/standalone-firefox docker tag to v3.141.59-20200826 [skip netlify]

* Update screenshots

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: ylemkimon <y@ylem.kim>
2020-09-26 02:53:23 +09:00
renovate[bot]
94c374c7c1 chore(deps): update selenium/standalone-chrome docker tag to v3.141.59-20200826 [skip netlify] (#2543)
* chore(deps): update selenium/standalone-chrome docker tag to v3.141.59-20200826 [skip netlify]

* Update screenshots

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: ylemkimon <y@ylem.kim>
2020-09-26 02:04:28 +09:00
Ron Kok
37990cc5b3 feat: Support matrix*, pmatrix*, bmatrix*, Bmatrix*, vmatrix*, and Vmatrix*. (#2488)
* Support matrix*, pmatrix*, bmatrix*, Bmatrix*, vmatrix*, and Vmatrix*

* Add tests and docs

* Delete screeshotter tests

* Fix column alignment and add bogus screenshot files

* Update real Chrome and Firefox screenshots.

* Update Safari screenshot

* Dedupe code in array.js

* Edit payload in array.js

* Edit again, correctly this time.
2020-09-06 09:56:09 -07:00
ylemkimon
dc5f97aaa2 feat(macro): improve argument parsing (#2085)
* Improve macro argument parsing

* Make \above a primitive command

* Fix screenshotter data

* Normalize argument where necessary

* Improve argument location info

* Update comments

* Minor refactor

* Modularize group parsers

* Allow braced and blank size argument

for non-strict mode and \genfrac, respectively.

* Minor refactor & update comments

* Remove raw option in parseStringGroup

* Update tests

* Fix { delimited parameter

* Update tests

* Update tests

* Normalize argument in \genfrac

* Update tests

* Consume space before scanning an optional argument

* Fix \\, \newline, and \cr behavior

* Fix flow error

* Update comments

* Remove unnecessary mode switching

Parser mode affects neither fetch nor consume.

* Allow single (active) character macro

* Add function property `primitive`

* Set \mathchoice and \*style primitive

* Separate size-related improvements out to #2139

* Fix flow error

* Update screenshots

* Update demo example

* Add a migration guide

* Fix capitalization

* Make a primitive function unexpandable

* Update screenshots

* Update screenshots

* Revert "Document \def doesn't support delimiters (#2288) (#2289)"

This reverts commit f96fba6f7f.

* Update comments, errors, and tests

* Update screenshots
2020-09-06 12:56:13 +09:00
ylemkimon
babc60c428 test: add missing screenshots for safari (#2423) 2020-08-13 06:43:44 -07:00
Ron Kok
42cc5e507e feat: Support \phase (#2406)
* Support \phase

* Update screenshots

* Update documentation

* Add a11y test

* Edit MathML notation to phasorangle

* Move code to enclose.js

Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
2020-08-13 00:08:36 -04:00
Ron Kok
26e0a05221 feat: Support \mathstrut (#2416)
* feat: Support \mathstrut

* Update screenshots
2020-08-12 23:45:33 -04:00
ylemkimon
36f9788cd6 chore(screenshotter): support Browserstack and test on Safari 13.1 (#2306)
* Support Browserstack in screenshotter

* Support Browserstack in CircleCI

* Test screenshots on Safari 13.1

* Don't run Safari screenshotter on forked PRs

* Update a screenshot

* Ignore *.log in .gitignore
2020-08-04 01:45:10 +09:00
Ron Kok
ab5936a6e7 feat: support {equation}, {equation*}, and {split} (#2369)
* Support {equation}, {equation*}, and {split}

* Update screenshots

* Allow {split} at top level

* Move equation column number check to to ParseArray

* Add token to ParseError

* Sharpen parameters passed to parseArray

* Add token information

* Update an {array} spec in screenshotter

* Adjust {array} screenshotter spec

* Make a non-strict error call when {array} argument specifies too few columns.

* Move context checks to a helper function.
2020-08-04 01:35:41 +09:00
Ron Kok
2f37dc9104 feat: support {align}, {align*}, {alignat}, and {alignat*} (#2341)
* Support {align}, {align*}, {alignat}, and {alignat*}

* Specify display mode for screenshots

* Add bogus screenshots

* Some screenshotter progress

* Update screenshots
2020-07-29 00:02:08 +09:00
Ron Kok
80b0e3dc20 Support {gather} and {gather*} (#2183)
* Support `gather` and `gather*`

* Add bogus screenshots

* Add correct screenshots

* Fix typo

* Update screenshots

* Improve error handling

* Scope styles inside .katex{}

* Revert console.log to console.error
2020-07-27 06:56:39 -07:00
Ron Kok
e76857ec03 feat: support \angl and \angln (#2334)
* Support \angl and \angln

* Update screenshots

* Update documentation
2020-07-25 22:53:11 +09:00
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
1a8f682155 Fix missing metrics for space (0x20) and no-break space (0xa0) (#2298)
* Fix missing metrics for space (0x20) and no-break space (0xa0)

* Update a screenshot

* Update font submodule

* Add a regression test
2020-07-13 03:38:34 +09:00
ylemkimon
d1c0468ef8 Reorganize some glyphs, simplify font selection, break \mathcal{123} (#2156)
* Reorganize some glyphs

* Remove mathdefault

Numerals are textord and it was never reachable.

* Use PUA for \imath and \jmath

* Update katex-fonts

* Update tests

* Update src/buildCommon.js

* Update screenshots

* Add comment regarding usage of PUA in \imath and \jmath

* Update fonts

Co-authored-by: Erik Demaine <edemaine@mit.edu>
2020-07-11 14:54:28 -04:00
Erik Demaine
7523e9714a \boldsymbol not italic for textords such as Greek (#2290)
* \boldsymbol not italic for textords such as Greek

Fix #2225: `\boldsymbol{\Omega}` will now produce a bold upright Omega
instead of a bold italic Omega.  This only affects `textord` symbols within
`\boldsymbol`, mimicking the no-font case in `makeOrd` which distinguishes
`textord` from `mathord` in a similar way.

* Update screenshots

Co-authored-by: Ron Kok <ronkok@comcast.net>
2020-07-09 09:22:33 -07:00
Ron Kok
1764d25048 Support \minuso (#2213)
* Support \minuso

* Update screenshots

* Add MathML version

* Add BIN spacing

* Update screenshots

* Add Unicode character

* Delete duplicate macro

Co-authored-by: Erik Demaine <edemaine@mit.edu>
2020-07-08 19:28:43 -04:00
Ron Kok
d6e8575942 Fix jagged parentheses (#2234)
* Fix jagged parentheses

* Update screenshots

* Coordinate overlap with repeat element length.

* Fix lint error.

Co-authored-by: Erik Demaine <edemaine@mit.edu>
2020-07-08 18:20:42 -04:00
Ron Kok
d49da10d79 Fix under accent depth (#2252)
* Fix under accent depth

* Update screenshots
2020-05-02 18:16:36 +09: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
ylemkimon
e5333ad04d Add HTML extension (#2082)
* Add html extension

* Fix flow error

* Update documentation

* Add tests

* Call buildA11yStrings for "html" node

* Throw ParseError when parsing \htmlData fails

* Improve documentation

* Add a screenshotter test

* Add dummy screenshot

* Update screenshots
2019-12-01 17:49:28 -05:00
Ron Kok
d1cee3cf3d Support {rcases} and {drcases} (#2149)
* Support {rcases} and {drcases}

* Fix lint error

* Update screenshots
2019-11-10 18:36:02 +09:00
Ron Kok
a92e39d810 Fix laps
* Fix lap with flex

* Fix lint error

* Fix more lint errors

* Fix indentation in test spec

* Update screenshots

* remove .glue class
2019-11-01 02:23:28 +09:00
Erik Demaine
081b44ab57 Use current font for accents (#2066)
* Use current font for accents

Fix #353 using `buildCommon.makeSymbol` to automatically determine font
for the accent symbol.

* Fix screenshots

* Fix flow error

* Fix file permissions
2019-08-20 22:40:40 +09:00
Erik Demaine
285c9fe0b6 Re includegraphics (#2053)
* Re-enable \includegraphics now that we have trust setting

This reverts commit 5806b240b3.

* Include Khan Academy test logo in repo and use in test (fix #1892)

* Update screenshots

* Update documentation

* Add tests, cleanup existing tests

* Update snapshots

* Enable trust testing (trust=true by default)
2019-07-22 00:15:29 +09:00
Erik Demaine
9c7f26b479 Fix argument font sizing in \fbox and \raisebox, fix font sizing in \TeX, \LaTeX, \KaTeX (#1787)
* Remove forced \normalsize in \raisebox

Fix #1786 (incorrect size of "E" in `\TeX`) by fixing `\raisebox` to
keep the current font size.  Previously, `\raisebox` was rendering its
second argument as if it were in `\normalsize\textrm{...}`; now,
the argument is just as if it were in `\textrm{...}`.

* Fix screenshots

* New "hbox" argument type to convert box-like arguments

* Review comments

* Fix \fbox to use hbox argument

* Render A in \LaTeX and \KaTeX in \scriptstyle (not \scriptsize)

* Add screenshot test

* Revert .sizing { width: min-content} thanks to #2044
2019-07-18 11:24:00 -04:00