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:
Erik Demaine
2019-04-05 13:51:11 -04:00
committed by ylemkimon
parent ac4c6271d4
commit 070883532a
5 changed files with 56 additions and 17 deletions

View File

@@ -13,10 +13,12 @@ const textFontFamilies = {
const textFontWeights = {
"\\textbf": "textbf",
"\\textmd": "textmd",
};
const textFontShapes = {
"\\textit": "textit",
"\\textup": "textup",
};
const optionsWithFont = (group, options) => {
@@ -39,9 +41,9 @@ defineFunction({
// Font families
"\\text", "\\textrm", "\\textsf", "\\texttt", "\\textnormal",
// Font weights
"\\textbf",
"\\textbf", "\\textmd",
// Font Shapes
"\\textit",
"\\textit", "\\textup",
],
props: {
numArgs: 1,