From 50c024034960c479d0f05d50e158ec247ec6d871 Mon Sep 17 00:00:00 2001 From: Ron Kok Date: Tue, 7 Aug 2018 15:49:38 -0700 Subject: [PATCH] Support mediawiki (#1558) * Support mediawiki * Fix lint error * Fix link to deprecated syntax * Change In master to display of functions --- docs/support_table.md | 141 +++++++++++++++++++++--------------------- docs/supported.md | 4 +- src/macros.js | 74 ++++++++++++++++++++++ test/katex-spec.js | 14 +++++ 4 files changed, 161 insertions(+), 72 deletions(-) diff --git a/docs/support_table.md b/docs/support_table.md index 6a5d1945..fbe5c423 100644 --- a/docs/support_table.md +++ b/docs/support_table.md @@ -69,19 +69,20 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\acute|$\acute e$|`\acute e`| |\AE|$\text{\AE}$|`\text{\AE}`| |\ae|$\text{\ae}$|`\text{\ae}`| -|\alef|Not supported|see `\aleph`| +|\alef|$\alef$|| +|\alefsym|$\alefsym$|| |\aleph|$\aleph$|| |{align}|Not supported|see `{aligned}`| |{aligned}|$\begin{aligned}a&=b+c\\d+e&=f\end{aligned}$|`\begin{aligned}`
   `a&=b+c \\`
   `d+e&=f`
`\end{aligned}`| |{alignat}|Not supported|see `{alignedat}`| |{alignedat}|$\begin{alignedat}{2}10&x+&3&y=2\\3&x+&13&y=4\end{alignedat}$|`\begin{alignedat}{2}`
   `10&x+ &3&y = 2 \\`
   ` 3&x+&13&y = 4`
`\end{alignedat}`| |\allowbreak||| -|\Alpha|Not supported|| +|\Alpha|$\Alpha$|| |\alpha|$\alpha$|| |\amalg|$\amalg$|| |\And|$\And$|| -|\and|Not supported|| -|\ang|Not supported|| +|\and|Not supported|[Deprecated](https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax)| +|\ang|Not supported|[Deprecated](https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax)| |\angl|Not supported|| |\angle|$\angle$|| |\approx|$\approx$|| @@ -120,7 +121,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\because|$\because$|| |\begin|$\begin{matrix} a & b\\ c & d\end{matrix}$|`\begin{matrix}`
   `a & b \\`
   `c & d`
`\end{matrix}`| |\begingroup|$\begingroup a}$|`\begingroup a}`| -|\Beta|Not supported|| +|\Beta|$\Beta$|| |\beta|$\beta$|| |\beth|$\beth$|| |\between|$\between$|| @@ -183,7 +184,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\brack||In master| |\breve|$\breve{eu}$|`\breve{eu}`| |\buildrel|Not supported|| -|\bull|Not supported|See `\bullet`| +|\bull|$\bull$|| |\bullet|$\bullet$|| |\Bumpeq|$\Bumpeq$|| |\bumpeq|$\bumpeq$|| @@ -192,7 +193,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |Symbol/Function | Rendered | Source or Comment| |:---------------|:------------|:-----------------| -|\C|Not supported|See `\Bbb{C}`| +|\C|Not supported|[Deprecated](https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax)| |\cal|Not supported|See `\mathcal` |\cancel|$\cancel{5}$|`\cancel{5}`| |\cancelto|Not supported|| @@ -212,7 +213,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\check|$\check{oe}$|`\check{oe}`| |\ch|$\ch$|| |\checkmark|$\checkmark$|| -|\Chi|Not supported|| +|\Chi|$\Chi$|| |\chi|$\chi$|| |\choose|${n+1 \choose k+2}$|`{n+1 \choose k+2}`| |\circ|$\circ$|| @@ -226,9 +227,9 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\circledS|$\circledS$|| |\class|Not supported|A PR is pending. |\cline|Not supported|[Issue #269](https://github.com/Khan/KaTeX/issues/269)| -|\clubs|Not supported|| +|\clubs|$\clubs$|| |\clubsuit|$\clubsuit$|| -|\cnums|Not supported|| +|\cnums|$\cnums$|| |\colon|$\colon$|| |\Colonapprox|$\Colonapprox$|| |\colonapprox|$\colonapprox$|| @@ -241,7 +242,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\color|$\color{#0000FF} AaBb123$|`\color{#0000FF} AaBb123`| |\colorbox|$\colorbox{red}{Black on red}$|`\colorbox{red}{Black on red}`| |\complement|$\complement$|| -|\Complex|Not supported|| +|\Complex|$\Complex$|| |\cong|$\cong$|| |\Coppa|Not supported|| |\coppa|Not supported|| @@ -272,12 +273,12 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |Symbol/Function | Rendered | Source or Comment| |:---------------|:------------|:-----------------| |\dag|$\dag$|| -|\Dagger|Not supported|| +|\Dagger|$\Dagger$|| |\dagger|$\dagger$|| |\daleth|$\daleth$|| -|\Darr|Not supported|See `\Downarrow`| -|\dArr|Not supported|| -|\darr|Not supported|See `\downarrow`| +|\Darr|$\Darr$|| +|\dArr|$\dArr$|| +|\darr|$\darr$|| {darray}|$\begin{darray}{cc}a&b\\c&d\end{darray}$ | `\begin{darray}{cc}`
   `a & b \\`
   `c & d`
`\end{darray}`| |\dashleftarrow|$\dashleftarrow$|| |\dashrightarrow|$\dashrightarrow$|| @@ -306,7 +307,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\diagup|$\diagup$|| |\Diamond|$\Diamond$|| |\diamond|$\diamond$|| -|\diamonds|Not supported|| +|\diamonds|$\diamonds$|| |\diamondsuit|$\diamondsuit$|| |\dim|$\dim$|| |\displaylines|Not supported|| @@ -339,13 +340,13 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |:---------------|:------------|:-----------------| |\ell|$\ell$|| |\else|Not supported|[Issue #1003](https://github.com/Khan/KaTeX/issues/1003)| -|\empty|Not supported|| +|\empty|$\empty$|| |\emptyset|$\emptyset$|| |\enclose|Not supported|Non standard |\end|$\begin{matrix} a & b\\ c & d\end{matrix}$|`\begin{matrix}`
   `a & b \\`
   `c & d`
`\end{matrix}`| |\endgroup|${a\endgroup$|`{a\endgroup`| |\enspace|$a\enspace b$|`a\enspace b`| -|\Epsilon|Not supported|| +|\Epsilon|$\Epsilon$|| |\epsilon|$\epsilon$|| |\eqalign|Not supported|| |\eqalignno|Not supported|| @@ -361,11 +362,11 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\eqslantgtr|$\eqslantgtr$|| |\eqslantless|$\eqslantless$|| |\equiv|$\equiv$|| -|\Eta|Not supported|| +|\Eta|$\Eta$|| |\eta|$\eta$|| |\eth|$\eth$|| |\euro|Not supported|| -|\exist|Not supported|See `\exists`| +|\exist|$\exist$|| |\exists|$\exists$|| |\exp|$\exp$|| @@ -429,14 +430,14 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |Symbol/Function | Rendered | Source or Comment| |:---------------|:------------|:-----------------| |\H|$\text{\H{a}}$|`\text{\H{a}}`| -|\Harr|Not supported|| -|\hArr|Not supported|| -|\harr|Not supported|| +|\Harr|$\Harr$|| +|\hArr|$\hArr$|| +|\harr|$\harr$|| |\hat|$\hat{\theta}$|`\hat{\theta}`| |\hbar|$\hbar$|| |\hbox|Not supported|| |\hdashline|$\begin{matrix}a&b\\ \hdashline c &d\end{matrix}$|`\begin{matrix}`
   `a & b \\`
   `\hdashline`
   `c & d`
`\end{matrix}`| -|\hearts|Not supported|| +|\hearts|$\hearts$|| |\heartsuit|$\heartsuit$|| |\hfil|Not supported|| |\hfill|Not supported|Issues [#164](https://github.com/Khan/KaTeX/issues/164) & [#269](https://github.com/Khan/KaTeX/issues/269)| @@ -467,22 +468,22 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\iiint|$\iiint$|| |\iint|$\iint$|| |\Im|$\Im$|| -|\image|Not supported|| +|\image|$\image$|| |\imath|$\imath$|| |\impliedby|$P\impliedby Q$|`P\impliedby Q`| |\implies|$P\implies Q$|`P\implies Q`| |\in|$\in$|| |\includegraphics|Not supported|[Issue #898](https://github.com/Khan/KaTeX/issues/898)| |\inf|$\inf$|| -|\infin|Not supported|| +|\infin|$\infin$|| |\infty|$\infty$|| |\injlim|Not supported|| |\int|$\int$|| |\intercal|$\intercal$|| |\intop|$\intop$|| -|\Iota|Not supported|| +|\Iota|$\Iota$|| |\iota|$\iota$|| -|\isin|Not supported|| +|\isin|$\isin$|| |\it|${\it AaBb}$|`{\it AaBb}`| ## JK @@ -492,15 +493,13 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\j|$\text{\j}$|`\text{\j}`| |\jmath|$\jmath$|| |\Join|$\Join$|| -|\Kappa|Not supported|| +|\Kappa|$\Kappa$|| |\kappa|$\kappa$|| |\KaTeX|$\KaTeX$|| |\ker|$\ker$|| |\kern|$I\kern-2.5pt R$|`I\kern-2.5pt R`| |\Koppa|Not supported|| |\koppa|Not supported|| -|\label|Not supported|| -|\lang|Not supported|See `\langle`| ## L @@ -510,11 +509,13 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\l|Not supported|| |\Lambda|$\Lambda$|| |\lambda|$\lambda$|| +|\label|Not supported|| |\land|$\land$|| +|\lang|$\lang A\rangle$|`\lang A\rangle`| |\langle|$\langle$|| -|\Larr|Not supported|| -|\lArr|Not supported|| -|\larr|Not supported|| +|\Larr|$\Larr$|| +|\lArr|$\lArr$|| +|\larr|$\larr$|| |\large|$\large large$|`\large large`| |\Large|$\Large Large$|`\Large Large`| |\LARGE|$\LARGE LARGE$|`\LARGE LARGE`| @@ -586,9 +587,9 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\lor|$\lor$|| |\lower|Not supported|| |\lozenge|$\lozenge$|| -|\Lrarr|Not supported|| -|\lrArr|Not supported|| -|\lrarr|Not supported|| +|\Lrarr|$\Lrarr$|| +|\lrArr|$\lrArr$|| +|\lrarr|$\lrarr$|| |\lrcorner|$\lrcorner$|| |\lq|$\lq$|| |\Lsh|$\Lsh$|| @@ -637,7 +638,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\measuredangle|$\measuredangle$|| |\medspace|$a\medspace b$|`a\medspace b`| |\mho|$\mho$|| -|\mid|$\mid$|| +|\mid|$\{x∈ℝ\mid x>0\}$|`\{x∈ℝ\mid x>0\}`| |\middle|$P\left(A\middle\vert B\right)$|`P\left(A\middle\vert B\right)`| |\min|$\min$|| |\mit|Not supported|See `\mathit`| @@ -650,7 +651,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\mp|$\mp$|| |\mskip|$a\mskip{10mu}b$|`a\mskip{10mu}b`| |\mspace|Not supported|| -|\Mu|Not supported|| +|\Mu|$\Mu$|| |\mu|$\mu$|| |\multicolumn|Not supported|[Issue #269](https://github.com/Khan/KaTeX/issues/269)| |{multiline}|Not supported|| @@ -660,9 +661,9 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |Symbol/Function | Rendered | Source or Comment| |:---------------|:------------|:-----------------| -|\N|Not supported|See `\Bbb{N}`| +|\N|$\N$|| |\nabla|$\nabla$|| -|\natnums|Not supported|| +|\natnums|$\natnums$|| |\natural|$\natural$|| |\negmedspace|$a\negmedspace b$|`a\negmedspace b`| |\ncong|$\ncong$|| @@ -717,7 +718,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\ntrianglelefteq|$\ntrianglelefteq$|| |\ntriangleright|$\ntriangleright$|| |\ntrianglerighteq|$\ntrianglerighteq$|| -|\Nu|Not supported|| +|\Nu|$\Nu$|| |\nu|$\nu$|| |\nVDash|$\nVDash$|| |\nVdash|$\nVdash$|| @@ -741,7 +742,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\oldstyle|Not supported|| |\omega|$\omega$|| |\Omega|$\Omega$|| -|\Omicron|Not supported|| +|\Omicron|$\Omicron$|| |\omicron|$\omicron$|| |\ominus|$\ominus$|| |\operatorname|$\operatorname{asin} x$|\operatorname{asin} x| @@ -772,7 +773,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |Symbol/Function | Rendered | Source or Comment| |:---------------|:------------|:-----------------| |\P|$\text{\P}$|`\text{\P}`| -|\pagecolor|Not supported|| +|\pagecolor|Not supported|[Deprecated](https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax)| |\parallel|$\parallel$|| |\part|Not supported|| |\partial|$\partial$|| @@ -785,7 +786,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\pi|$\pi$|| |{picture}|Not supported|| |\pitchfork|$\pitchfork$|| -|\plusmn|Not supported|| +|\plusmn|$\plusmn$|| |\pm|$\pm$|| |\pmatrix|Not supported|See `{pmatrix}`| |{pmatrix}|$\begin{pmatrix}a&b\\c&d\end{pmatrix}$|`\begin{pmatrix}`
   `a & b \\`
   `c & d`
`\end{pmatrix}` @@ -818,32 +819,32 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\Q|Not supported|See `\Bbb{Q}`| |\qquad|$a\qquad\qquad{b}$|`a\qquad\qquad{b}`| |\quad|$a\quad\quad{b}$|`a\quad\quad{b}`| -|\R|Not supported|See `\Bbb{R}`| +|\R|$\R$|| |\r|$\text{\r{a}}$|`\text{\r{a}}`| |\raise|Not supported|see `\raisebox`| |\raisebox|$h\raisebox{2pt}{ighe}r$|`h\raisebox{2pt}{ighe}r`| -|\rang|Not supported|see `\rangle`| +|\rang|$\angle A\rang$|`\angle A\rang`| |\rangle|$\rangle$|| -|\Rarr|Not supported|| -|\rArr|Not supported|| -|\rarr|Not supported|| +|\Rarr|$\Rarr$|| +|\rArr|$\rArr$|| +|\rarr|$\rarr$|| |\rbrace|$\rbrace$|| |\rbrack|$\rbrack$|| |\rceil|$\rceil$|| |\Re|$\Re$|| -|\real|Not supported|| -|\Reals|Not supported|| -|\reals|Not supported|| +|\real|$\real$|| +|\Reals|$\Reals$|| +|\reals|$\reals$|| |\ref|Not supported|[Issue #350](https://github.com/Khan/KaTeX/issues/350)| |\relax||| -|\renewcommand|$\def\hail{Hi!}\renewcommand\hail{\text{Ahoy!}} \hail$|`\def\hail{Hi!}`
`\renewcommand\hail{\text{Ahoy!}} \hail`| +|\renewcommand|$\def\hail{Hi!}\renewcommand\hail{\text{Ahoy!}} \hail$|`\def\hail{Hi!}`
`\renewcommand\hail{\text{Ahoy!}}`
`\hail`| |\renewenvironment|Not supported|| |\require|Not supported|| |\restriction|$\restriction$|| |\rfloor|$\rfloor$|| |\rgroup|$\rgroup$|| |\rhd|$\rhd$|| -|\Rho|Not supported|| +|\Rho|$\Rho$|| |\rho|$\rho$|| |\right|$\left.\dfrac a b\right)$|`\left.\dfrac a b\right)`| |\Rightarrow|$\Rightarrow$|| @@ -883,10 +884,10 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\scriptscriptstyle|$\scriptscriptstyle \frac cd$|`\scriptscriptstyle \frac cd`| |\scriptsize|$\scriptsize scriptsize$|`\scriptsize scriptsize`| |\scriptstyle|$\frac ab + {\scriptstyle \frac cd}$|`\frac ab + {\scriptstyle \frac cd}`| -|\sdot|Not supported|| +|\sdot|$\sdot$|| |\searrow|$\searrow$|| |\sec|$\sec$|| -|\sect|Not supported|| +|\sect|$\text{\sect}$|`\text{\sect}`| |\setlength|Not supported|[Issue #687](https://github.com/Khan/KaTeX/issues/687)| |\setminus|$\setminus$|| |\sf|$\sf AaBb123$|`\sf AaBb123`| @@ -918,7 +919,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\sout|$\sout{abc}$|`\sout{abc}`| |\Space|Not supported|see `\space` |\space|$a\space{b}$|`a\space{b}`| -|\spades|Not supported|| +|\spades|$\spades$|| |\spadesuit|$\spadesuit$|| |\sphericalangle|$\sphericalangle$|| |{split}|Not supported|[Issue #1345](https://github.com/Khan/KaTeX/issues/1345)| @@ -937,9 +938,9 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\stigma|Not supported|| |\strut|Not supported|| |\style|Not supported|Non standard| -|\SUB|Not supported|| +|\sub|$\sub$|| |{subarray}|Not supported|| -|\sube|Not supported|| +|\sube|$\sube$|| |\Subset|$\Subset$|| |\subset|$\subset$|| |\subseteq|$\subseteq$|| @@ -957,7 +958,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\succsim|$\succsim$|| |\sum|$\sum$|| |\sup|$\sup$|| -|\supe|Not supported|| +|\supe|$\supe$|| |\Supset|$\Supset$|| |\supset|$\supset$|| |\supseteq|$\supseteq$|| @@ -975,7 +976,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\tag*|$$\tag*{3.1c} a^2+b^2=c^2$$|`\tag*{3.1c} a^2+b^2=c^2`| |\tan|$\tan$|| |\tanh|$\tanh$|| -|\Tau|Not supported|| +|\Tau|$\Tau$|| |\tau|$\tau$|| |\tbinom|$\tbinom n k$|`\tbinom n k`| |\TeX|$\TeX$|| @@ -1019,7 +1020,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\therefore|$\therefore$|| |\Theta|$\Theta$|| |\theta|$\theta$|| -|\thetasym|Not supported|| +|\thetasym|$\thetasym$|| |\thickapprox|$\thickapprox$|| |\thicksim|$\thicksim$|| |\thickspace|$a\thickspace b$|`a\thickspace b`| @@ -1047,9 +1048,9 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |Symbol/Function | Rendered | Source or Comment| |:---------------|:------------|:-----------------| |\u|$\text{\u{a}}$|`\text{\u{a}}`| -|\Uarr|Not supported|| -|\uArr|Not supported|| -|\uarr|Not supported|| +|\Uarr|$\Uarr$|| +|\uArr|$\uArr$|| +|\uarr|$\uarr$|| |\ulcorner|$\ulcorner$|| |\underbrace|$\underbrace{x+⋯+x}_{n\text{ times}}$|`\underbrace{x+⋯+x}_{n\text{ times}}`| |\underbracket|Not supported|| @@ -1077,7 +1078,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |\upsilon|$\upsilon$|| |\upuparrows|$\upuparrows$|| |\urcorner|$\urcorner$|| -|\url||In master| +|\url|$\url{https://khan.github.io/KaTeX/}$|`\url{https://khan.github.io/KaTeX/}`| |\utilde|$\utilde{AB}$|`\utilde{AB}`| ## V @@ -1144,7 +1145,7 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |Symbol/Function | Rendered | Source or Comment| |:---------------|:------------|:-----------------| |\wedge|$\wedge$|| -|\weierp|Not supported|See `\wp`| +|\weierp|$\weierp$|| |\widecheck|$\widecheck{AB}$|`\widecheck{AB}`| |\widehat|$\widehat{AB}$|`\widehat{AB}`| |\wideparen|Not supported|[Issue #560](https://github.com/Khan/KaTeX/issues/560)| @@ -1184,6 +1185,6 @@ If you know the shape of a character, but not its name, [Detexify](http://detexi |Symbol/Function | Rendered | Source or Comment| |:---------------|:------------|:-----------------| |\yen|$\yen$|| -|\Z|Not supported|See `\Bbb{Z}`| -|\Zeta|Not supported|| +|\Z|$\Z$|| +|\Zeta|$\Zeta$|| |\zeta|$\zeta$|| diff --git a/docs/supported.md b/docs/supported.md index ed380ead..c7b0a69c 100644 --- a/docs/supported.md +++ b/docs/supported.md @@ -3,7 +3,7 @@ id: supported title: Supported Functions ---