* 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)
* 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
* Fix font choice in operators like \log (e.g. \boldsymbol{\log})
Fix#1971 by correctly passing arguments into the font choice for
the HTML handler for operators like \log.
* Extend BoldSymbol screenshot test
* Require options argument in mathsym to avoid this type of bug in the future
* Update screenshot
Fix#1788 by removing `display:inline-block` rule from `.sizing`.
I don't see why a sizing change cares about the display mode, and it
fixes the interaction between `makeVList` and sizing commands.
It should also allow me to remove a `.sizing { width:min-content }` rule
that I had to add in #1787.
* \color affects following \right
Fix#1844 by giving `leftright` nodes a `rightColor` attribute for how
to color the right bracket. Now `\color` sets the macro
`\current@color` in the current environment (in particular, resetting
after `\right`), just like `color.sty` does in LaTeX. This is used to
specially pass the current color into any following `\right` and then
into the `leftright` parse node.
* Add test
* Put each array cell in its own group/namespace
* Improve cell group isolation, add test and TODO
* Improve comments
* Fix tag positioning to live within katex-html parent
`.tag` has `position: absolute`, but this positions it relative to the nearest
parent with a non-static `position` (see
https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block).
This PR makes `.katex-display > .katex > .katex-html` that parent.
* Update screenshots
* Fix roots
* Update screenshots
* Added a test in a craven gambit to get a green check mark
* Adjust small radicals
* Fix lint error
* Update screenshots
* Support \pmb
* Fix lint error
* Add phony screenshots
* Screenshots take two
* Screenshots take three
* Simplify copies
* Move determination of mclass from handler to htmlBuilder
* Change to a macro definition
* Update screenshots
* Pick up review comments
* Clean up nesting of braces
* Update screenshot
* Support \genfrac and \above
* Accommodate delimiters inside groups
* Update screenshots take one`
* Update screenshots take two
* Fix flow error
* Fix lint error
* 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
* 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
* 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
* 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
* 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
* 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
* Tag sketch
* Drop objectAssign; already using Object.assign elsewhere
* Basic \gdef support
* Bug fix
* Finish \tag
* MathML numbers equations with <mlabeledtr>
* Fix flow bugs
* \gdef tests
* Add basic \tag tests
* Screenshot test for \tag
* \tag* test
* Add missing file
* Bug fix screenshot
* Major refactor
* Represent tag at top level of parse tree, requiring less hackery
* No more \@tag function; it was essentially just doing \text
* Wrap tag in group so e.g. ( and ) are formatted the same
* Add `feed` method to MacroExpander for multiple inputs (for tag)
* Bug fixes in buildHTML, makeTextRow, _getBuilt (for display mode)
* Remove excess <mrow> wrapper when unnecessary
* Update screenshot from tag being wrapped in group
* Add maxExpand limit
* Support for top-level \newline and \\ in inline math
This was a little tricky because `\\` was defined as an endOfExpression.
Instead made `\\` a termination specific to an array environment.
Outside an array environment, buildHTML handles the `cr` object,
resulting in a `.newline` class. Currently this turns into a
`display: block` (with appropriate vertical spacing) only in inline math,
matching LaTeX.
* Simplify code
* Fix Jest errors
* NewLine screenshot test
* Bug fix: \\ only works at top level of inline
* Add \newline and \cr to test
* Switch test to pmatrix
* Add vertical space test
* Add \\ vs. \newline tests
* Fix flow errors
* Add \cr test
* Add documentation for \\ at top level
* Comment out newRow
* Fix commenting out
* Line breaks for inline formulas
* Basic support for \allowbreak and \nobreak
* Fix spacing around \nobreak, and add documentation
* Backwards-compatibility _getBuilt to fix tests
* Put operator spacing on same line as operator
* One approach to ~
* Simplify \allowbreak/\nobreak, make ~/\nobreakspace prevent line breaks
* Adapt to #1295
* Prevent wrapping within a .base
* Implement \hspace* properly
* Fix flow error
* Update comment for regularSpace
* Update screenshots
* Move `width: min-content` from .katex into .base
* Fix screenshot
* Add min-width rule to .vlist-s
* Factor out hasClass method
* Cleanup nobreak test
* Pull out buildHTMLUnbreakable
* Fix \hspace* test (no longer the same as \hspace)
* Fix \nobreak handling
* Add screenshot test
* Fix \underbrace
Fix the vertical alignment so that it correctly takes into account the descender of the lower element.
Fixes issue 1303.
* Update screenshots
* 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
* Support Unicode \ll and \lll
Fixes issue #1271
* Adjust \underset alignment and spacing
Fixes issue #1288.
1. Fixes vertical alignment by keeping the base element on the baseline.
2. Assigns horizontal spacing to \underset in a manner that aligns with LaTeX `\binrel`
* Fix flow error
* Add comment
* Allow for shift of mathops
* Update screenshots
* Test for nested ordgroups
* Set \stackrel spacing class to mrel
* Fix lint error
* Better determination of atom type
* Add comment.
* Add `suppressBaseShift` to ParseNodeTypes
* \textasciitilde and fix ~ in \verb
* Add support for `\textasciitilde` which reproduces tilde character
in text mode.
* Make `~` render as tilde instead of space within `\verb`,
by manually mapping that character to `\textasciitilde`.
This seems to be the only character that needs such manual mapping
to reproduce LaTeX's `\verb` behavior.
* Add `, -, ', ~ to Verb screenshot test