Add support for \cal (#2116)

Fix #2115 by adding \cal to list of old-style font commands.
(Surprisingly tiny change!)
Add tests for all old-style font commands.
This commit is contained in:
Erik Demaine
2019-10-10 20:46:10 -04:00
committed by GitHub
parent 634b4e2ae4
commit 1eda0e86a0
4 changed files with 13 additions and 3 deletions

View File

@@ -1601,6 +1601,15 @@ describe("A font parser", function() {
const built = getBuilt`a\boldsymbol{}b\boldsymbol{=}c\boldsymbol{+}d\boldsymbol{++}e\boldsymbol{xyz}f`;
expect(built).toMatchSnapshot();
});
it("old-style fonts work like new-style fonts", () => {
expect`\rm xyz`.toParseLike`\mathrm{xyz}`;
expect`\sf xyz`.toParseLike`\mathsf{xyz}`;
expect`\tt xyz`.toParseLike`\mathtt{xyz}`;
expect`\bf xyz`.toParseLike`\mathbf{xyz}`;
expect`\it xyz`.toParseLike`\mathit{xyz}`;
expect`\cal xyz`.toParseLike`\mathcal{xyz}`;
});
});
describe("A \\pmb builder", function() {