mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 03:38:39 +00:00
committed by
Kevin Barabash
parent
0b7b4db7fc
commit
4dd0e2cdca
@@ -44,6 +44,7 @@ table td {
|
||||
|<|$<$||
|
||||
|\\=|$\text{\={a}}$|<code>\text{\\={a}}</code>|
|
||||
| >|$>$||
|
||||
|\\>|$a\>\>{b}$|`a\>\>{b}`|
|
||||
|\[|$[$||
|
||||
|\]|$]$||
|
||||
|{|${a}$|`{a}`|
|
||||
|
@@ -233,17 +233,18 @@ KaTeX also supports `\llap`, `\rlap`, and `\clap`, but they will take only text,
|
||||
|:----------------|:-------------------|:---------------------|:--------------------------------------|
|
||||
| `\,` | ³∕₁₈ em space | `\kern{distance}` | space, width = *distance*
|
||||
| `\thinspace` | ³∕₁₈ em space | `\mkern{distance}` | space, width = *distance*
|
||||
| `\:` | ⁴∕₁₈ em space | `\mskip{distance}` | space, width = *distance*
|
||||
| `\medspace` | ⁴∕₁₈ em space | `\hskip{distance}` | space, width = *distance*
|
||||
| `\;` | ⁵∕₁₈ em space | `\hspace{distance}` | space, width = *distance*
|
||||
| `\thickspace` | ⁵∕₁₈ em space | `\hspace*{distance}` | space, width = *distance*
|
||||
| `\enspace` | ½ em space | `\phantom{content}` | space the width and height of content
|
||||
| `\quad` | 1 em space | `\hphantom{content}` | space the width of content
|
||||
| `\qquad` | 2 em space | `\vphantom{content}` | a strut the height of content
|
||||
| `~` | non-breaking space | `\!` | – ³∕₁₈ em space
|
||||
| `\<space>` | space | `\negthinspace` | – ³∕₁₈ em space
|
||||
| `\nobreakspace` | non-breaking space | `\negmedspace` | – ⁴∕₁₈ em space
|
||||
| `\space` | space | `\negthickspace` | – ⁵∕₁₈ em space
|
||||
| `\>` | ⁴∕₁₈ em space | `\mskip{distance}` | space, width = *distance*
|
||||
| `\:` | ⁴∕₁₈ em space | `\hskip{distance}` | space, width = *distance*
|
||||
| `\medspace` | ⁴∕₁₈ em space | `\hspace{distance}` | space, width = *distance*
|
||||
| `\;` | ⁵∕₁₈ em space | `\hspace*{distance}` | space, width = *distance*
|
||||
| `\thickspace` | ⁵∕₁₈ em space | `\phantom{content}` | space the width and height of content
|
||||
| `\enspace` | ½ em space | `\hphantom{content}` | space the width of content
|
||||
| `\quad` | 1 em space | `\vphantom{content}` | a strut the height of content
|
||||
| `\qquad` | 2 em space | `\!` | – ³∕₁₈ em space
|
||||
| `~` | non-breaking space | `\negthinspace` | – ³∕₁₈ em space
|
||||
| `\<space>` | space | `\negmedspace` | – ⁴∕₁₈ em space
|
||||
| `\nobreakspace` | non-breaking space | `\negthickspace` | – ⁵∕₁₈ em space
|
||||
| `\space` | space |
|
||||
|
||||
</div>
|
||||
|
||||
|
@@ -605,8 +605,10 @@ defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
|
||||
defineMacro("\\,", "\\tmspace+{3mu}{.1667em}");
|
||||
// \let\thinspace\,
|
||||
defineMacro("\\thinspace", "\\,");
|
||||
// \def\>{\mskip\medmuskip}
|
||||
// \renewcommand{\:}{\tmspace+\medmuskip{.2222em}}
|
||||
// TODO: math mode should use \medmuskip = 4mu plus 2mu minus 4mu
|
||||
// TODO: \> and math mode of \: should use \medmuskip = 4mu plus 2mu minus 4mu
|
||||
defineMacro("\\>", "\\mskip{4mu}");
|
||||
defineMacro("\\:", "\\tmspace+{4mu}{.2222em}");
|
||||
// \let\medspace\:
|
||||
defineMacro("\\medspace", "\\:");
|
||||
|
@@ -713,6 +713,9 @@ exports[`A MathML builder special spaces render specially 1`] = `
|
||||
<mtext>
|
||||
 
|
||||
</mtext>
|
||||
<mtext>
|
||||
 
|
||||
</mtext>
|
||||
<mtext>
|
||||
  
|
||||
</mtext>
|
||||
@@ -757,7 +760,7 @@ exports[`A MathML builder special spaces render specially 1`] = `
|
||||
</mtext>
|
||||
</mrow>
|
||||
<annotation encoding="application/x-tex">
|
||||
\\,\\thinspace\\:\\medspace\\;\\thickspace\\!\\negthinspace\\negmedspace\\negthickspace\\mkern1mu\\mkern3mu\\mkern4mu\\mkern5mu\\mkern-1mu\\mkern-3mu\\mkern-4mu\\mkern-5mu
|
||||
\\,\\thinspace\\:\\>\\medspace\\;\\thickspace\\!\\negthinspace\\negmedspace\\negthickspace\\mkern1mu\\mkern3mu\\mkern4mu\\mkern5mu\\mkern-1mu\\mkern-3mu\\mkern-4mu\\mkern-5mu
|
||||
</annotation>
|
||||
</semantics>
|
||||
</math>
|
||||
|
@@ -752,7 +752,7 @@ describe("A text parser", function() {
|
||||
});
|
||||
|
||||
it("should parse spacing functions", function() {
|
||||
expect`a b\, \; \! \: ~ \thinspace \medspace \quad \ `.toBuild();
|
||||
expect`a b\, \; \! \: \> ~ \thinspace \medspace \quad \ `.toBuild();
|
||||
expect`\enspace \thickspace \qquad \space \nobreakspace`.toBuild();
|
||||
});
|
||||
|
||||
|
@@ -109,7 +109,7 @@ describe("A MathML builder", function() {
|
||||
});
|
||||
it('special spaces render specially', function() {
|
||||
expect(getMathML(
|
||||
"\\,\\thinspace\\:\\medspace\\;\\thickspace" +
|
||||
"\\,\\thinspace\\:\\>\\medspace\\;\\thickspace" +
|
||||
"\\!\\negthinspace\\negmedspace\\negthickspace" +
|
||||
"\\mkern1mu\\mkern3mu\\mkern4mu\\mkern5mu" +
|
||||
"\\mkern-1mu\\mkern-3mu\\mkern-4mu\\mkern-5mu")).toMatchSnapshot();
|
||||
|
Reference in New Issue
Block a user