mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
Merge pull request #684 from edemaine/anglebracket
Support <, >, | and many \text... commands in text mode
This commit is contained in:
@@ -109,7 +109,11 @@ defineSymbol(math, main, textord, "\u2660", "\\spadesuit");
|
||||
|
||||
// Math and Text
|
||||
defineSymbol(math, main, textord, "\u2020", "\\dag");
|
||||
defineSymbol(text, main, textord, "\u2020", "\\dag");
|
||||
defineSymbol(text, main, textord, "\u2020", "\\textdagger");
|
||||
defineSymbol(math, main, textord, "\u2021", "\\ddag");
|
||||
defineSymbol(text, main, textord, "\u2021", "\\ddag");
|
||||
defineSymbol(text, main, textord, "\u2020", "\\textdaggerdbl");
|
||||
|
||||
// Large Delimiters
|
||||
defineSymbol(math, main, close, "\u23b1", "\\rmoustache");
|
||||
@@ -224,6 +228,7 @@ defineSymbol(math, ams, textord, "\u25bd", "\\triangledown");
|
||||
defineSymbol(math, ams, textord, "\u25ca", "\\lozenge");
|
||||
defineSymbol(math, ams, textord, "\u24c8", "\\circledS");
|
||||
defineSymbol(math, ams, textord, "\u00ae", "\\circledR");
|
||||
defineSymbol(text, ams, textord, "\u00ae", "\\circledR");
|
||||
defineSymbol(math, ams, textord, "\u2221", "\\measuredangle");
|
||||
defineSymbol(math, ams, textord, "\u2204", "\\nexists");
|
||||
defineSymbol(math, ams, textord, "\u2127", "\\mho");
|
||||
@@ -246,6 +251,7 @@ defineSymbol(math, ams, textord, "\u25a1", "\\Box");
|
||||
defineSymbol(math, ams, textord, "\u25ca", "\\Diamond");
|
||||
defineSymbol(math, ams, textord, "\u00a5", "\\yen");
|
||||
defineSymbol(math, ams, textord, "\u2713", "\\checkmark");
|
||||
defineSymbol(text, ams, textord, "\u2713", "\\checkmark");
|
||||
|
||||
// AMS Hebrew
|
||||
defineSymbol(math, ams, textord, "\u2136", "\\beth");
|
||||
@@ -397,10 +403,12 @@ defineSymbol(math, ams, rel, "\u21be", "\\restriction");
|
||||
defineSymbol(math, main, textord, "\u2018", "`");
|
||||
defineSymbol(math, main, textord, "$", "\\$");
|
||||
defineSymbol(text, main, textord, "$", "\\$");
|
||||
defineSymbol(text, main, textord, "$", "\\textdollar");
|
||||
defineSymbol(math, main, textord, "%", "\\%");
|
||||
defineSymbol(text, main, textord, "%", "\\%");
|
||||
defineSymbol(math, main, textord, "_", "\\_");
|
||||
defineSymbol(text, main, textord, "_", "\\_");
|
||||
defineSymbol(text, main, textord, "_", "\\textunderscore");
|
||||
defineSymbol(math, main, textord, "\u2220", "\\angle");
|
||||
defineSymbol(math, main, textord, "\u221e", "\\infty");
|
||||
defineSymbol(math, main, textord, "\u2032", "\\prime");
|
||||
@@ -540,12 +548,16 @@ defineSymbol(math, main, bin, "\u25c3", "\\triangleleft");
|
||||
defineSymbol(math, main, bin, "\u25b9", "\\triangleright");
|
||||
defineSymbol(math, main, open, "{", "\\{");
|
||||
defineSymbol(text, main, textord, "{", "\\{");
|
||||
defineSymbol(text, main, textord, "{", "\\textbraceleft");
|
||||
defineSymbol(math, main, close, "}", "\\}");
|
||||
defineSymbol(text, main, textord, "}", "\\}");
|
||||
defineSymbol(text, main, textord, "}", "\\textbraceright");
|
||||
defineSymbol(math, main, open, "{", "\\lbrace");
|
||||
defineSymbol(math, main, close, "}", "\\rbrace");
|
||||
defineSymbol(math, main, open, "[", "\\lbrack");
|
||||
defineSymbol(math, main, close, "]", "\\rbrack");
|
||||
defineSymbol(text, main, textord, "<", "\\textless"); // in T1 fontenc
|
||||
defineSymbol(text, main, textord, ">", "\\textgreater"); // in T1 fontenc
|
||||
defineSymbol(math, main, open, "\u230a", "\\lfloor");
|
||||
defineSymbol(math, main, close, "\u230b", "\\rfloor");
|
||||
defineSymbol(math, main, open, "\u2308", "\\lceil");
|
||||
@@ -553,8 +565,10 @@ defineSymbol(math, main, close, "\u2309", "\\rceil");
|
||||
defineSymbol(math, main, textord, "\\", "\\backslash");
|
||||
defineSymbol(math, main, textord, "\u2223", "|");
|
||||
defineSymbol(math, main, textord, "\u2223", "\\vert");
|
||||
defineSymbol(text, main, textord, "|", "\\textbar"); // in T1 fontenc
|
||||
defineSymbol(math, main, textord, "\u2225", "\\|");
|
||||
defineSymbol(math, main, textord, "\u2225", "\\Vert");
|
||||
defineSymbol(text, main, textord, "\u2225", "\\textbardbl");
|
||||
defineSymbol(math, main, rel, "\u2191", "\\uparrow");
|
||||
defineSymbol(math, main, rel, "\u21d1", "\\Uparrow");
|
||||
defineSymbol(math, main, rel, "\u2193", "\\downarrow");
|
||||
@@ -600,14 +614,25 @@ defineSymbol(math, main, mathord, "\u0131", "\\imath");
|
||||
defineSymbol(math, main, mathord, "\u0237", "\\jmath");
|
||||
|
||||
defineSymbol(text, main, textord, "\u2013", "--");
|
||||
defineSymbol(text, main, textord, "\u2013", "\\textendash");
|
||||
defineSymbol(text, main, textord, "\u2014", "---");
|
||||
defineSymbol(text, main, textord, "\u2014", "\\textemdash");
|
||||
defineSymbol(text, main, textord, "\u2018", "`");
|
||||
defineSymbol(text, main, textord, "\u2018", "\\textquoteleft");
|
||||
defineSymbol(text, main, textord, "\u2019", "'");
|
||||
defineSymbol(text, main, textord, "\u2019", "\\textquoteright");
|
||||
defineSymbol(text, main, textord, "\u201c", "``");
|
||||
defineSymbol(text, main, textord, "\u201c", "\\textquotedblleft");
|
||||
defineSymbol(text, main, textord, "\u201d", "''");
|
||||
defineSymbol(text, main, textord, "\u201d", "\\textquotedblright");
|
||||
defineSymbol(math, main, textord, "\u00b0", "\\degree");
|
||||
defineSymbol(text, main, textord, "\u00b0", "\\degree");
|
||||
// TODO: In LaTeX, \pounds can generate a different character in text and math
|
||||
// mode, but among our fonts, only Main-Italic defines this character "163".
|
||||
defineSymbol(math, main, mathord, "\u00a3", "\\pounds");
|
||||
defineSymbol(math, main, mathord, "\u00a3", "\\mathsterling");
|
||||
defineSymbol(text, main, mathord, "\u00a3", "\\pounds");
|
||||
defineSymbol(text, main, mathord, "\u00a3", "\\textsterling");
|
||||
defineSymbol(math, ams, textord, "\u2720", "\\maltese");
|
||||
defineSymbol(text, ams, textord, "\u2720", "\\maltese");
|
||||
|
||||
@@ -625,7 +650,7 @@ for (let i = 0; i < mathTextSymbols.length; i++) {
|
||||
}
|
||||
|
||||
// All of these are textords in text mode
|
||||
const textSymbols = "0123456789!@*()-=+[]\";:?/.,";
|
||||
const textSymbols = "0123456789!@*()-=+[]<>|\";:?/.,";
|
||||
for (let i = 0; i < textSymbols.length; i++) {
|
||||
const ch = textSymbols.charAt(i);
|
||||
defineSymbol(text, main, textord, ch, ch);
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 8.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -168,7 +168,7 @@ SupSubLeftAlignReset: |
|
||||
SupSubOffsets: \displaystyle \int_{2+3}x f^{2+3}+3\lim_{2+3+4+5}f
|
||||
Symbols1: |
|
||||
\maltese\degree\pounds\$
|
||||
\text{\maltese\degree}
|
||||
\text{\maltese\degree\pounds\textdollar}
|
||||
Text: \frac{a}{b}\text{c~ {ab} \ e}+fg
|
||||
Unicode: \begin{matrix}\text{ÀàÇçÉéÏïÖöÛû} \\ \text{БГДЖЗЙЛФЦШЫЮЯ} \\ \text{여보세요} \\ \text{私はバナナです} \end{matrix}
|
||||
UnsupportedCmds:
|
||||
|
Reference in New Issue
Block a user