|
89 | 89 | $$
|
90 | 90 | \\begin{equation*}
|
91 | 91 | \\mathbf{V}_1 \\times \\mathbf{V}_2 = \\begin{vmatrix}
|
92 |
| -\\mathbf{i} & \\mathbf{j} & \\mathbf{k} \\ |
93 |
| -\\frac{\partial X}{\\partial u} & \\frac{\\partial Y}{\\partial u} & 0 \\\\ |
94 |
| -\\frac{\partial X}{\\partial v} & \\frac{\\partial Y}{\\partial v} & 0 |
| 92 | +\\mathbf{i} & \\mathbf{j} & \\mathbf{k} \\\\ |
| 93 | +\\frac{\\partial X}{\\partial u} & \\frac{\\partial Y}{\\partial u} & 0 \\\\ |
| 94 | +\\frac{\\partial X}{\\partial v} & \\frac{\\partial Y}{\\partial v} & 0 |
95 | 95 | \\end{vmatrix}
|
96 | 96 | \\end{equation*}
|
97 | 97 | $$
|
|
116 | 116 | This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a [Markdown-formatted](https://daringfireball.net/projects/markdown/) sentence.
|
117 | 117 | `;
|
118 | 118 |
|
| 119 | + const markdown6 = `$$ |
| 120 | +\\begin{aligned} |
| 121 | +\\frac{\\partial}{\\partial\\omega_j}C(\\omega) &= \\frac1m\\sum_{i=1}^m\\varphi_j\\left(x^i\\right)\\left(\\varphi^T\\left(x^i\\right)\\omega-t^i\\right) |
| 122 | += 0 |
| 123 | +\\end{aligned} |
| 124 | +$$ |
| 125 | +$$ |
| 126 | +\\begin{pmatrix} |
| 127 | +\\varphi_j\\left(x^1\\right) & \\dots & \\varphi_j\\left(x^m\\right) |
| 128 | +\\end{pmatrix} |
| 129 | +\\begin{pmatrix} |
| 130 | +\\varphi_1\\left(x^1\\right) & \\dots & \\varphi_n\\left(x^1\\right)\\\\ |
| 131 | +\\vdots & \\ddots & \\vdots\\\\ |
| 132 | +\\varphi_1\\left(x^m\\right) & \\dots & \\varphi_n\\left(x^m\\right) |
| 133 | +\\end{pmatrix} |
| 134 | +\\begin{pmatrix} |
| 135 | +\\omega_1\\\\ |
| 136 | +\\vdots\\\\ |
| 137 | +\\omega_n |
| 138 | +\\end{pmatrix} |
| 139 | += |
| 140 | +\\begin{pmatrix} |
| 141 | +\\varphi_j\\left(x^1\\right) & \\dots & \\varphi_j\\left(x^m\\right) |
| 142 | +\\end{pmatrix} |
| 143 | +\\begin{pmatrix} |
| 144 | +t^1\\\\ |
| 145 | +\\vdots\\\\ |
| 146 | +t^m |
| 147 | +\\end{pmatrix} |
| 148 | +$$ |
| 149 | +
|
| 150 | +Assuming that $T = (t^1, t^2, ..., t^m)^T$,$X = \\left(\\varphi(x^1), \\varphi(x^2), ..., \\varphi(x^m)\\right)^T$, then |
| 151 | +$$ |
| 152 | +X^TX\\omega = X^TT |
| 153 | +$$`; |
| 154 | + |
119 | 155 | test("Latex - Equations don't have $$", () => {
|
120 | 156 | const result = fixLatexEquations(markdown1);
|
121 | 157 | expect(result).to.be.equal(output1, 'Result is incorrect');
|
@@ -153,4 +189,9 @@ This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in
|
153 | 189 | const result = fixLatexEquations(markdown5);
|
154 | 190 | expect(result).to.be.equal(output5, 'Result is incorrect');
|
155 | 191 | });
|
| 192 | + |
| 193 | + test('Latex - Multiple /begins inside $$', () => { |
| 194 | + const result = fixLatexEquations(markdown6); |
| 195 | + expect(result).to.be.equal(markdown6, 'Result should not have changed'); |
| 196 | + }); |
156 | 197 | });
|
0 commit comments