mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-07 04:08:43 +00:00
Support \textup and \textmd (#1921)
* Support \textup and \textmd This PR adds support for `\textup` and `\textmd`, which are the inverses of `\textit` and `\textbf`. Unlike bare `\text`, they result in `textup` and `textmd` classes being applied, but those have no CSS rules, so they act the same as bare `\text`. Fixes #1909. * Add documentation * Add unsupported font commands
This commit is contained in:
@@ -1708,6 +1708,15 @@ describe("An HTML font tree-builder", function() {
|
||||
expect(markup).toContain("<span class=\"mord textit\">R</span>");
|
||||
});
|
||||
|
||||
it("should render \\textup{R} with the correct font", function() {
|
||||
const markup1 = katex.renderToString(r`\textup{R}`);
|
||||
expect(markup1).toContain("<span class=\"mord textup\">R</span>");
|
||||
const markup2 = katex.renderToString(r`\textit{\textup{R}}`);
|
||||
expect(markup2).toContain("<span class=\"mord textup\">R</span>");
|
||||
const markup3 = katex.renderToString(r`\textup{\textit{R}}`);
|
||||
expect(markup3).toContain("<span class=\"mord textit\">R</span>");
|
||||
});
|
||||
|
||||
it("should render \\text{R\\textit{S}T} with the correct fonts", function() {
|
||||
const markup = katex.renderToString(r`\text{R\textit{S}T}`);
|
||||
expect(markup).toContain("<span class=\"mord\">R</span>");
|
||||
@@ -1720,6 +1729,15 @@ describe("An HTML font tree-builder", function() {
|
||||
expect(markup).toContain("<span class=\"mord textbf\">R</span>");
|
||||
});
|
||||
|
||||
it("should render \\textmd{R} with the correct font", function() {
|
||||
const markup1 = katex.renderToString(r`\textmd{R}`);
|
||||
expect(markup1).toContain("<span class=\"mord textmd\">R</span>");
|
||||
const markup2 = katex.renderToString(r`\textbf{\textmd{R}}`);
|
||||
expect(markup2).toContain("<span class=\"mord textmd\">R</span>");
|
||||
const markup3 = katex.renderToString(r`\textmd{\textbf{R}}`);
|
||||
expect(markup3).toContain("<span class=\"mord textbf\">R</span>");
|
||||
});
|
||||
|
||||
it("should render \\textsf{R} with the correct font", function() {
|
||||
const markup = katex.renderToString(r`\textsf{R}`);
|
||||
expect(markup).toContain("<span class=\"mord textsf\">R</span>");
|
||||
|
Reference in New Issue
Block a user