* Automatic mrel/mbin spacing for \boldsymbol
Fix#1154
* Add test
* Add missing mode
* Separate out \boldsymbol support to correct flow types
* Fix ternaries thanks to @ronkok's comment
* Revert package-lock.json
* Add screenshot test
* Add and expose addFontMetrics function
* fix typo
* recreate package.json-lock
* Add setFontMetrics function to change the defualt metricMap - change getFontMetrics to getGlobalMetrics
* use new setFontMetrics on main KaTeX object
* fix package-lock.json error by rebuilding it
* Add appropriate tests
* update the snapshot
* \newcommand, \renewcommand, \providecommand
* Tests
* Add comment
* Add symbols to the set of already defined things
* Add implicitCommands, catch \hline outside array
* Add \relax
* Move isDefined to be a method of MacroExpander
* Namespace.has
* Reword error messages
* Add \hdashline given #1407
* Support \hdashline
Support `\hdashline` from package `arydshln`. This PR acts as a complement to PR #1395.
Similarly to #1395, the dashed line is rendered as `border-bottom-style: dashed;`. That does not exactly match the `dashsegment` and `dashgap` lengths in `arydshln`, but it does render black lines with sharp edges.
* Fixed top line position
* Add screenshots
* Fix lint error
* Fix another lint error
* Deleted HLine screenshots
* Pick up comments
* Fix ligatures not always triggering
Example: \text{\rm --} would not cause ligature but should
* Remove ligatures in \texttt mode
* Add screenshot tests
* Fix MathML ligatures
* Fix type
* Handle \text... fonts in MathML building
* Remove leftover console deubgging
* Replace ParseNode<*> with a more accurate AnyParseNode and fix flow errors.
* Allow "array" environment type spec to use any all symbol type.
Before this commit, it was constrained to use "mathord" and "textord", but a
recent change in HEAD resulted in a "rel" node being used in the spec for, e.g.
\begin{array}{|l||c:r::}\end{array}
* Address reviewer comments: rename `lastRow` to `row` in array.js.
* hacked together a dashed vertical bar
* Updated tests and spec.
* tidied up the screenshot template for arrays
* added the vertical lines at the end back
* Updated screenshots for arrays
* Support \arraystretch as a macro definition
Also add `expandMacro` and `expandMacroAsText` helpers to `MacroExpander`.
* Remove excess defaulting
* Add test
* Fix \cancel
Fixes#1080.
Improve `\cancel` in three ways:
1. Better lateral spacing.
2. Steeper `\cancel` lines on single characters.
3. Treat height and depth to match the `cancel` package behavior, not its documentation.
* Update screenshots
* 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
* Make letter tests strict
The recently added rendering mode `strict:"warn"` will allow any Unicode characters to be accepted. We expect `strict: true` to be pickier than that.
This PR sets `strict: true` on tests in `katex-spec.js` that should enforce that pickiness.
* Pick up comments
* Fix import of strictSettings
* Rewrite spacing commands as macros
Fix#1130 by defining `\!`, `\negthinspace`, `\,`, `\thinspace`, `\:`,
`\medspace`, `\;`, `\thickspace`, `\negmedspace`, `\negthickspace`,
`\enspace`, `\enskip`, `\qquad`, `\quad` as macros.
Fix#1036 by defining a new `SpaceNode` in mathMLTree that recognizes
all special space amounts from
https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html
* Fix <mspace> rendering and add a test to catch it
* Update screenshots
* Wrap special space characters in <mtext>
* Update screenshots
* Fix MathML escaping behavior
* Fix flow typos
* Fix Unicode-chrome
* Reimplement mod operators in terms of macros
* Rerun ModScript
* Remove excess table entries (now already macros)
* Fix bmod
Fixes issue #1075.
Currently, a row separator such as `\[0.3em]` will cause the auto-render extension to fail if the row separator is placed between `\(…\)` math delimiters.
This PR re-orders the array of left delimiters that get searched for, putting `\[` last in the list. This, `\\[0.3em]` is no longer mistaken for a math delimiter.
* Nested environments of macro definitions
* Rename environment -> namespace
* \def support
* Clean up \df@tag at beginning
* \global\def support
* Fix \global via new setMacro helper
* Fix caching behavior and build array on top of it
Also avoid double lookup of macros
* Add tests
* Add argument tests
* Remove global pointer
* Note about macros object being modified
* add __defineMacro
* Add \global\def test
* More \global tests
* Constant-time lookup
Rewrite to use an "undo" stack similar to TeX, so get and set are
constant-time operations. get() still has to check two objects: one with all
current settings, and then the built-ins. Local set() sets the current value
and (when appropriate) adds an undo operation to the undo stack. Global set()
still takes time linear in the number of groups, possibly changing the undo
operation at every level.
`Namespace` now refers to a space of things like macros or lengths.
* Add \def to-dos
* Put optional arguments in their own group
* Rename `pushNamespace` -> `beginGroup`
* Wrap each expression in a group namespace
* Add comments
Fix issue #1333.
`\coloneq` and several similar functions are written as macros. When expanded, these result in atoms like ":" and "=" placed adjacent to each other at the top level. So they exposed to a split by an automatic line break.
This PR wraps each of these macros in an `\mathrel{ }`. This prevents the line break.
* Correct (type-wise) raisebox's usage of sizing's buildHtml.
* Move HTML and MathML groupTypes into defineFunction.
Currently, functions defined in functions/* import all exports from buildHtml
and buildMathML, but they should never use `groupTypes` directly as it loses
type-safety. They should instead use more type-safe `htmlBuilder`s and
`mathmlBuilder`s exported directly from other definitions `functions/*` to allow
flow to catch errors.
* Rename groupTypes to groupBuilders.
This is particularly important as update-sri.js only updates jsdelivr links.
I was able to get update-sri.js to do the heavy lifting (computing checksums)
after updating the links in general, and downloading v0.10.0-alpha from CDN.
* Move "supsub" handlers to functions/subsub.js.
* Add flow types to functions/supsub.js.
* Simplify getBaseElem's output type based on all existing uses.
Before supsub was ported to flow, it had an instance where it could pass a
nullable to isCharacterBox which would pass it into getBaseElem and receive a
false. The refactor and strict typing of supsub now ensures that only a
non-nullable value is passed in to isCharacterBox and getBaseElem.
* Remove warnings at the top of buildMathML and buildHTML.
* Fix silly mistake.
* Fix lap vertical alignment.
Fixes issue #1153.
* Fix horizontal alignment
Wrap the entire lap pair with a mord.
* Support Unicode \ll and \lll
Fixes issue #1271
* Update screenshots
* Update screenshots
* generated updated screenshots for Lap
* Change double strut to single strut
* Delete screenshotter test
* Add (commented out) test
* Fix mis-spelled word
* Avoid unnecessary <mrow> wrapping
buildMathML gains two helpers:
* `makeRow` helper wraps an array of nodes in `<mrow>`,
unless the array has length 1, in which case no wrapping is necessary.
* `buildExpressionRow` for common case of `makeRow(buildExpression(...))`
* Combine adjacent <mtext>s in all cases
No more need for `makeTextRow` helper or anything fancy in text MathML handler.
* Concatenate <mn>s and decimal point into single <mn>
Fix#203
* Fix snapshots