2123 Commits

Author SHA1 Message Date
Int Fract
4f1d916674 fixed spelling error (#3845)
changed "its on line" to "its o**w**n line"
2023-08-05 14:01:38 +00:00
KaTeX bot
ad03d1e9dc chore(release): 0.16.8 [ci skip]
## [0.16.8](https://github.com/KaTeX/KaTeX/compare/v0.16.7...v0.16.8) (2023-06-24)

### Features

* expose error length and raw error message on ParseError ([#3820](https://github.com/KaTeX/KaTeX/issues/3820)) ([710774a](710774aaeb))
2023-06-24 05:29:48 +00:00
Max Langer
710774aaeb feat: expose error length and raw error message on ParseError (#3820)
Add length and rawError as public parameters of ParseError to allow for richer error UIs in editors. This information was already there, but only encoded into the errors message. This change is purely additional, the existing parameters have not changed.
2023-06-24 05:27:06 +00:00
Hagen Wierstorf
5dd9bc4a47 docs(libs.md): add Sphinx extension (#3833)
* docs(libs.md): add Sphinx extension

* Remove Extension

* Remove LaTeX from Canvas

* Sort alphabetically
2023-06-13 13:46:18 +00:00
rojer
c3fb74f888 docs(libs.md): add a Wechat Mini Program library (#3817) 2023-05-24 17:43:56 +00:00
Adam Lui 刘展鹏
2bb338db6b docs: use dark-mode logo in README (#3821)
Adds a light logo to header to appear in dark mode so it doesn't appear almost empty.
2023-05-17 15:24:06 +00:00
KaTeX bot
24533264c9 chore(release): 0.16.7 [ci skip]
## [0.16.7](https://github.com/KaTeX/KaTeX/compare/v0.16.6...v0.16.7) (2023-04-28)

### Bug Fixes

* **docs/support_table.md:** delete redundant "varPsi" ([#3814](https://github.com/KaTeX/KaTeX/issues/3814)) ([33a1b98](33a1b98710))
2023-04-28 11:42:19 +00:00
Untitled_unrevised
33a1b98710 fix(docs/support_table.md): delete redundant "varPsi" (#3814) 2023-04-28 11:37:46 +00:00
KaTeX bot
5dc7af0561 chore(release): 0.16.6 [ci skip]
## [0.16.6](https://github.com/KaTeX/KaTeX/compare/v0.16.5...v0.16.6) (2023-04-17)

### Bug Fixes

* Support `\let` via `macros` option ([#3738](https://github.com/KaTeX/KaTeX/issues/3738)) ([bdb0be2](bdb0be2017)), closes [#3737](https://github.com/KaTeX/KaTeX/issues/3737) [#3737](https://github.com/KaTeX/KaTeX/issues/3737)
2023-04-17 20:02:34 +00:00
Erik Demaine
bdb0be2017 fix: Support \let via macros option (#3738)
* fix: Support `\let` via `macros` option

Issue #3737 turned out to be how we handled the return value of `expandOnce`.
We assumed that, if the return value isn't an `Array`, it's an
`instanceof Token`.  This isn't necessary true with a user's `macros`
object, and given that we don't currently export `Token`, it's pretty
difficult to bypass.

Given that we never actually use the array return values from
`expandOnce`, I changed the return value for `expandOnce` to either a
`number` (to indicate the number of expanded tokens, so you could still
look up the tokens in the stack if you wanted to) or `false`
(to indicate no expansion happened).  We can't use `0` for the latter
because an actual expansion might result in zero tokens.
The resulting code is arguably cleaner.

I also documented that `macros` can have object expansions, and
specified how to simulate `\let`.

Fixes #3737

* Revise macros documentation according to comments
2023-04-17 19:59:56 +00:00
Josh Soref
62144e4abd chore: Spelling (#3762)
* spelling: analysis

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: calculate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: calligraphic

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: compatibility

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: corresponding

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: devanagari

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: display

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: empirically

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: environment

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: from

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: gatsby

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: glyph

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: hlines

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: itself

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: javascript

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: multiple

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: necessary

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: precedence

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: respectively

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: retrieved

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: similarly

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: simultaneously

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: stretch

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: surprisingly

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: unambiguously

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: vinculum

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: which

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* Restore nonexistsOK

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Erik Demaine <edemaine@mit.edu>
2023-04-17 18:27:57 +00:00
KaTeX bot
bd502a6a9d chore(release): 0.16.5 [ci skip]
## [0.16.5](https://github.com/KaTeX/KaTeX/compare/v0.16.4...v0.16.5) (2023-04-17)

### Features

* __defineFunction API exposing internal defineFunction ([#3805](https://github.com/KaTeX/KaTeX/issues/3805)) ([c7b1f84](c7b1f84b78)), closes [#3756](https://github.com/KaTeX/KaTeX/issues/3756)
2023-04-17 17:51:59 +00:00
Erik Demaine
c7b1f84b78 feat: __defineFunction API exposing internal defineFunction (#3805)
For making KaTeX libraries.  Fixes #3756
2023-04-17 17:49:22 +00:00
renovate[bot]
818694544f chore(deps): update dependency webpack to v5.76.0 [security] (#3796)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-17 14:53:17 +00:00
Zihua Li
6b10003f8e docs(users): add Slab to the users list (#3800) 2023-04-11 16:23:05 +00:00
ylemkimon
2e64a3afa8 chore(deps): update dependencies (#3698)
* fix: update dependencies

* chore: update actions

* chore: update flow-typed for jest

* Fix line endings

---------

Co-authored-by: Erik Demaine <edemaine@mit.edu>
2023-04-11 11:44:31 -04:00
Erik Demaine
92ac286a3a docs: Fix \bar documentation by avoiding global redefinition (#3804)
* `\bar` examples weren't rendering correctly because of `\gdef\bar`
  example when illustrating `\gdef` and `\xdef`.
* Improve `\bar` name to `\sqr` when defining squaring
  (not necessary for fix, but improved naming).
* Fix `\def` scoping test that originally seemed related.

Fixes #3803
2023-04-11 11:29:06 -04:00
zzllrr小乐笑了
01488c6d3c docs(users): add zzllrr mather project (#3767)
add a new open-sourced mather project using KaTeX
2022-12-29 17:44:05 +00:00
KaTeX bot
a4bfc2d210 chore(release): 0.16.4 [ci skip]
## [0.16.4](https://github.com/KaTeX/KaTeX/compare/v0.16.3...v0.16.4) (2022-12-07)

### Bug Fixes

* space should prevent optional argument to \\ ([#3746](https://github.com/KaTeX/KaTeX/issues/3746)) ([a0deb34](a0deb3410f)), closes [#3745](https://github.com/KaTeX/KaTeX/issues/3745)
2022-12-07 23:04:44 +00:00
Erik Demaine
a0deb3410f fix: space should prevent optional argument to \\ (#3746)
Fix `src/functions/cr.js`'s definition of `\\` to manually look for an
optional argument via `future()` instead of `numOptionalArgs`, so that
it does *not* skip over spaces.  This matches the existing behavior of
`\\` in `src/environments/array.js` and AMSMath's behavior of `\math@cr`
via `\new@ifnextchar`.

Fixes #3745

Co-authored-by: Ron Kok <ronkok@comcast.net>
2022-12-07 15:01:07 -08:00
renovate[bot]
3db8e34719 chore(deps): update dependency mini-css-extract-plugin to v2.6.1 [skip netlify] (#3747)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-02 01:28:48 +00:00
KaTeX bot
2c13d2631f chore(release): 0.16.3 [ci skip]
## [0.16.3](https://github.com/KaTeX/KaTeX/compare/v0.16.2...v0.16.3) (2022-10-22)

### Bug Fixes

* \hline after \cr ([#3735](https://github.com/KaTeX/KaTeX/issues/3735)) ([ebf6bf5](ebf6bf5b50)), closes [#3734](https://github.com/KaTeX/KaTeX/issues/3734)
2022-10-22 16:11:14 +00:00
Ron Kok
ebf6bf5b50 fix: \hline after \cr (#3735)
Support `\hline` when it occurs after a `\cr` within an environment

Fixes #3734
2022-10-22 16:08:34 +00:00
Erik Demaine
be07984313 docs: New security reporting policy (#3723) 2022-10-17 21:52:49 +00:00
little-cindy
a3155ba03c docs(support_table): fix escaping of accent macros (#3732)
* Update support_table.md
2022-10-04 13:02:54 +00:00
Jim Fisher
c43f835f73 docs: Update "No character metrics" documentation (#3719)
* Update quoted error message

This page didn't appear for me when searching for "No character metrics". I then stumbled onto it, and it's quite useful

* Update broken link

metrics/extract_ttfs.py does not exist, and it's not the "root" of the metric-generation stuff
2022-09-22 11:08:05 -04:00
KaTeX bot
ef49e2be91 chore(release): 0.16.2 [ci skip]
## [0.16.2](https://github.com/KaTeX/KaTeX/compare/v0.16.1...v0.16.2) (2022-08-29)

### Bug Fixes

* **auto-render:** concatenate content of successive text nodes ([#3422](https://github.com/KaTeX/KaTeX/issues/3422)) ([4d3fdd8](4d3fdd8647))
* Implement \pmb via CSS text-shadow ([#3505](https://github.com/KaTeX/KaTeX/issues/3505)) ([176552a](176552a691))
2022-08-29 21:57:29 +00:00
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
Marco Esters
4d3fdd8647 fix(auto-render): concatenate content of successive text nodes (#3422)
* fix(auto-render): concatenate text nodes

Concatenate successive text nodes to prevent auto-render from skipping
math input when browsers split text nodes with long textContent.

* Remove siblings only when math found

Only remove siblings when math expressions were found to prevent removal
of nodes that do not contain math.

* Skip siblings if they do not contain math

* Fixed typo in comments

* Added first tests for large test nodes

* Expanded testing to compare renderMathInElement with renderMathInText

* Simplified text node test

* Change description of test

* Update contrib/auto-render/auto-render.js

Co-authored-by: marcoesters <marco.esters@duke.edu>
Co-authored-by: ylemkimon <y@ylem.kim>
2022-08-30 06:50:14 +09:00
kori reine
99be728a78 refactor: update toSplitInto to accept delimiter object (#3444)
Update toSplitInto matcher to accept the same delimiter object type that's used in renderMathInElement

Co-authored-by: ylemkimon <y@ylem.kim>
2022-08-30 06:39:43 +09:00
HallowedDust5
f04c645f52 docs: fix broken link (#3525)
The previous link is deprecated, I'm pretty sure the new link directs to what is intended, but I was not here before that link broke.

Co-authored-by: ylemkimon <y@ylem.kim>
2022-08-29 21:31:29 +00:00
CommanderRoot
299584d12f refactor: replace deprecated String.prototype.substr() (#3590)
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Co-authored-by: ylemkimon <y@ylem.kim>
2022-08-29 21:26:39 +00:00
renovate[bot]
48b15e4340 chore(deps): update dependency istanbul-reports to v3.1.5 [skip netlify] (#3696)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-28 22:41:39 +00:00
Erik Demaine
7e6e9eee29 docs: Fix \set documentation (#3646)
Work around `|` in tables

See https://github.com/facebook/docusaurus/issues/2004
2022-08-28 10:18:49 -07:00
renovate[bot]
8b4ba62845 chore(deps): update dependency cssnano to v5.1.13 [skip netlify] (#3695)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-28 13:45:02 +00:00
renovate[bot]
ade917b918 chore(deps): update dependency browserslist to v4.21.3 [skip netlify] (#3691)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-28 10:10:51 +00:00
KaTeX bot
cf2a46258e chore(release): 0.16.1 [ci skip]
## [0.16.1](https://github.com/KaTeX/KaTeX/compare/v0.16.0...v0.16.1) (2022-08-28)

### Bug Fixes

* Use SVGs for some stacked delims ([#3686](https://github.com/KaTeX/KaTeX/issues/3686)) ([8a65a2e](8a65a2e1fd))
2022-08-28 04:24:43 +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
7530849bdb chore: Upgrade to yarn 3.2.2, Node 16 (#3682)
* Upgrade to yarn 4.0.0-rc.14

Adds support for Node 18

* Upgrade CI to Node 16

* Update website/yarn.lock

* pnpIgnorePatterns for subproject

* Switch to stable Yarn 3.2.2
2022-08-17 14:10:08 -07:00
renovate[bot]
00d015f6bf chore(deps): update dependency cssnano to v5.1.12 [skip netlify] (#3676)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-01 22:37:51 +00:00
Erik Demaine
9164a15ef8 docs: Cleanup changelog (#3649) 2022-06-10 10:46:58 -04:00
KaTeX bot
0854e68740 chore(release): 0.16.0 [ci skip]
# [0.16.0](https://github.com/KaTeX/KaTeX/compare/v0.15.6...v0.16.0) (2022-06-06)

### Bug Fixes

* **copy-tex:** Use JS (instead of CSS) to select full equation, solving display glitches ([#3586](https://github.com/KaTeX/KaTeX/issues/3586)) ([8c2d852](8c2d852c4a))

### BREAKING CHANGES

* **copy-tex:** copy-tex extension no longer has (or requires) a CSS file.

* Code cleanup, lint fixes, port to Flow

* Rewrite to extend both start and end of range

* Remove contrib/**/*.css linting

Co-authored-by: Erik Demaine <edemaine@mit.edu>
2022-06-06 16:13:28 +00:00
Fons van der Plas
8c2d852c4a fix(copy-tex): Use JS (instead of CSS) to select full equation, solving display glitches (#3586)
* copy-tex: Use JS to select full equation instead of CSS

* remove CSS

* Update webpack.common.js

* more build tweaks

* Update contrib/copy-tex/copy-tex.js

Co-authored-by: Erik Demaine <edemaine@mit.edu>

* Document new behavior

BREAKING CHANGE: copy-tex extension no longer has (or requires) a CSS file.

* Code cleanup, lint fixes, port to Flow

* Rewrite to extend both start and end of range

* Remove contrib/**/*.css linting

Co-authored-by: Erik Demaine <edemaine@mit.edu>
2022-06-06 12:09:30 -04:00
KaTeX bot
023cc0342c chore(release): 0.15.6 [ci skip]
## [0.15.6](https://github.com/KaTeX/KaTeX/compare/v0.15.5...v0.15.6) (2022-05-20)

### Features

* Support \Braket, \set, and \Set ([#3214](https://github.com/KaTeX/KaTeX/issues/3214)) ([9e3ae4d](9e3ae4d5a8))
2022-05-20 17:28:59 +00: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
BettyJJ
8319467151 docs(support_table): \leftarrowtail is already supported (#3515) 2022-05-20 17:15:41 +00:00
snip-bot
be8a3847d2 docs: Add snip to the users list (#3614)
* add snip

* Alphabetize

Co-authored-by: snip-bot <snip-bot>
Co-authored-by: Erik Demaine <edemaine@mit.edu>
2022-05-20 17:10:16 +00:00
KaTeX bot
4fa84d0ca3 chore(release): 0.15.5 [ci skip]
## [0.15.5](https://github.com/KaTeX/KaTeX/compare/v0.15.4...v0.15.5) (2022-05-20)

### Bug Fixes

* Avoid crash when \ce{} is empty ([#3627](https://github.com/KaTeX/KaTeX/issues/3627)) ([4865e45](4865e45437))
2022-05-20 16:07:59 +00:00
Ron Kok
4865e45437 fix: Avoid crash when \ce{} is empty (#3627)
* Fix: Avoid crash when \ce{} is empty

* Shorten one line of code
2022-05-20 12:05:12 -04:00
KaTeX bot
575dab79f1 chore(release): 0.15.4 [ci skip]
## [0.15.4](https://github.com/KaTeX/KaTeX/compare/v0.15.3...v0.15.4) (2022-05-20)

### Features

* Support Unicode (sub|super)script characters ([#3633](https://github.com/KaTeX/KaTeX/issues/3633)) ([d8fc35e](d8fc35e6a9))
2022-05-20 13:53:28 +00:00