markdown-it-texmath Tests

i valid src render comment
0 😊 $a$

aa

single character inline equation.
1 😊 $\varphi$

φ\varphi

inline equation with single greek character
2 😊 $1+1=2$

1+1=21+1=2

simple equation starting and ending with numbers.
3 😊 $1+1<3$

1+1<31+1<3

simple equation including special html character.
4 😊 $a \backslash$

a\a \backslash

equation including backslashes.
5 😊 You get 3$ if you solve $1+2$

You get 3$ if you solve 1+21+2

use of currency symbol
6 😊 If you solve $1+2$ you get $3

If you solve 1+21+2 you get $3

use of currency symbol
7 😊 $\frac{1}{2}$

12\frac{1}{2}

inline fraction
8 😊 $\begin{pmatrix}x\\y\end{pmatrix}$

(xy)\begin{pmatrix}x\\y\end{pmatrix}

inline column vector
9 😊 ${\tilde\bold e}_\alpha$

e~α{\tilde\bold e}_\alpha

inline bold vector notation
10 😊 $a^{b}$

aba^{b}

exponentiation
11 😊 $a^*b$ with $a^*$

aba^*b with aa^*

conjugate complex
12 😊 $$e_\alpha$$
eαe_\alpha
single block equation, greek index
13 😊 $$1+1=2$$
1+1=21+1=2
display equation on its own single line.
14 😊 ${e}_x$ $$e_\alpha$$

ex{e}_x

eαe_\alpha
inline equation followed by block equation.
15 😊 $$c{\bold e}_x = a{\bold e}_\alpha - b\tilde{\bold e}_\alpha$$
cex=aeαbe~αc{\bold e}_x = a{\bold e}_\alpha - b\tilde{\bold e}_\alpha
underline tests
16 😊 a$1+1=2$ $1+1=2$b c$x$d

a1+1=21+1=2 1+1=21+1=2b cxxd

non-numeric character before opening $ or after closing $ or both is allowed.
17 😊 $x$ $

xx $

following dollar character '$' is allowed.
18 😊 $x$ $y$

xx yy

consecutive inline equations.
19 😊 so-what is $x$

so-what is xx

inline equation after '-' sign in text.
20 😊 $$ 1+1=2 $$
1+1=2 1+1=2
display equation with line breaks.
21 😊 $$\begin{matrix} f & = & 2 + x + 3 \\ & = & 5 + x \end{matrix}$$
f=2+x+3=5+x\begin{matrix} f & = & 2 + x + 3 \\ & = & 5 + x \end{matrix}
multiline equation.
22 😊 $$\begin{pmatrix}x_2 \\ y_2 \end{pmatrix} = \begin{pmatrix} A & B \\ C & D \end{pmatrix}\cdot \begin{pmatrix} x_1 \\ y_1 \end{pmatrix}$$
(x2y2)=(ABCD)(x1y1)\begin{pmatrix}x_2 \\ y_2 \end{pmatrix} = \begin{pmatrix} A & B \\ C & D \end{pmatrix}\cdot \begin{pmatrix} x_1 \\ y_1 \end{pmatrix}
vector equation.
23 😊 $$f(x) = x^2 - 1$$ (1)
f(x)=x21f(x) = x^2 - 1(1)
display equation with equation number.
24 😊 `code`$a-b$

codeaba-b

inline equation following code section.
25 😊 ``` code ``` $$a+b$$
code
a+ba+b
equation following code block.
26 😊 ``` code ``` $$a+b$$(1)
code
a+ba+b(1)
numbered equation following code block.
27 😊 1. $1+2$ 2. $2+3$ 1. $3+4$
  1. 1+21+2
  2. 2+32+3
    1. 3+43+4
Equations in list.
28 😊 $\sum_{i=1}^n$

i=1n\sum_{i=1}^n

Inline sum.
29 😊 $$\sum_{i=1}^n$$
i=1n\sum_{i=1}^n
Sum without equation number.
30 😊 $$\sum_{i=1}^n$$ (2)
i=1n\sum_{i=1}^n(2)
Sum with equation number.
31 😊 $${\bold e}(\varphi) = \begin{pmatrix} \cos\varphi\\\sin\varphi \end{pmatrix}$$ (3)
e(φ)=(cosφsinφ){\bold e}(\varphi) = \begin{pmatrix} \cos\varphi\\\sin\varphi \end{pmatrix}(3)
equation number always vertically aligned.
32 😊 > see $a = b + c$ > $c^2=a^2+b^2$ (2) > $c^2=a^2+b^2$

see a=b+ca = b + c c2=a2+b2c^2=a^2+b^2 (2) c2=a2+b2c^2=a^2+b^2

inline equations in blockquote.
33 😊 > formula > > $$ a+b=c$$ (2) > > in blockquote.

formula

a+b=c a+b=c(2)

in blockquote.

display equation in blockquote.
34 😊 \$1+1=2$ $1+1=2\$

$1+1=2$ $1+1=2$

escaped dollars '\$' are interpreted as dollar '$' characters.
35 😡 some text $\$a+b=c$$

some text $$a+b=c$$

empty line between text and display formula is required.
36 😡 $ $ $ x$ $x $

$ $ $ x$ $x $

whitespace character after opening $ or before closing $ is not allowed.
37 😡 $1+1= 2$

$1+1= 2$

line break in inline equation is not allowed.