mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
Fix \underset (#1277)
* Fix \underset This PR modifies `\underset` and `\overset` to align with LaTeX behavior when a superscript is applied after the `\underset`. Fixes issue #1275. I also changed the spacing from KaTeX `mop` to KaTeX `rmel`. The result seems to be a closer visual match to LaTeX. * Update screenshots
This commit is contained in:
@@ -2779,11 +2779,9 @@ describe("A macro expander", function() {
|
||||
});
|
||||
*/
|
||||
|
||||
it("should expand the \\overset macro as expected", function() {
|
||||
expect("\\overset?=").toParseLike("\\mathop{=}\\limits^{?}");
|
||||
expect("\\overset{x=y}{\\sqrt{ab}}")
|
||||
.toParseLike("\\mathop{\\sqrt{ab}}\\limits^{x=y}");
|
||||
expect("\\overset {?} =").toParseLike("\\mathop{=}\\limits^{?}");
|
||||
it("should build \\overset and \\underset", function() {
|
||||
expect("\\overset{f}{\\rightarrow} Y").toBuild();
|
||||
expect("\\underset{f}{\\rightarrow} Y").toBuild();
|
||||
});
|
||||
|
||||
it("should build \\iff, \\implies, \\impliedby", function() {
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 16 KiB |
@@ -218,7 +218,7 @@ OpLimits: |
|
||||
OverUnderline: x\underline{x}\underline{\underline{x}}\underline{x_{x_{x_x}}}\underline{x^{x^{x^x}}}\overline{x}\overline{x}\overline{x^{x^{x^x}}} \blue{\overline{\underline{x}}\underline{\overline{x}}}
|
||||
OverUnderset: |
|
||||
\begin{array}{l}
|
||||
x\overset?=1\\
|
||||
x\overset?=1 \quad \underset{*}{x}^2 \\
|
||||
{\displaystyle\lim_{t\underset{>0}\to0}}\\
|
||||
a+b+c+d\overset{b+c=0}\longrightarrow a+d\\
|
||||
\overset { x = y } { \sqrt { a b } }
|
||||
|
Reference in New Issue
Block a user