mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 03:38:39 +00:00
Add bra-ket notation (#2162)
* Add bra-ket notation * Fix typo * Remove ketbra * Remove ketbra, add Bra and Ket * Add Bra/Ket and fix a typo in bra's source * Fix bra-ket typo in docs * Fix bra-ket escape typo in docs * Replace bra-ket pipe with \vert in docs
This commit is contained in:
committed by
Kevin Barabash
parent
800cdb2d23
commit
4b905064ab
@@ -3312,6 +3312,26 @@ describe("A macro expander", function() {
|
||||
it("should expand \\argmax as expected", () => {
|
||||
expect`\argmax`.toParseLike`\operatorname*{arg\,max}`;
|
||||
});
|
||||
|
||||
it("should expand \\bra as expected", () => {
|
||||
expect`\bra{\phi}`.toParseLike`\mathinner{\langle{\phi}|}`;
|
||||
});
|
||||
|
||||
it("should expand \\ket as expected", () => {
|
||||
expect`\ket{\psi}`.toParseLike`\mathinner{|{\psi}\rangle}`;
|
||||
});
|
||||
|
||||
it("should expand \\braket as expected", () => {
|
||||
expect`\braket{\phi|\psi}`.toParseLike`\mathinner{\langle{\phi|\psi}\rangle}`;
|
||||
});
|
||||
|
||||
it("should expand \\Bra as expected", () => {
|
||||
expect`\Bra{\phi}`.toParseLike`\left\langle\phi\right|`;
|
||||
});
|
||||
|
||||
it("should expand \\Ket as expected", () => {
|
||||
expect`\Ket{\psi}`.toParseLike`\left|\psi\right\rangle`;
|
||||
});
|
||||
});
|
||||
|
||||
describe("\\tag support", function() {
|
||||
|
Reference in New Issue
Block a user