diff --git a/testsuite/tests/input/tex/Ams.test.ts b/testsuite/tests/input/tex/Ams.test.ts index dce2117cb..66c089ce9 100644 --- a/testsuite/tests/input/tex/Ams.test.ts +++ b/testsuite/tests/input/tex/Ams.test.ts @@ -1038,4 +1038,12 @@ describe('Ams symbols', () => { /**********************************************************************************/ +describe('Ams Issues', () => { + it('Array with Tag', () => { + expect(tex2mml('\\begin{array}{c}a \\end{array}\\tag{1}')).toMatchSnapshot(); + }); +}); + +/**********************************************************************************/ + afterAll(() => getTokens('ams')); diff --git a/testsuite/tests/input/tex/SetOptions.test.ts b/testsuite/tests/input/tex/SetOptions.test.ts index a292a8495..d5ec59894 100644 --- a/testsuite/tests/input/tex/SetOptions.test.ts +++ b/testsuite/tests/input/tex/SetOptions.test.ts @@ -54,7 +54,7 @@ describe('Setoptions', () => { ).toMatchSnapshot(); }); - test('Set pacjage regexp option', () => { + test('Set package regexp option', () => { expect( tex2mml( '\\setOptions[ams]{operatornamePattern=/^[a-z0-9]+/} \\operatorname{ab1}' diff --git a/testsuite/tests/input/tex/__snapshots__/Ams.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Ams.test.ts.snap index f76f8eee6..dfd63ceba 100644 --- a/testsuite/tests/input/tex/__snapshots__/Ams.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Ams.test.ts.snap @@ -184,8 +184,8 @@ exports[`Ams Complex A Cross Product Formula 1`] = ` = | - - + + i @@ -202,7 +202,7 @@ exports[`Ams Complex A Cross Product Formula 1`] = ` - + @@ -231,7 +231,7 @@ exports[`Ams Complex A Cross Product Formula 1`] = ` 0 - + @@ -269,7 +269,7 @@ exports[`Ams Complex A Cross Product Formula 1`] = ` exports[`Ams Complex Cubic Binomial 1`] = ` " - + ( x @@ -307,7 +307,7 @@ exports[`Ams Complex Cubic Binomial 1`] = ` - + @@ -370,7 +370,7 @@ exports[`Ams Complex Cubic Binomial 1`] = ` - + @@ -427,7 +427,7 @@ exports[`Ams Complex Cubic Binomial 1`] = ` exports[`Ams Complex Maxwell's Equations 1`] = ` " - + × @@ -486,7 +486,7 @@ exports[`Ams Complex Maxwell's Equations 1`] = ` - + @@ -509,7 +509,7 @@ exports[`Ams Complex Maxwell's Equations 1`] = ` - + × @@ -562,7 +562,7 @@ exports[`Ams Complex Maxwell's Equations 1`] = ` - + @@ -590,7 +590,7 @@ exports[`Ams Complex Maxwell's Equations 1`] = ` exports[`Ams Complex The Lorenz Equations 1`] = ` " - + @@ -612,7 +612,7 @@ exports[`Ams Complex The Lorenz Equations 1`] = ` - + @@ -635,7 +635,7 @@ exports[`Ams Complex The Lorenz Equations 1`] = ` - + @@ -760,7 +760,7 @@ exports[`Ams Display Sub Fraction 1`] = ` exports[`Ams Environments Align 1`] = ` " - + a @@ -772,7 +772,7 @@ exports[`Ams Environments Align 1`] = ` - + c @@ -791,7 +791,7 @@ exports[`Ams Environments Align 1`] = ` exports[`Ams Environments Align Star 1`] = ` " - + a @@ -803,7 +803,7 @@ exports[`Ams Environments Align Star 1`] = ` - + c @@ -822,7 +822,7 @@ exports[`Ams Environments Align Star 1`] = ` exports[`Ams Environments Alignat 1`] = ` " - + a @@ -834,7 +834,7 @@ exports[`Ams Environments Alignat 1`] = ` - + c @@ -853,7 +853,7 @@ exports[`Ams Environments Alignat 1`] = ` exports[`Ams Environments Alignat Star 1`] = ` " - + a @@ -865,7 +865,7 @@ exports[`Ams Environments Alignat Star 1`] = ` - + c @@ -884,7 +884,7 @@ exports[`Ams Environments Alignat Star 1`] = ` exports[`Ams Environments Aligned 1`] = ` " - + a @@ -894,7 +894,7 @@ exports[`Ams Environments Aligned 1`] = ` = b - + r @@ -906,7 +906,7 @@ exports[`Ams Environments Aligned 1`] = ` - + @@ -920,7 +920,7 @@ exports[`Ams Environments Aligned 1`] = ` - + c @@ -939,7 +939,7 @@ exports[`Ams Environments Aligned 1`] = ` exports[`Ams Environments Alignedat 1`] = ` " - + a @@ -949,7 +949,7 @@ exports[`Ams Environments Alignedat 1`] = ` = b - + r @@ -961,7 +961,7 @@ exports[`Ams Environments Alignedat 1`] = ` - + @@ -975,7 +975,7 @@ exports[`Ams Environments Alignedat 1`] = ` - + c @@ -995,8 +995,8 @@ exports[`Ams Environments Bmatrix 1`] = ` " { - - + + a @@ -1004,7 +1004,7 @@ exports[`Ams Environments Bmatrix 1`] = ` b - + c @@ -1021,7 +1021,7 @@ exports[`Ams Environments Bmatrix 1`] = ` exports[`Ams Environments Eqnarray 1`] = ` " - + a @@ -1035,7 +1035,7 @@ exports[`Ams Environments Eqnarray 1`] = ` - + c @@ -1056,7 +1056,7 @@ exports[`Ams Environments Eqnarray 1`] = ` exports[`Ams Environments Eqnarray Star 1`] = ` " - + a @@ -1070,7 +1070,7 @@ exports[`Ams Environments Eqnarray Star 1`] = ` - + c @@ -1103,14 +1103,14 @@ exports[`Ams Environments Equation Star 1`] = ` exports[`Ams Environments Gather 1`] = ` " - + a = b - + c = @@ -1124,14 +1124,14 @@ exports[`Ams Environments Gather 1`] = ` exports[`Ams Environments Gather Star 1`] = ` " - + a = b - + c = @@ -1145,7 +1145,7 @@ exports[`Ams Environments Gather Star 1`] = ` exports[`Ams Environments Gathered 1`] = ` " - + a @@ -1155,14 +1155,14 @@ exports[`Ams Environments Gathered 1`] = ` = b - + r = s - + = t @@ -1172,7 +1172,7 @@ exports[`Ams Environments Gathered 1`] = ` - + c @@ -1191,17 +1191,17 @@ exports[`Ams Environments Gathered 1`] = ` exports[`Ams Environments Multline 1`] = ` " - + a - + b - + c @@ -1213,17 +1213,17 @@ exports[`Ams Environments Multline 1`] = ` exports[`Ams Environments Multline Star 1`] = ` " - + a - + b - + c @@ -1235,8 +1235,8 @@ exports[`Ams Environments Multline Star 1`] = ` exports[`Ams Environments Small Matrix 1`] = ` " - - + + a @@ -1249,7 +1249,7 @@ exports[`Ams Environments Small Matrix 1`] = ` exports[`Ams Environments Split 1`] = ` " - + a @@ -1259,7 +1259,7 @@ exports[`Ams Environments Split 1`] = ` = b - + r @@ -1271,7 +1271,7 @@ exports[`Ams Environments Split 1`] = ` - + @@ -1285,7 +1285,7 @@ exports[`Ams Environments Split 1`] = ` - + c @@ -1304,8 +1304,8 @@ exports[`Ams Environments Split 1`] = ` exports[`Ams Environments Subarray 1`] = ` " - - + + a @@ -1319,8 +1319,8 @@ exports[`Ams Environments Vmatrix 1`] = ` " - - + + a @@ -1328,7 +1328,7 @@ exports[`Ams Environments Vmatrix 1`] = ` b - + c @@ -1346,8 +1346,8 @@ exports[`Ams Environments bmatrix 1`] = ` " [ - - + + a @@ -1355,7 +1355,7 @@ exports[`Ams Environments bmatrix 1`] = ` b - + c @@ -1378,8 +1378,8 @@ exports[`Ams Environments cases 1`] = ` = { - - + + 1 @@ -1394,7 +1394,7 @@ exports[`Ams Environments cases 1`] = ` - + 0 @@ -1411,7 +1411,7 @@ exports[`Ams Environments cases 1`] = ` exports[`Ams Environments flalign 1`] = ` " - + a @@ -1426,7 +1426,7 @@ exports[`Ams Environments flalign 1`] = ` b - + c @@ -1448,7 +1448,7 @@ exports[`Ams Environments flalign 1`] = ` exports[`Ams Environments flalign small 1`] = ` " - + a @@ -1465,7 +1465,7 @@ exports[`Ams Environments flalign small 1`] = ` exports[`Ams Environments matrix 1`] = ` " - + a @@ -1473,7 +1473,7 @@ exports[`Ams Environments matrix 1`] = ` b - + c @@ -1489,8 +1489,8 @@ exports[`Ams Environments pmatrix 1`] = ` " ( - - + + a @@ -1498,7 +1498,7 @@ exports[`Ams Environments pmatrix 1`] = ` b - + c @@ -1515,7 +1515,7 @@ exports[`Ams Environments pmatrix 1`] = ` exports[`Ams Environments xalign tagged 1`] = ` " - + ( @@ -1529,7 +1529,7 @@ exports[`Ams Environments xalign tagged 1`] = ` - b + b @@ -1546,7 +1546,7 @@ exports[`Ams Environments xalign tagged 1`] = ` exports[`Ams Environments xalignat 1`] = ` " - + a @@ -1574,7 +1574,7 @@ exports[`Ams Environments xalignat 1`] = ` exports[`Ams Environments xalignat padding 1`] = ` " - + a @@ -1598,7 +1598,7 @@ exports[`Ams Environments xalignat padding 1`] = ` exports[`Ams Environments xxalignat 1`] = ` " - + a @@ -1651,6 +1651,29 @@ exports[`Ams Genfrac no delimiters 1`] = ` " `; +exports[`Ams Issues Array with Tag 1`] = ` +" + + + + ( + 1 + ) + + + + + + a + + + + + + +" +`; + exports[`Ams Left Fraction 1`] = ` " @@ -2006,7 +2029,7 @@ exports[`Ams Symbol 1`] = ` exports[`Ams Tagged Environments Align 1`] = ` " - + ( 1 @@ -2023,7 +2046,7 @@ exports[`Ams Tagged Environments Align 1`] = ` - + ( 2 @@ -2047,7 +2070,7 @@ exports[`Ams Tagged Environments Align 1`] = ` exports[`Ams Tagged Environments Align Notag 1`] = ` " - + ( 1 @@ -2064,13 +2087,13 @@ exports[`Ams Tagged Environments Align Notag 1`] = ` - + = - c + c @@ -2081,7 +2104,7 @@ exports[`Ams Tagged Environments Align Notag 1`] = ` exports[`Ams Tagged Environments Align Star 1`] = ` " - + a @@ -2093,7 +2116,7 @@ exports[`Ams Tagged Environments Align Star 1`] = ` - + c @@ -2112,7 +2135,7 @@ exports[`Ams Tagged Environments Align Star 1`] = ` exports[`Ams Tagged Environments Alignat 1`] = ` " - + ( 1 @@ -2129,7 +2152,7 @@ exports[`Ams Tagged Environments Alignat 1`] = ` - + ( 2 @@ -2153,7 +2176,7 @@ exports[`Ams Tagged Environments Alignat 1`] = ` exports[`Ams Tagged Environments Alignat Star 1`] = ` " - + a @@ -2165,7 +2188,7 @@ exports[`Ams Tagged Environments Alignat Star 1`] = ` - + c @@ -2184,7 +2207,7 @@ exports[`Ams Tagged Environments Alignat Star 1`] = ` exports[`Ams Tagged Environments Aligned 1`] = ` " - + a @@ -2194,7 +2217,7 @@ exports[`Ams Tagged Environments Aligned 1`] = ` = b - + r @@ -2206,7 +2229,7 @@ exports[`Ams Tagged Environments Aligned 1`] = ` - + @@ -2220,7 +2243,7 @@ exports[`Ams Tagged Environments Aligned 1`] = ` - + c @@ -2239,7 +2262,7 @@ exports[`Ams Tagged Environments Aligned 1`] = ` exports[`Ams Tagged Environments Alignedat 1`] = ` " - + a @@ -2249,7 +2272,7 @@ exports[`Ams Tagged Environments Alignedat 1`] = ` = b - + r @@ -2261,7 +2284,7 @@ exports[`Ams Tagged Environments Alignedat 1`] = ` - + @@ -2275,7 +2298,7 @@ exports[`Ams Tagged Environments Alignedat 1`] = ` - + c @@ -2294,7 +2317,7 @@ exports[`Ams Tagged Environments Alignedat 1`] = ` exports[`Ams Tagged Environments Eqnarray 1`] = ` " - + ( 1 @@ -2313,7 +2336,7 @@ exports[`Ams Tagged Environments Eqnarray 1`] = ` - + ( 2 @@ -2339,7 +2362,7 @@ exports[`Ams Tagged Environments Eqnarray 1`] = ` exports[`Ams Tagged Environments Eqnarray Star 1`] = ` " - + a @@ -2353,7 +2376,7 @@ exports[`Ams Tagged Environments Eqnarray Star 1`] = ` - + c @@ -2374,7 +2397,7 @@ exports[`Ams Tagged Environments Eqnarray Star 1`] = ` exports[`Ams Tagged Environments Equation 1`] = ` " - + ( 1 @@ -2397,7 +2420,7 @@ exports[`Ams Tagged Environments Equation Star 1`] = ` exports[`Ams Tagged Environments Gather 1`] = ` " - + ( 1 @@ -2409,7 +2432,7 @@ exports[`Ams Tagged Environments Gather 1`] = ` b - + ( 2 @@ -2428,14 +2451,14 @@ exports[`Ams Tagged Environments Gather 1`] = ` exports[`Ams Tagged Environments Gather Star 1`] = ` " - + a = b - + c = @@ -2449,7 +2472,7 @@ exports[`Ams Tagged Environments Gather Star 1`] = ` exports[`Ams Tagged Environments Gathered 1`] = ` " - + a @@ -2459,14 +2482,14 @@ exports[`Ams Tagged Environments Gathered 1`] = ` = b - + r = s - + = t @@ -2476,7 +2499,7 @@ exports[`Ams Tagged Environments Gathered 1`] = ` - + c @@ -2495,7 +2518,7 @@ exports[`Ams Tagged Environments Gathered 1`] = ` exports[`Ams Tagged Environments Left Gather Align 1`] = ` " - + ( 2 @@ -2503,7 +2526,7 @@ exports[`Ams Tagged Environments Left Gather Align 1`] = ` - + ( 1 @@ -2530,14 +2553,14 @@ exports[`Ams Tagged Environments Left Gather Align 1`] = ` exports[`Ams Tagged Environments Left multline tagged left 1`] = ` " - + ( 1 ) - a + a @@ -2547,7 +2570,7 @@ exports[`Ams Tagged Environments Left multline tagged left 1`] = ` exports[`Ams Tagged Environments Left xalign tagged left 1`] = ` " - + ( @@ -2561,7 +2584,7 @@ exports[`Ams Tagged Environments Left xalign tagged left 1`] = ` - b + b @@ -2578,17 +2601,17 @@ exports[`Ams Tagged Environments Left xalign tagged left 1`] = ` exports[`Ams Tagged Environments Multline 1`] = ` " - + a - + b - + ( 1 @@ -2605,17 +2628,17 @@ exports[`Ams Tagged Environments Multline 1`] = ` exports[`Ams Tagged Environments Multline Star 1`] = ` " - + a - + b - + c @@ -2627,8 +2650,8 @@ exports[`Ams Tagged Environments Multline Star 1`] = ` exports[`Ams Tagged Environments Small Matrix 1`] = ` " - - + + a @@ -2641,7 +2664,7 @@ exports[`Ams Tagged Environments Small Matrix 1`] = ` exports[`Ams Tagged Environments Split 1`] = ` " - + a @@ -2651,7 +2674,7 @@ exports[`Ams Tagged Environments Split 1`] = ` = b - + r @@ -2663,7 +2686,7 @@ exports[`Ams Tagged Environments Split 1`] = ` - + @@ -2677,7 +2700,7 @@ exports[`Ams Tagged Environments Split 1`] = ` - + c @@ -2696,8 +2719,8 @@ exports[`Ams Tagged Environments Split 1`] = ` exports[`Ams Tagged Environments Subarray 1`] = ` " - - + + a @@ -2710,12 +2733,12 @@ exports[`Ams Tagged Environments Subarray 1`] = ` exports[`Ams Tagged Environments aligned [b] 1`] = ` " - + a - + b @@ -2727,7 +2750,7 @@ exports[`Ams Tagged Environments aligned [b] 1`] = ` exports[`Ams Tagged Environments aligned [x] 1`] = ` " - + [ x @@ -2735,7 +2758,7 @@ exports[`Ams Tagged Environments aligned [x] 1`] = ` a - + b @@ -2747,7 +2770,7 @@ exports[`Ams Tagged Environments aligned [x] 1`] = ` exports[`Ams Tagged Environments flalign 1`] = ` " - + ( 1 @@ -2771,7 +2794,7 @@ exports[`Ams Tagged Environments flalign 1`] = ` exports[`Ams Tagged Environments xalignet 1`] = ` " - + ( @@ -2797,7 +2820,7 @@ exports[`Ams Tagged Environments xalignet 1`] = ` exports[`Ams Tagged Environments xalignet star 1`] = ` " - + a @@ -2816,7 +2839,7 @@ exports[`Ams Tagged Environments xalignet star 1`] = ` exports[`Ams Tagged Environments xalignet star 2`] = ` " - + a @@ -3230,13 +3253,13 @@ exports[`Ams symbols math0mo 19 1`] = ` exports[`Ams symbols substack 1`] = ` " - - + + a - + b @@ -3253,7 +3276,7 @@ exports[`InternalMath Mbox Eqref 1`] = `   - (???) + (???)   @@ -3330,17 +3353,17 @@ exports[`Multirel Preset Rspace Lspace 1`] = ` exports[`MultlineShove Shove Left Bottom 1`] = ` " - + a - + b - + c @@ -3352,17 +3375,17 @@ exports[`MultlineShove Shove Left Bottom 1`] = ` exports[`MultlineShove Shove Left Middle 1`] = ` " - + a - + b - + c @@ -3374,17 +3397,17 @@ exports[`MultlineShove Shove Left Middle 1`] = ` exports[`MultlineShove Shove Left Right 1`] = ` " - + a - + b - + c @@ -3396,17 +3419,17 @@ exports[`MultlineShove Shove Left Right 1`] = ` exports[`MultlineShove Shove Left Top 1`] = ` " - + a - + b - + c @@ -3418,17 +3441,17 @@ exports[`MultlineShove Shove Left Top 1`] = ` exports[`MultlineShove Shove None 1`] = ` " - + a - + b - + c @@ -3440,17 +3463,17 @@ exports[`MultlineShove Shove None 1`] = ` exports[`MultlineShove Shove Right Bottom 1`] = ` " - + a - + b - + c @@ -3462,17 +3485,17 @@ exports[`MultlineShove Shove Right Bottom 1`] = ` exports[`MultlineShove Shove Right Left 1`] = ` " - + a - + b - + c @@ -3484,17 +3507,17 @@ exports[`MultlineShove Shove Right Left 1`] = ` exports[`MultlineShove Shove Right Middle 1`] = ` " - + a - + b - + c @@ -3506,17 +3529,17 @@ exports[`MultlineShove Shove Right Middle 1`] = ` exports[`MultlineShove Shove Right Top 1`] = ` " - + a - + b - + c diff --git a/testsuite/tests/input/tex/__snapshots__/Amscd.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Amscd.test.ts.snap index 47dc8e819..3594791d1 100644 --- a/testsuite/tests/input/tex/__snapshots__/Amscd.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Amscd.test.ts.snap @@ -3,7 +3,7 @@ exports[`AmsCD AmsCD-1 1`] = ` " - + A @@ -20,7 +20,7 @@ exports[`AmsCD AmsCD-1 1`] = ` B - + @@ -60,7 +60,7 @@ exports[`AmsCD AmsCD-1 1`] = ` - + C @@ -84,7 +84,7 @@ exports[`AmsCD AmsCD-1 1`] = ` exports[`AmsCD AmsCD-2 1`] = ` " - + A @@ -112,7 +112,7 @@ exports[`AmsCD AmsCD-2 1`] = ` C - + @@ -124,7 +124,7 @@ exports[`AmsCD AmsCD-2 1`] = ` - + @@ -146,7 +146,7 @@ exports[`AmsCD AmsCD-2 1`] = ` exports[`AmsCD AmsCD-3 1`] = ` " - + A @@ -166,7 +166,7 @@ exports[`AmsCD AmsCD-3 1`] = ` B - + @@ -232,7 +232,7 @@ exports[`AmsCD AmsCD-3 1`] = ` - + C @@ -259,7 +259,7 @@ exports[`AmsCD AmsCD-3 1`] = ` exports[`AmsCD AmsCD-4 1`] = ` " - + A @@ -287,7 +287,7 @@ exports[`AmsCD AmsCD-4 1`] = ` C - + @@ -301,7 +301,7 @@ exports[`AmsCD AmsCD-4 1`] = ` - + D @@ -336,7 +336,7 @@ exports[`AmsCD AmsCD-4 1`] = ` exports[`AmsCD AmsCD-5 1`] = ` " - + A @@ -366,7 +366,7 @@ exports[`AmsCD AmsCD-5 1`] = ` C - + @@ -380,7 +380,7 @@ exports[`AmsCD AmsCD-5 1`] = ` - + D @@ -421,7 +421,7 @@ exports[`AmsCD AmsCD-5 1`] = ` exports[`AmsCD AmsCD-6 1`] = ` " - + A @@ -451,7 +451,7 @@ exports[`AmsCD AmsCD-6 1`] = ` C - + @@ -465,7 +465,7 @@ exports[`AmsCD AmsCD-6 1`] = ` - + D @@ -516,7 +516,7 @@ exports[`AmsCD AmsCD-6 1`] = ` exports[`AmsCD AmsCD-both 1`] = ` " - + A @@ -533,7 +533,7 @@ exports[`AmsCD AmsCD-both 1`] = ` B - + @@ -573,7 +573,7 @@ exports[`AmsCD AmsCD-both 1`] = ` - + C @@ -597,7 +597,7 @@ exports[`AmsCD AmsCD-both 1`] = ` exports[`AmsCD AmsCD-height 1`] = ` " - + A @@ -614,7 +614,7 @@ exports[`AmsCD AmsCD-height 1`] = ` B - + @@ -654,7 +654,7 @@ exports[`AmsCD AmsCD-height 1`] = ` - + C @@ -678,7 +678,7 @@ exports[`AmsCD AmsCD-height 1`] = ` exports[`AmsCD AmsCD-width 1`] = ` " - + A @@ -695,7 +695,7 @@ exports[`AmsCD AmsCD-width 1`] = ` B - + @@ -735,7 +735,7 @@ exports[`AmsCD AmsCD-width 1`] = ` - + C @@ -759,7 +759,7 @@ exports[`AmsCD AmsCD-width 1`] = ` exports[`AmsCD Entry with prime (#3373) 1`] = ` " - + A @@ -786,7 +786,7 @@ exports[`AmsCD Entry with prime (#3373) 1`] = ` exports[`AmsCD Options Hide Horizontal Labels 1`] = ` " - + A @@ -805,7 +805,7 @@ exports[`AmsCD Options Hide Horizontal Labels 1`] = ` B - + @@ -845,7 +845,7 @@ exports[`AmsCD Options Hide Horizontal Labels 1`] = ` - + C @@ -871,7 +871,7 @@ exports[`AmsCD Options Hide Horizontal Labels 1`] = ` exports[`AmsCD Spaces 1`] = ` " - + A @@ -895,7 +895,7 @@ exports[`AmsCD Spaces 1`] = ` exports[`AmsCD Suspicious Return 1`] = ` " - + A @ diff --git a/testsuite/tests/input/tex/__snapshots__/Autoload.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Autoload.test.ts.snap index d0a71584f..fd4799027 100644 --- a/testsuite/tests/input/tex/__snapshots__/Autoload.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Autoload.test.ts.snap @@ -3,7 +3,7 @@ exports[`Autoload Autoload environment 1`] = ` " - + a diff --git a/testsuite/tests/input/tex/__snapshots__/Base.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Base.test.ts.snap index ade3d2a80..e49979f46 100644 --- a/testsuite/tests/input/tex/__snapshots__/Base.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Base.test.ts.snap @@ -194,7 +194,7 @@ exports[`Accents widetilde 1`] = ` exports[`Array Array Single 1`] = ` " - + a @@ -206,7 +206,7 @@ exports[`Array Array Single 1`] = ` exports[`Array Array aligned 1`] = ` " - + a @@ -218,7 +218,7 @@ exports[`Array Array aligned 1`] = ` exports[`Array Array aligned invalid 1`] = ` " - + a @@ -230,7 +230,7 @@ exports[`Array Array aligned invalid 1`] = ` exports[`Array Array dashed column 1`] = ` " - + a @@ -238,7 +238,7 @@ exports[`Array Array dashed column 1`] = ` c - + b @@ -253,12 +253,12 @@ exports[`Array Array dashed column 1`] = ` exports[`Array Array dashed row 1`] = ` " - + a - + b @@ -270,7 +270,7 @@ exports[`Array Array dashed row 1`] = ` exports[`Array Array solid column 1`] = ` " - + a @@ -278,7 +278,7 @@ exports[`Array Array solid column 1`] = ` c - + b @@ -293,12 +293,12 @@ exports[`Array Array solid column 1`] = ` exports[`Array Array solid row 1`] = ` " - + a - + b @@ -310,7 +310,7 @@ exports[`Array Array solid row 1`] = ` exports[`Array Column+Rowlines Solid Dashed None 1`] = ` " - + 0 @@ -324,7 +324,7 @@ exports[`Array Column+Rowlines Solid Dashed None 1`] = ` c - + 1 @@ -338,7 +338,7 @@ exports[`Array Column+Rowlines Solid Dashed None 1`] = ` f - + 2 @@ -352,7 +352,7 @@ exports[`Array Column+Rowlines Solid Dashed None 1`] = ` i - + 3 @@ -373,7 +373,7 @@ exports[`Array Column+Rowlines Solid Dashed None 1`] = ` exports[`Array Column+Rowlines Solid None 1`] = ` " - + a @@ -384,7 +384,7 @@ exports[`Array Column+Rowlines Solid None 1`] = ` c - + d @@ -395,7 +395,7 @@ exports[`Array Column+Rowlines Solid None 1`] = ` f - + g @@ -413,7 +413,7 @@ exports[`Array Column+Rowlines Solid None 1`] = ` exports[`Array Columnlines Solid None 1`] = ` " - + a @@ -424,7 +424,7 @@ exports[`Array Columnlines Solid None 1`] = ` c - + d @@ -441,15 +441,15 @@ exports[`Array Columnlines Solid None 1`] = ` exports[`Array Empty Array with Template 1`] = ` " - + " `; exports[`Array Enclosed bottom 1`] = ` " - - + + a @@ -462,8 +462,8 @@ exports[`Array Enclosed bottom 1`] = ` exports[`Array Enclosed dashed column 1`] = ` " - - + + a @@ -471,7 +471,7 @@ exports[`Array Enclosed dashed column 1`] = ` c - + b @@ -487,13 +487,13 @@ exports[`Array Enclosed dashed column 1`] = ` exports[`Array Enclosed dashed row 1`] = ` " - - + + a - + b @@ -506,7 +506,7 @@ exports[`Array Enclosed dashed row 1`] = ` exports[`Array Enclosed frame dashed 1`] = ` " - + a @@ -518,7 +518,7 @@ exports[`Array Enclosed frame dashed 1`] = ` exports[`Array Enclosed frame solid 1`] = ` " - + a @@ -530,8 +530,8 @@ exports[`Array Enclosed frame solid 1`] = ` exports[`Array Enclosed left 1`] = ` " - - + + a @@ -544,8 +544,8 @@ exports[`Array Enclosed left 1`] = ` exports[`Array Enclosed left right 1`] = ` " - - + + a @@ -558,8 +558,8 @@ exports[`Array Enclosed left right 1`] = ` exports[`Array Enclosed right 1`] = ` " - - + + a @@ -572,8 +572,8 @@ exports[`Array Enclosed right 1`] = ` exports[`Array Enclosed solid column 1`] = ` " - - + + a @@ -581,7 +581,7 @@ exports[`Array Enclosed solid column 1`] = ` c - + b @@ -597,7 +597,7 @@ exports[`Array Enclosed solid column 1`] = ` exports[`Array Enclosed solid dashed 1`] = ` " - + a @@ -609,13 +609,13 @@ exports[`Array Enclosed solid dashed 1`] = ` exports[`Array Enclosed solid row 1`] = ` " - - + + a - + b @@ -628,8 +628,8 @@ exports[`Array Enclosed solid row 1`] = ` exports[`Array Enclosed top 1`] = ` " - - + + a @@ -642,8 +642,8 @@ exports[`Array Enclosed top 1`] = ` exports[`Array Enclosed top bottom 1`] = ` " - - + + a @@ -656,7 +656,7 @@ exports[`Array Enclosed top bottom 1`] = ` exports[`Array Label 1`] = ` " - + @@ -677,8 +677,8 @@ exports[`Array Matrix Test 1`] = ` " ( - - + + a @@ -689,7 +689,7 @@ exports[`Array Matrix Test 1`] = ` c - + d @@ -700,7 +700,7 @@ exports[`Array Matrix Test 1`] = ` f - + g @@ -720,7 +720,7 @@ exports[`Array Matrix Test 1`] = ` exports[`Array Newcolumntype 1`] = ` " - + a @@ -728,7 +728,7 @@ exports[`Array Newcolumntype 1`] = ` b - + c @@ -742,8 +742,8 @@ exports[`Array Newcolumntype 1`] = ` exports[`Array Newcolumntype Option 1`] = ` " - - + + a @@ -755,7 +755,7 @@ exports[`Array Newcolumntype Option 1`] = ` - + c @@ -774,7 +774,7 @@ exports[`Array Newcolumntype Option 1`] = ` exports[`Array Rowlines Solid None 1`] = ` " - + a @@ -785,7 +785,7 @@ exports[`Array Rowlines Solid None 1`] = ` c - + d @@ -796,7 +796,7 @@ exports[`Array Rowlines Solid None 1`] = ` f - + g @@ -1525,7 +1525,7 @@ exports[`Boxes Vtop Hsize 1`] = ` exports[`BreakAlign BreakAlign Case c 1`] = ` " - + a @@ -1546,7 +1546,7 @@ exports[`BreakAlign BreakAlign Case c 1`] = ` exports[`BreakAlign BreakAlign Case c second cell 1`] = ` " - + a @@ -1567,7 +1567,7 @@ exports[`BreakAlign BreakAlign Case c second cell 1`] = ` exports[`BreakAlign BreakAlign Case r 1`] = ` " - + a @@ -1588,7 +1588,7 @@ exports[`BreakAlign BreakAlign Case r 1`] = ` exports[`BreakAlign BreakAlign Case r multi split 1`] = ` " - + a @@ -1609,7 +1609,7 @@ exports[`BreakAlign BreakAlign Case r multi split 1`] = ` exports[`BreakAlign BreakAlign Case r second row 1`] = ` " - + a @@ -1623,7 +1623,7 @@ exports[`BreakAlign BreakAlign Case r second row 1`] = ` - + c @@ -1644,7 +1644,7 @@ exports[`BreakAlign BreakAlign Case r second row 1`] = ` exports[`BreakAlign BreakAlign Case t 1`] = ` " - + a @@ -1803,8 +1803,8 @@ exports[`Character Class Changes mathpunct 1`] = ` exports[`Complete Array column ! | @ 1`] = ` " - - + + a @@ -1822,8 +1822,8 @@ exports[`Complete Array column ! | @ 1`] = ` exports[`Complete Array column > > c < < 1`] = ` " - - + + b a @@ -1838,8 +1838,8 @@ exports[`Complete Array column > > c < < 1`] = ` exports[`Complete Array column > space 1`] = ` " - - + + x X @@ -1851,8 +1851,8 @@ exports[`Complete Array column > space 1`] = ` exports[`Complete Array column @ | ! c 1`] = ` " - - + + @@ -1868,8 +1868,8 @@ exports[`Complete Array column @ | ! c 1`] = ` exports[`Complete Array column @ p m 1`] = ` " - - + + x @@ -1891,7 +1891,7 @@ exports[`Complete Array column @ p m 1`] = ` exports[`Complete Array column {{c}} 1`] = ` " - + X @@ -1903,7 +1903,7 @@ exports[`Complete Array column {{c}} 1`] = ` exports[`Complete Array column {c} 1`] = ` " - + X Y @@ -1916,7 +1916,7 @@ exports[`Complete Array column {c} 1`] = ` exports[`Complete Array column {cc} 1`] = ` " - + X Y @@ -1929,7 +1929,7 @@ exports[`Complete Array column {cc} 1`] = ` exports[`Complete Array column {r}c{l} 1`] = ` " - + X @@ -1946,8 +1946,8 @@ exports[`Complete Array column {r}c{l} 1`] = ` exports[`Complete Array column b 1`] = ` " - - + + a @@ -1964,7 +1964,7 @@ exports[`Complete Array column b 1`] = ` - + d @@ -1987,14 +1987,14 @@ exports[`Complete Array column b 1`] = ` exports[`Complete Array column c < 1`] = ` " - - + + a A - + d A @@ -2006,14 +2006,14 @@ exports[`Complete Array column c < 1`] = ` exports[`Complete Array column c > 1`] = ` " - - + + A a - + A d @@ -2025,8 +2025,8 @@ exports[`Complete Array column c > 1`] = ` exports[`Complete Array column c @ end 1`] = ` " - - + + a @@ -2034,7 +2034,7 @@ exports[`Complete Array column c @ end 1`] = ` h - + d @@ -2048,8 +2048,8 @@ exports[`Complete Array column c @ end 1`] = ` exports[`Complete Array column c @& 1`] = ` " - - + + a @@ -2061,7 +2061,7 @@ exports[`Complete Array column c @& 1`] = ` b - + d @@ -2079,8 +2079,8 @@ exports[`Complete Array column c @& 1`] = ` exports[`Complete Array column c @& hfil 1`] = ` " - - + + a @@ -2092,7 +2092,7 @@ exports[`Complete Array column c @& hfil 1`] = ` b - + d @@ -2110,8 +2110,8 @@ exports[`Complete Array column c @& hfil 1`] = ` exports[`Complete Array column c W 1`] = ` " - - + + a @@ -2124,7 +2124,7 @@ exports[`Complete Array column c W 1`] = ` c - + d @@ -2143,8 +2143,8 @@ exports[`Complete Array column c W 1`] = ` exports[`Complete Array column c c @ 1`] = ` " - - + + X @@ -2162,7 +2162,7 @@ exports[`Complete Array column c c @ 1`] = ` exports[`Complete Array column c c | c 1`] = ` " - + X @@ -2179,8 +2179,8 @@ exports[`Complete Array column c c | c 1`] = ` exports[`Complete Array column c w 1`] = ` " - - + + a @@ -2193,7 +2193,7 @@ exports[`Complete Array column c w 1`] = ` c - + d @@ -2212,8 +2212,8 @@ exports[`Complete Array column c w 1`] = ` exports[`Complete Array column m 1`] = ` " - - + + a @@ -2230,7 +2230,7 @@ exports[`Complete Array column m 1`] = ` - + d @@ -2256,8 +2256,7 @@ exports[`Complete Array column newline 1`] = ` c} X & Y\\end{array}" display="block"> - + X @@ -2271,8 +2270,8 @@ c}"> exports[`Complete Array column p 1`] = ` " - - + + a @@ -2289,7 +2288,7 @@ exports[`Complete Array column p 1`] = ` - + d @@ -2312,8 +2311,8 @@ exports[`Complete Array column p 1`] = ` exports[`Complete Array column r c l ! 1`] = ` " - - + + a @@ -2330,7 +2329,7 @@ exports[`Complete Array column r c l ! 1`] = ` c - + d @@ -2354,7 +2353,7 @@ exports[`Complete Array column r c l ! 1`] = ` exports[`Complete Array column r c l : 1`] = ` " - + a @@ -2365,7 +2364,7 @@ exports[`Complete Array column r c l : 1`] = ` c - + d @@ -2382,8 +2381,8 @@ exports[`Complete Array column r c l : 1`] = ` exports[`Complete Array column r c l < 1`] = ` " - - + + a A @@ -2395,7 +2394,7 @@ exports[`Complete Array column r c l < 1`] = ` c - + d A @@ -2413,8 +2412,8 @@ exports[`Complete Array column r c l < 1`] = ` exports[`Complete Array column r c l > 1`] = ` " - - + + A a @@ -2426,7 +2425,7 @@ exports[`Complete Array column r c l > 1`] = ` c - + A d @@ -2444,8 +2443,8 @@ exports[`Complete Array column r c l > 1`] = ` exports[`Complete Array column r c l @ 1`] = ` " - - + + a @@ -2462,7 +2461,7 @@ exports[`Complete Array column r c l @ 1`] = ` c - + d @@ -2486,7 +2485,7 @@ exports[`Complete Array column r c l @ 1`] = ` exports[`Complete Array column r c l | 1`] = ` " - + a @@ -2497,7 +2496,7 @@ exports[`Complete Array column r c l | 1`] = ` c - + d @@ -2515,7 +2514,7 @@ exports[`Complete Array column r c l | 1`] = ` exports[`Complete Array column r c l 1`] = ` " - + a @@ -2526,7 +2525,7 @@ exports[`Complete Array column r c l 1`] = ` c - + d @@ -2543,8 +2542,8 @@ exports[`Complete Array column r c l 1`] = ` exports[`Complete Array column r c repeat | 1`] = ` " - - + + a @@ -2560,7 +2559,7 @@ exports[`Complete Array column r c repeat | 1`] = ` c - + d @@ -2582,8 +2581,8 @@ exports[`Complete Array column r c repeat | 1`] = ` exports[`Complete Array column r c repeat | {} 1`] = ` " - - + + a @@ -2602,7 +2601,7 @@ exports[`Complete Array column r c repeat | {} 1`] = ` c - + d @@ -2624,13 +2623,13 @@ exports[`Complete Array column r c repeat | {} 1`] = ` exports[`Complete Array column r c repeat | {} 2`] = ` " - - + + a - - + + Q @@ -2650,7 +2649,7 @@ exports[`Complete Array column r c repeat | {} 2`] = ` c - + d @@ -2672,12 +2671,12 @@ exports[`Complete Array column r c repeat | {} 2`] = ` exports[`Complete Array column r c repeat | {} 3`] = ` " - - + + a - - + + Q @@ -2696,7 +2695,7 @@ exports[`Complete Array column r c repeat | {} 3`] = ` c - + d @@ -2719,7 +2718,7 @@ exports[`Complete Array column r c repeat | {} 3`] = ` exports[`Complete Array column r repeat c 1`] = ` " - + a @@ -2730,7 +2729,7 @@ exports[`Complete Array column r repeat c 1`] = ` c - + d @@ -2748,7 +2747,7 @@ exports[`Complete Array column r repeat c 1`] = ` exports[`Complete Array column repeat r c 1`] = ` " - + a @@ -2759,7 +2758,7 @@ exports[`Complete Array column repeat r c 1`] = ` c - + d @@ -2777,12 +2776,12 @@ exports[`Complete Array column repeat r c 1`] = ` exports[`Complete Array end row hline c 1`] = ` " - + a - + b @@ -2794,7 +2793,7 @@ exports[`Complete Array end row hline c 1`] = ` exports[`Complete Array end row spacing r c l 1`] = ` " - + a @@ -2805,7 +2804,7 @@ exports[`Complete Array end row spacing r c l 1`] = ` c - + d @@ -2823,7 +2822,7 @@ exports[`Complete Array end row spacing r c l 1`] = ` exports[`Complete Array eqnarray extend last row 1`] = ` " - + r @@ -2836,7 +2835,7 @@ exports[`Complete Array eqnarray extend last row 1`] = ` b - + d @@ -3333,7 +3332,7 @@ exports[`Dots vdots 1`] = ` exports[`Environments Array Center 1`] = ` " - + a @@ -3345,12 +3344,12 @@ exports[`Environments Array Center 1`] = ` exports[`Environments Array Center Lines 1`] = ` " - + a - + b @@ -3362,7 +3361,7 @@ exports[`Environments Array Center Lines 1`] = ` exports[`Environments Array RCL 1`] = ` " - + a @@ -3380,7 +3379,7 @@ exports[`Environments Array RCL 1`] = ` exports[`Environments Array RCL Lines 1`] = ` " - + a @@ -3391,7 +3390,7 @@ exports[`Environments Array RCL Lines 1`] = ` b - + c @@ -3409,7 +3408,7 @@ exports[`Environments Array RCL Lines 1`] = ` exports[`Environments Display Array Center 1`] = ` " - + a @@ -3421,12 +3420,12 @@ exports[`Environments Display Array Center 1`] = ` exports[`Environments Display Array Center Lines 1`] = ` " - + a - + b @@ -3438,7 +3437,7 @@ exports[`Environments Display Array Center Lines 1`] = ` exports[`Environments Display Array RCL 1`] = ` " - + a @@ -3456,7 +3455,7 @@ exports[`Environments Display Array RCL 1`] = ` exports[`Environments Display Array RCL Lines 1`] = ` " - + a @@ -3467,7 +3466,7 @@ exports[`Environments Display Array RCL Lines 1`] = ` b - + c @@ -3491,7 +3490,7 @@ exports[`Environments Displaymath 1`] = ` exports[`Environments Eqnarray 1`] = ` " - + a @@ -3544,7 +3543,7 @@ exports[`Environments IndentAlign Single 1`] = ` exports[`Environments Nested array 1`] = ` " - + a @@ -3556,8 +3555,8 @@ exports[`Environments Nested array 1`] = ` c - - + + f @@ -3565,7 +3564,7 @@ exports[`Environments Nested array 1`] = ` h - + g @@ -4498,12 +4497,12 @@ exports[`InternalMath Unicode text 1`] = ` exports[`Linebreaks Array Custom Linebreak 1`] = ` " - + a - + b @@ -4515,12 +4514,12 @@ exports[`Linebreaks Array Custom Linebreak 1`] = ` exports[`Linebreaks Cr Linebreak 1`] = ` " - + a - + b @@ -5823,12 +5822,12 @@ exports[`Mathchoice Pmod 1`] = ` exports[`Matrix Displaylines 1`] = ` " - + a - + b @@ -5840,7 +5839,7 @@ exports[`Matrix Displaylines 1`] = ` exports[`Matrix Matrix Arg 1`] = ` " - + a @@ -5852,7 +5851,7 @@ exports[`Matrix Matrix Arg 1`] = ` exports[`Matrix Matrix Braces 1`] = ` " - + a @@ -5866,7 +5865,7 @@ exports[`Matrix Matrix Cases 1`] = ` { - + a @@ -5882,7 +5881,7 @@ exports[`Matrix Matrix Cases 2`] = ` { - + a @@ -5898,7 +5897,7 @@ exports[`Matrix Matrix Cases text 1`] = ` { - + a @@ -5917,7 +5916,7 @@ exports[`Matrix Matrix Cases two columns 1`] = ` { - + a @@ -5936,7 +5935,7 @@ exports[`Matrix Matrix Cases two columns braces 1`] = ` { - + a @@ -5955,7 +5954,7 @@ exports[`Matrix Matrix Cases two rows 1`] = ` { - + a @@ -5963,7 +5962,7 @@ exports[`Matrix Matrix Cases two rows 1`] = ` b - + c @@ -5980,7 +5979,7 @@ exports[`Matrix Matrix Cases two rows 1`] = ` exports[`Matrix Matrix Columns 1`] = ` " - + a @@ -5997,7 +5996,7 @@ exports[`Matrix Matrix Font Entry 1`] = ` ( - + a @@ -6014,7 +6013,7 @@ exports[`Matrix Matrix Font Entry 1`] = ` exports[`Matrix Matrix Not Numbered 1`] = ` " - + a @@ -6032,7 +6031,7 @@ exports[`Matrix Matrix Not Numbered 1`] = ` exports[`Matrix Matrix Numbered 1`] = ` " - + c @@ -6050,7 +6049,7 @@ exports[`Matrix Matrix Numbered 1`] = ` exports[`Matrix Matrix Numbered Left 1`] = ` " - + c @@ -6070,7 +6069,7 @@ exports[`Matrix Matrix Parens 1`] = ` ( - + a @@ -6092,7 +6091,7 @@ exports[`Matrix Matrix Parens Subscript 1`] = ` ( - + a @@ -6111,7 +6110,7 @@ exports[`Matrix Matrix Parens Subscript 1`] = ` exports[`Matrix Matrix Rows 1`] = ` " - + a @@ -6119,7 +6118,7 @@ exports[`Matrix Matrix Rows 1`] = ` b - + c @@ -6137,7 +6136,7 @@ exports[`Matrix Matrix Subscript 1`] = ` X - + a @@ -7574,14 +7573,14 @@ exports[`Primes Triple Prime 1`] = ` exports[`Referencing Label 1`] = ` " - + ( 1 ) - a + a @@ -7591,14 +7590,14 @@ exports[`Referencing Label 1`] = ` exports[`Referencing Label Empty 1`] = ` " - + ( 1 ) - a + a @@ -7608,24 +7607,24 @@ exports[`Referencing Label Empty 1`] = ` exports[`Referencing Label Multiple 1`] = ` " - + ( 1 ) - a + a - + ( 2 ) - c + c @@ -7635,7 +7634,7 @@ exports[`Referencing Label Multiple 1`] = ` exports[`Referencing Nonumber 1`] = ` " - + ( 1 @@ -7645,9 +7644,9 @@ exports[`Referencing Nonumber 1`] = ` a - + - c + c @@ -7657,16 +7656,16 @@ exports[`Referencing Nonumber 1`] = ` exports[`Referencing Ref 1`] = ` " - + ( 1 ) - a - - ??? + a + + ??? @@ -7677,16 +7676,16 @@ exports[`Referencing Ref 1`] = ` exports[`Referencing Ref Unknown 1`] = ` " - + ( 1 ) - a - - ??? + a + + ??? @@ -7831,7 +7830,7 @@ exports[`Setting sizes tiny 1`] = ` exports[`Spaces Hfil 1`] = ` " - + a @@ -7839,7 +7838,7 @@ exports[`Spaces Hfil 1`] = ` b - + d @@ -7856,7 +7855,7 @@ exports[`Spaces Hfil 1`] = ` exports[`Spaces Hfil Centering 1`] = ` " - + x @@ -7868,7 +7867,7 @@ exports[`Spaces Hfil Centering 1`] = ` exports[`Spaces Hfill 1`] = ` " - + a @@ -7876,7 +7875,7 @@ exports[`Spaces Hfill 1`] = ` b - + d @@ -7893,7 +7892,7 @@ exports[`Spaces Hfill 1`] = ` exports[`Spaces Hfilll 1`] = ` " - + a @@ -7901,7 +7900,7 @@ exports[`Spaces Hfilll 1`] = ` b - + d @@ -9027,7 +9026,7 @@ exports[`Sub and Superscripts SubSup 1`] = ` exports[`Tagged Environments EqnTest 1`] = ` " - + ( 1 @@ -9049,7 +9048,7 @@ exports[`Tagged Environments EqnTest 1`] = ` exports[`Tagged Environments Equation 1`] = ` " - + ( 1 @@ -9068,7 +9067,7 @@ exports[`User Defined Environments Cases star 1`] = ` { - + a @@ -9076,7 +9075,7 @@ exports[`User Defined Environments Cases star 1`] = ` test a - + b @@ -9093,8 +9092,8 @@ exports[`User Defined Environments Cases star 1`] = ` exports[`User Defined Environments Crampedsubarray 1`] = ` " - - + + a @@ -9102,7 +9101,7 @@ exports[`User Defined Environments Crampedsubarray 1`] = ` b - + c @@ -9118,7 +9117,7 @@ exports[`User Defined Environments Crampedsubarray 1`] = ` exports[`User Defined Environments EqnTest 1`] = ` " - + a @@ -9135,7 +9134,7 @@ exports[`User Defined Environments EqnTest 1`] = ` exports[`User Defined Environments Gather 1`] = ` " - + a @@ -9156,8 +9155,8 @@ exports[`User Defined Environments pmatrix 1`] = ` " ( - - + + a @@ -9165,7 +9164,7 @@ exports[`User Defined Environments pmatrix 1`] = ` b - + c @@ -9182,8 +9181,8 @@ exports[`User Defined Environments pmatrix 1`] = ` exports[`User Defined Environments smallmatrix 1`] = ` " - - + + a @@ -9191,7 +9190,7 @@ exports[`User Defined Environments smallmatrix 1`] = ` b - + c @@ -9206,9 +9205,9 @@ exports[`User Defined Environments smallmatrix 1`] = ` exports[`User Defined Macros EqRef 1`] = ` " - a - - (???) + a + + (???) " `; diff --git a/testsuite/tests/input/tex/__snapshots__/Cases.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Cases.test.ts.snap index f62320187..3b66bcd75 100644 --- a/testsuite/tests/input/tex/__snapshots__/Cases.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Cases.test.ts.snap @@ -3,7 +3,7 @@ exports[`Cases Numcases 1`] = ` " - + ( 1 @@ -22,7 +22,7 @@ exports[`Cases Numcases 1`] = ` - + ( 1 @@ -48,7 +48,7 @@ exports[`Cases Numcases 1`] = ` - + ( 2 @@ -73,7 +73,7 @@ exports[`Cases Numcases 1`] = ` - + ( 1 @@ -124,7 +124,7 @@ exports[`Cases Numcases 1`] = ` - + ( 2 @@ -150,7 +150,7 @@ exports[`Cases Numcases 1`] = ` exports[`Cases Numcases with macro 1`] = ` " - + ( 1 @@ -166,7 +166,7 @@ exports[`Cases Numcases with macro 1`] = ` - + ( 1 @@ -191,7 +191,7 @@ exports[`Cases Numcases with macro 1`] = ` - + ( 1 @@ -233,7 +233,7 @@ exports[`Cases Numcases with macro 1`] = ` exports[`Cases entry not in numcases 1`] = ` " - + x @@ -248,7 +248,7 @@ exports[`Cases entry not in numcases 1`] = ` exports[`Cases numcases with explicit tag 1`] = ` " - + ( A @@ -264,14 +264,14 @@ exports[`Cases numcases with explicit tag 1`] = ` - + ( A ) - x + x @@ -289,14 +289,14 @@ exports[`Cases numcases with explicit tag 1`] = ` - + ( A ) - x + x @@ -313,7 +313,7 @@ exports[`Cases numcases with explicit tag 1`] = ` - x + x @@ -331,7 +331,7 @@ exports[`Cases numcases with explicit tag 1`] = ` exports[`Cases subnumcases 1`] = ` " - + ( 1a @@ -350,7 +350,7 @@ exports[`Cases subnumcases 1`] = ` - + ( 1a @@ -376,7 +376,7 @@ exports[`Cases subnumcases 1`] = ` - + ( 1b @@ -401,7 +401,7 @@ exports[`Cases subnumcases 1`] = ` - + ( 1a @@ -452,7 +452,7 @@ exports[`Cases subnumcases 1`] = ` - + ( 1b diff --git a/testsuite/tests/input/tex/__snapshots__/Colortbl.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Colortbl.test.ts.snap index ea5e43856..e00f9bbb4 100644 --- a/testsuite/tests/input/tex/__snapshots__/Colortbl.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Colortbl.test.ts.snap @@ -3,7 +3,7 @@ exports[`Colortbl cellcolor 1`] = ` " - + a @@ -11,7 +11,7 @@ exports[`Colortbl cellcolor 1`] = ` b - + c @@ -28,7 +28,7 @@ exports[`Colortbl cellcolor in pmatrix 1`] = ` ( - + a @@ -41,8 +41,8 @@ exports[`Colortbl cellcolor in pmatrix 1`] = ` exports[`Colortbl cellcolor in preamble 1`] = ` " - - + + a @@ -50,7 +50,7 @@ exports[`Colortbl cellcolor in preamble 1`] = ` b - + c @@ -65,12 +65,12 @@ exports[`Colortbl cellcolor in preamble 1`] = ` exports[`Colortbl cellcolor late 1`] = ` " - + a - b + b @@ -80,7 +80,7 @@ exports[`Colortbl cellcolor late 1`] = ` exports[`Colortbl cellcolor with color model 1`] = ` " - + a @@ -92,7 +92,7 @@ exports[`Colortbl cellcolor with color model 1`] = ` exports[`Colortbl cellcolor with columncolor 1`] = ` " - + a @@ -100,7 +100,7 @@ exports[`Colortbl cellcolor with columncolor 1`] = ` b - + c @@ -115,7 +115,7 @@ exports[`Colortbl cellcolor with columncolor 1`] = ` exports[`Colortbl cellcolor with columncolor and rowcolor 1`] = ` " - + a @@ -123,7 +123,7 @@ exports[`Colortbl cellcolor with columncolor and rowcolor 1`] = ` b - + c @@ -138,8 +138,8 @@ exports[`Colortbl cellcolor with columncolor and rowcolor 1`] = ` exports[`Colortbl cellcolor with frame 1`] = ` " - - + + a @@ -152,7 +152,7 @@ exports[`Colortbl cellcolor with frame 1`] = ` exports[`Colortbl cellcolor with rowcolor 1`] = ` " - + a @@ -160,7 +160,7 @@ exports[`Colortbl cellcolor with rowcolor 1`] = ` b - + c @@ -175,7 +175,7 @@ exports[`Colortbl cellcolor with rowcolor 1`] = ` exports[`Colortbl color with no frame 1`] = ` " - + a @@ -187,7 +187,7 @@ exports[`Colortbl color with no frame 1`] = ` exports[`Colortbl columncolor 1`] = ` " - + a @@ -195,7 +195,7 @@ exports[`Colortbl columncolor 1`] = ` b - + c @@ -210,7 +210,7 @@ exports[`Colortbl columncolor 1`] = ` exports[`Colortbl columncolor and rowcolor 1`] = ` " - + a @@ -218,7 +218,7 @@ exports[`Colortbl columncolor and rowcolor 1`] = ` b - + c @@ -233,7 +233,7 @@ exports[`Colortbl columncolor and rowcolor 1`] = ` exports[`Colortbl columncolor ignore overlap 1`] = ` " - + a @@ -241,7 +241,7 @@ exports[`Colortbl columncolor ignore overlap 1`] = ` b - + c @@ -255,8 +255,8 @@ exports[`Colortbl columncolor ignore overlap 1`] = ` exports[`Colortbl columncolor in preamble 1`] = ` " - - + + a @@ -264,7 +264,7 @@ exports[`Colortbl columncolor in preamble 1`] = ` b - + c @@ -279,7 +279,7 @@ exports[`Colortbl columncolor in preamble 1`] = ` exports[`Colortbl rowcolor 1`] = ` " - + a @@ -287,7 +287,7 @@ exports[`Colortbl rowcolor 1`] = ` b - + c diff --git a/testsuite/tests/input/tex/__snapshots__/Empheq.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Empheq.test.ts.snap index d3a200fc1..326041006 100644 --- a/testsuite/tests/input/tex/__snapshots__/Empheq.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Empheq.test.ts.snap @@ -225,7 +225,7 @@ exports[`Empheq Characters empheqrvert 1`] = ` exports[`Empheq Empheq Left 1`] = ` " - + ( 1 @@ -239,7 +239,7 @@ exports[`Empheq Empheq Left 1`] = ` - + ( 1 @@ -256,7 +256,7 @@ exports[`Empheq Empheq Left 1`] = ` - + ( 2 @@ -280,7 +280,7 @@ exports[`Empheq Empheq Left 1`] = ` - + ( 1 @@ -313,7 +313,7 @@ exports[`Empheq Empheq Left 1`] = ` - + ( 2 @@ -338,7 +338,7 @@ exports[`Empheq Empheq Left 1`] = ` exports[`Empheq Empheq Right 1`] = ` " - + ( 1 @@ -362,7 +362,7 @@ exports[`Empheq Empheq Right 1`] = ` - + ( 1 @@ -379,7 +379,7 @@ exports[`Empheq Empheq Right 1`] = ` - + ( 2 @@ -403,7 +403,7 @@ exports[`Empheq Empheq Right 1`] = ` - + ( 1 @@ -426,7 +426,7 @@ exports[`Empheq Empheq Right 1`] = ` - + ( 2 @@ -450,7 +450,7 @@ exports[`Empheq Empheq Right 1`] = ` exports[`Empheq Numcases 1`] = ` " - + ( 1 @@ -467,7 +467,7 @@ exports[`Empheq Numcases 1`] = ` - + ( 1 @@ -477,7 +477,7 @@ exports[`Empheq Numcases 1`] = ` a - + ( 2 @@ -501,7 +501,7 @@ exports[`Empheq Numcases 1`] = ` - + ( 1 @@ -517,7 +517,7 @@ exports[`Empheq Numcases 1`] = ` - + ( 2 @@ -541,7 +541,7 @@ exports[`Empheq Numcases 1`] = ` exports[`Empheq Numcases alignedat 1`] = ` " - + ( 1 @@ -623,7 +623,7 @@ exports[`Empheq Numcases empty right 1`] = ` exports[`Empheq Numcases with label 1`] = ` " - + ( 1 @@ -633,13 +633,13 @@ exports[`Empheq Numcases with label 1`] = ` A - = + = { - + ( 1 @@ -664,7 +664,7 @@ exports[`Empheq Numcases with label 1`] = ` - + ( 1 diff --git a/testsuite/tests/input/tex/__snapshots__/Mathtools.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Mathtools.test.ts.snap index a2d6de709..7af85c919 100644 --- a/testsuite/tests/input/tex/__snapshots__/Mathtools.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Mathtools.test.ts.snap @@ -3,7 +3,7 @@ exports[`Mathtools Boxed Equations Aboxed 1`] = ` " - + @@ -39,7 +39,7 @@ exports[`Mathtools Boxed Equations Aboxed 1`] = ` - + @@ -56,7 +56,7 @@ exports[`Mathtools Boxed Equations Aboxed 1`] = ` exports[`Mathtools Boxed Equations Aboxed odd column 1`] = ` " - + @@ -103,7 +103,7 @@ exports[`Mathtools Boxed Equations Aboxed odd column 1`] = ` exports[`Mathtools Boxed Equations MakeAboxedCommand 1`] = ` " - + @@ -146,7 +146,7 @@ exports[`Mathtools Boxed Equations MakeAboxedCommand 1`] = ` exports[`Mathtools Boxed Equations MakeAboxedCommand star 1`] = ` " - + @@ -528,8 +528,8 @@ exports[`Mathtools Matrix Environments Bmatrix* 1`] = ` " { - - + + 1 @@ -538,7 +538,7 @@ exports[`Mathtools Matrix Environments Bmatrix* 1`] = ` 3 - + 2 @@ -557,8 +557,8 @@ exports[`Mathtools Matrix Environments Bmatrix*[c] 1`] = ` " { - - + + 1 @@ -567,7 +567,7 @@ exports[`Mathtools Matrix Environments Bmatrix*[c] 1`] = ` 3 - + 2 @@ -586,8 +586,8 @@ exports[`Mathtools Matrix Environments Bmatrix*[l] 1`] = ` " { - - + + 1 @@ -596,7 +596,7 @@ exports[`Mathtools Matrix Environments Bmatrix*[l] 1`] = ` 3 - + 2 @@ -615,8 +615,8 @@ exports[`Mathtools Matrix Environments Bmatrix*[r] 1`] = ` " { - - + + 1 @@ -625,7 +625,7 @@ exports[`Mathtools Matrix Environments Bmatrix*[r] 1`] = ` 3 - + 2 @@ -644,8 +644,8 @@ exports[`Mathtools Matrix Environments Vmatrix* 1`] = ` " - - + + 1 @@ -654,7 +654,7 @@ exports[`Mathtools Matrix Environments Vmatrix* 1`] = ` 3 - + 2 @@ -673,8 +673,8 @@ exports[`Mathtools Matrix Environments Vmatrix*[c] 1`] = ` " - - + + 1 @@ -683,7 +683,7 @@ exports[`Mathtools Matrix Environments Vmatrix*[c] 1`] = ` 3 - + 2 @@ -702,8 +702,8 @@ exports[`Mathtools Matrix Environments Vmatrix*[l] 1`] = ` " - - + + 1 @@ -712,7 +712,7 @@ exports[`Mathtools Matrix Environments Vmatrix*[l] 1`] = ` 3 - + 2 @@ -731,8 +731,8 @@ exports[`Mathtools Matrix Environments Vmatrix*[r] 1`] = ` " - - + + 1 @@ -741,7 +741,7 @@ exports[`Mathtools Matrix Environments Vmatrix*[r] 1`] = ` 3 - + 2 @@ -760,8 +760,8 @@ exports[`Mathtools Matrix Environments bmatrix* 1`] = ` " [ - - + + 1 @@ -770,7 +770,7 @@ exports[`Mathtools Matrix Environments bmatrix* 1`] = ` 3 - + 2 @@ -789,8 +789,8 @@ exports[`Mathtools Matrix Environments bmatrix*[c] 1`] = ` " [ - - + + 1 @@ -799,7 +799,7 @@ exports[`Mathtools Matrix Environments bmatrix*[c] 1`] = ` 3 - + 2 @@ -818,8 +818,8 @@ exports[`Mathtools Matrix Environments bmatrix*[l] 1`] = ` " [ - - + + 1 @@ -828,7 +828,7 @@ exports[`Mathtools Matrix Environments bmatrix*[l] 1`] = ` 3 - + 2 @@ -847,8 +847,8 @@ exports[`Mathtools Matrix Environments bmatrix*[r] 1`] = ` " [ - - + + 1 @@ -857,7 +857,7 @@ exports[`Mathtools Matrix Environments bmatrix*[r] 1`] = ` 3 - + 2 @@ -875,7 +875,7 @@ exports[`Mathtools Matrix Environments bmatrix*[r] 1`] = ` exports[`Mathtools Matrix Environments matrix* 1`] = ` " - + 1 @@ -884,7 +884,7 @@ exports[`Mathtools Matrix Environments matrix* 1`] = ` 3 - + 2 @@ -900,7 +900,7 @@ exports[`Mathtools Matrix Environments matrix* 1`] = ` exports[`Mathtools Matrix Environments matrix*[c] 1`] = ` " - + 1 @@ -909,7 +909,7 @@ exports[`Mathtools Matrix Environments matrix*[c] 1`] = ` 3 - + 2 @@ -925,7 +925,7 @@ exports[`Mathtools Matrix Environments matrix*[c] 1`] = ` exports[`Mathtools Matrix Environments matrix*[l] 1`] = ` " - + 1 @@ -934,7 +934,7 @@ exports[`Mathtools Matrix Environments matrix*[l] 1`] = ` 3 - + 2 @@ -950,7 +950,7 @@ exports[`Mathtools Matrix Environments matrix*[l] 1`] = ` exports[`Mathtools Matrix Environments matrix*[r] 1`] = ` " - + 1 @@ -959,7 +959,7 @@ exports[`Mathtools Matrix Environments matrix*[r] 1`] = ` 3 - + 2 @@ -976,8 +976,8 @@ exports[`Mathtools Matrix Environments pmatrix* 1`] = ` " ( - - + + 1 @@ -986,7 +986,7 @@ exports[`Mathtools Matrix Environments pmatrix* 1`] = ` 3 - + 2 @@ -1005,8 +1005,8 @@ exports[`Mathtools Matrix Environments pmatrix*[c] 1`] = ` " ( - - + + 1 @@ -1015,7 +1015,7 @@ exports[`Mathtools Matrix Environments pmatrix*[c] 1`] = ` 3 - + 2 @@ -1034,8 +1034,8 @@ exports[`Mathtools Matrix Environments pmatrix*[l] 1`] = ` " ( - - + + 1 @@ -1044,7 +1044,7 @@ exports[`Mathtools Matrix Environments pmatrix*[l] 1`] = ` 3 - + 2 @@ -1063,8 +1063,8 @@ exports[`Mathtools Matrix Environments pmatrix*[r] 1`] = ` " ( - - + + 1 @@ -1073,7 +1073,7 @@ exports[`Mathtools Matrix Environments pmatrix*[r] 1`] = ` 3 - + 2 @@ -1092,8 +1092,8 @@ exports[`Mathtools Matrix Environments vmatrix* 1`] = ` " | - - + + 1 @@ -1102,7 +1102,7 @@ exports[`Mathtools Matrix Environments vmatrix* 1`] = ` 3 - + 2 @@ -1121,8 +1121,8 @@ exports[`Mathtools Matrix Environments vmatrix*[c] 1`] = ` " | - - + + 1 @@ -1131,7 +1131,7 @@ exports[`Mathtools Matrix Environments vmatrix*[c] 1`] = ` 3 - + 2 @@ -1150,8 +1150,8 @@ exports[`Mathtools Matrix Environments vmatrix*[l] 1`] = ` " | - - + + 1 @@ -1160,7 +1160,7 @@ exports[`Mathtools Matrix Environments vmatrix*[l] 1`] = ` 3 - + 2 @@ -1179,8 +1179,8 @@ exports[`Mathtools Matrix Environments vmatrix*[r] 1`] = ` " | - - + + 1 @@ -1189,7 +1189,7 @@ exports[`Mathtools Matrix Environments vmatrix*[r] 1`] = ` 3 - + 2 @@ -1207,7 +1207,7 @@ exports[`Mathtools Matrix Environments vmatrix*[r] 1`] = ` exports[`Mathtools More Environments ArrowBetweenLines 1`] = ` " - + @@ -1231,13 +1231,13 @@ exports[`Mathtools More Environments ArrowBetweenLines 1`] = ` - + - + @@ -1268,7 +1268,7 @@ exports[`Mathtools More Environments ArrowBetweenLines 1`] = ` exports[`Mathtools More Environments ArrowBetweenLines* 1`] = ` " - + @@ -1296,7 +1296,7 @@ exports[`Mathtools More Environments ArrowBetweenLines* 1`] = ` - + @@ -1306,7 +1306,7 @@ exports[`Mathtools More Environments ArrowBetweenLines* 1`] = ` - + @@ -1341,7 +1341,7 @@ exports[`Mathtools More Environments ArrowBetweenLines* 1`] = ` exports[`Mathtools More Environments MoveEqLeft 1`] = ` " - + @@ -1358,7 +1358,7 @@ exports[`Mathtools More Environments MoveEqLeft 1`] = ` - + @@ -1374,7 +1374,7 @@ exports[`Mathtools More Environments MoveEqLeft 1`] = ` - + @@ -1391,14 +1391,14 @@ exports[`Mathtools More Environments MoveEqLeft 1`] = ` exports[`Mathtools More Environments Spreadlines 1`] = ` " - + a = b - + c = @@ -1412,14 +1412,14 @@ exports[`Mathtools More Environments Spreadlines 1`] = ` exports[`Mathtools More Environments Spreadlines multiple environments 1`] = ` " - + a = b - + c = @@ -1429,14 +1429,14 @@ exports[`Mathtools More Environments Spreadlines multiple environments 1`] = ` - + x = y - + z @@ -1458,7 +1458,7 @@ exports[`Mathtools More Environments cases* 1`] = ` { - + 1 @@ -1473,7 +1473,7 @@ exports[`Mathtools More Environments cases* 1`] = ` - + 1 @@ -1492,8 +1492,8 @@ exports[`Mathtools More Environments dcases 1`] = ` " { - - + + 1 @@ -1503,7 +1503,7 @@ exports[`Mathtools More Environments dcases 1`] = ` 0 - + 1 @@ -1525,7 +1525,7 @@ exports[`Mathtools More Environments dcases* 1`] = ` { - + 1 @@ -1540,7 +1540,7 @@ exports[`Mathtools More Environments dcases* 1`] = ` - + 1 @@ -1561,8 +1561,8 @@ exports[`Mathtools More Environments drcases 1`] = ` " - - + + 1 @@ -1572,7 +1572,7 @@ exports[`Mathtools More Environments drcases 1`] = ` 0 - + 1 @@ -1594,7 +1594,7 @@ exports[`Mathtools More Environments drcases* 1`] = ` - + 1 @@ -1609,7 +1609,7 @@ exports[`Mathtools More Environments drcases* 1`] = ` - + 1 @@ -1629,7 +1629,7 @@ exports[`Mathtools More Environments drcases* 1`] = ` exports[`Mathtools More Environments lgathered 1`] = ` " - + a + @@ -1638,7 +1638,7 @@ exports[`Mathtools More Environments lgathered 1`] = ` c - + d @@ -1650,7 +1650,7 @@ exports[`Mathtools More Environments lgathered 1`] = ` exports[`Mathtools More Environments multlined [b] width 1`] = ` " - + @@ -1662,7 +1662,7 @@ exports[`Mathtools More Environments multlined [b] width 1`] = ` - + @@ -1683,7 +1683,7 @@ exports[`Mathtools More Environments multlined [b] width 1`] = ` exports[`Mathtools More Environments multlined [c] width 1`] = ` " - + @@ -1695,7 +1695,7 @@ exports[`Mathtools More Environments multlined [c] width 1`] = ` - + @@ -1716,7 +1716,7 @@ exports[`Mathtools More Environments multlined [c] width 1`] = ` exports[`Mathtools More Environments multlined [t] width 1`] = ` " - + @@ -1728,7 +1728,7 @@ exports[`Mathtools More Environments multlined [t] width 1`] = ` - + @@ -1751,7 +1751,7 @@ exports[`Mathtools More Environments multlined 1`] = ` A = - + @@ -1763,7 +1763,7 @@ exports[`Mathtools More Environments multlined 1`] = ` - + @@ -1783,7 +1783,7 @@ exports[`Mathtools More Environments multlined 1`] = ` exports[`Mathtools More Environments multlined empty row 1`] = ` " - + a @@ -1795,7 +1795,7 @@ exports[`Mathtools More Environments multlined empty row 1`] = ` exports[`Mathtools More Environments multlined shoved 1`] = ` " - + @@ -1807,7 +1807,7 @@ exports[`Mathtools More Environments multlined shoved 1`] = ` - + @@ -1818,7 +1818,7 @@ exports[`Mathtools More Environments multlined shoved 1`] = ` - + @@ -1829,7 +1829,7 @@ exports[`Mathtools More Environments multlined shoved 1`] = ` - + @@ -1848,7 +1848,7 @@ exports[`Mathtools More Environments multlined shoved 1`] = ` exports[`Mathtools More Environments multlined shoved distance 1`] = ` " - + @@ -1860,7 +1860,7 @@ exports[`Mathtools More Environments multlined shoved distance 1`] = ` - + @@ -1874,7 +1874,7 @@ exports[`Mathtools More Environments multlined shoved distance 1`] = ` - + @@ -1888,7 +1888,7 @@ exports[`Mathtools More Environments multlined shoved distance 1`] = ` - + @@ -1907,7 +1907,7 @@ exports[`Mathtools More Environments multlined shoved distance 1`] = ` exports[`Mathtools More Environments multlined width 1`] = ` " - + @@ -1919,7 +1919,7 @@ exports[`Mathtools More Environments multlined width 1`] = ` - + @@ -1939,8 +1939,8 @@ exports[`Mathtools More Environments rcases 1`] = ` " - - + + 1 @@ -1950,7 +1950,7 @@ exports[`Mathtools More Environments rcases 1`] = ` 0 - + 1 @@ -1972,7 +1972,7 @@ exports[`Mathtools More Environments rcases* 1`] = ` - + 1 @@ -1987,7 +1987,7 @@ exports[`Mathtools More Environments rcases* 1`] = ` - + 1 @@ -2005,7 +2005,7 @@ exports[`Mathtools More Environments rcases* 1`] = ` exports[`Mathtools More Environments rgathered 1`] = ` " - + a + @@ -2014,7 +2014,7 @@ exports[`Mathtools More Environments rgathered 1`] = ` c - + d @@ -2026,7 +2026,7 @@ exports[`Mathtools More Environments rgathered 1`] = ` exports[`Mathtools More Environments smallvdotswithin star 1`] = ` " - + A @@ -2038,7 +2038,7 @@ exports[`Mathtools More Environments smallvdotswithin star 1`] = ` - + @@ -2055,7 +2055,7 @@ exports[`Mathtools More Environments smallvdotswithin star 1`] = ` - + C @@ -2074,7 +2074,7 @@ exports[`Mathtools More Environments smallvdotswithin star 1`] = ` exports[`Mathtools More Environments vdotswithin smallvdotswithin 1`] = ` " - + a @@ -2086,7 +2086,7 @@ exports[`Mathtools More Environments vdotswithin smallvdotswithin 1`] = ` - + @@ -2103,7 +2103,7 @@ exports[`Mathtools More Environments vdotswithin smallvdotswithin 1`] = ` - + @@ -2113,7 +2113,7 @@ exports[`Mathtools More Environments vdotswithin smallvdotswithin 1`] = ` - + @@ -2130,7 +2130,7 @@ exports[`Mathtools More Environments vdotswithin smallvdotswithin 1`] = ` - + @@ -2147,7 +2147,7 @@ exports[`Mathtools More Environments vdotswithin smallvdotswithin 1`] = ` exports[`Mathtools More Environments vdotswithin smallvdotswithin 2`] = ` " - + A @@ -2175,7 +2175,7 @@ exports[`Mathtools More Environments vdotswithin smallvdotswithin 2`] = ` - + @@ -2211,7 +2211,7 @@ exports[`Mathtools More Environments vdotswithin smallvdotswithin 2`] = ` - + C @@ -2443,8 +2443,8 @@ exports[`Mathtools Small Matrix Environments Bsmallmatrix 1`] = ` { - - + + a @@ -2453,7 +2453,7 @@ exports[`Mathtools Small Matrix Environments Bsmallmatrix 1`] = ` b - + c @@ -2474,8 +2474,8 @@ exports[`Mathtools Small Matrix Environments Bsmallmatrix* 1`] = ` { - - + + a @@ -2484,7 +2484,7 @@ exports[`Mathtools Small Matrix Environments Bsmallmatrix* 1`] = ` b - + c @@ -2505,8 +2505,8 @@ exports[`Mathtools Small Matrix Environments Bsmallmatrix*[c] 1`] = ` { - - + + a @@ -2515,7 +2515,7 @@ exports[`Mathtools Small Matrix Environments Bsmallmatrix*[c] 1`] = ` b - + c @@ -2536,8 +2536,8 @@ exports[`Mathtools Small Matrix Environments Bsmallmatrix*[l] 1`] = ` { - - + + a @@ -2546,7 +2546,7 @@ exports[`Mathtools Small Matrix Environments Bsmallmatrix*[l] 1`] = ` b - + c @@ -2567,8 +2567,8 @@ exports[`Mathtools Small Matrix Environments Bsmallmatrix*[r] 1`] = ` { - - + + a @@ -2577,7 +2577,7 @@ exports[`Mathtools Small Matrix Environments Bsmallmatrix*[r] 1`] = ` b - + c @@ -2598,8 +2598,8 @@ exports[`Mathtools Small Matrix Environments Vsmallmatrix 1`] = ` - - + + a @@ -2608,7 +2608,7 @@ exports[`Mathtools Small Matrix Environments Vsmallmatrix 1`] = ` b - + c @@ -2629,8 +2629,8 @@ exports[`Mathtools Small Matrix Environments Vsmallmatrix* 1`] = ` - - + + a @@ -2639,7 +2639,7 @@ exports[`Mathtools Small Matrix Environments Vsmallmatrix* 1`] = ` b - + c @@ -2660,8 +2660,8 @@ exports[`Mathtools Small Matrix Environments Vsmallmatrix*[c] 1`] = ` - - + + a @@ -2670,7 +2670,7 @@ exports[`Mathtools Small Matrix Environments Vsmallmatrix*[c] 1`] = ` b - + c @@ -2691,8 +2691,8 @@ exports[`Mathtools Small Matrix Environments Vsmallmatrix*[l] 1`] = ` - - + + a @@ -2701,7 +2701,7 @@ exports[`Mathtools Small Matrix Environments Vsmallmatrix*[l] 1`] = ` b - + c @@ -2722,8 +2722,8 @@ exports[`Mathtools Small Matrix Environments Vsmallmatrix*[r] 1`] = ` - - + + a @@ -2732,7 +2732,7 @@ exports[`Mathtools Small Matrix Environments Vsmallmatrix*[r] 1`] = ` b - + c @@ -2753,8 +2753,8 @@ exports[`Mathtools Small Matrix Environments bsmallmatrix 1`] = ` [ - - + + a @@ -2763,7 +2763,7 @@ exports[`Mathtools Small Matrix Environments bsmallmatrix 1`] = ` b - + c @@ -2784,8 +2784,8 @@ exports[`Mathtools Small Matrix Environments bsmallmatrix* 1`] = ` [ - - + + a @@ -2794,7 +2794,7 @@ exports[`Mathtools Small Matrix Environments bsmallmatrix* 1`] = ` b - + c @@ -2815,8 +2815,8 @@ exports[`Mathtools Small Matrix Environments bsmallmatrix*[c] 1`] = ` [ - - + + a @@ -2825,7 +2825,7 @@ exports[`Mathtools Small Matrix Environments bsmallmatrix*[c] 1`] = ` b - + c @@ -2846,8 +2846,8 @@ exports[`Mathtools Small Matrix Environments bsmallmatrix*[l] 1`] = ` [ - - + + a @@ -2856,7 +2856,7 @@ exports[`Mathtools Small Matrix Environments bsmallmatrix*[l] 1`] = ` b - + c @@ -2877,8 +2877,8 @@ exports[`Mathtools Small Matrix Environments bsmallmatrix*[r] 1`] = ` [ - - + + a @@ -2887,7 +2887,7 @@ exports[`Mathtools Small Matrix Environments bsmallmatrix*[r] 1`] = ` b - + c @@ -2908,8 +2908,8 @@ exports[`Mathtools Small Matrix Environments psmallmatrix 1`] = ` ( - - + + a @@ -2918,7 +2918,7 @@ exports[`Mathtools Small Matrix Environments psmallmatrix 1`] = ` b - + c @@ -2939,8 +2939,8 @@ exports[`Mathtools Small Matrix Environments psmallmatrix* 1`] = ` ( - - + + a @@ -2949,7 +2949,7 @@ exports[`Mathtools Small Matrix Environments psmallmatrix* 1`] = ` b - + c @@ -2970,8 +2970,8 @@ exports[`Mathtools Small Matrix Environments psmallmatrix*[c] 1`] = ` ( - - + + a @@ -2980,7 +2980,7 @@ exports[`Mathtools Small Matrix Environments psmallmatrix*[c] 1`] = ` b - + c @@ -3001,8 +3001,8 @@ exports[`Mathtools Small Matrix Environments psmallmatrix*[l] 1`] = ` ( - - + + a @@ -3011,7 +3011,7 @@ exports[`Mathtools Small Matrix Environments psmallmatrix*[l] 1`] = ` b - + c @@ -3032,8 +3032,8 @@ exports[`Mathtools Small Matrix Environments psmallmatrix*[r] 1`] = ` ( - - + + a @@ -3042,7 +3042,7 @@ exports[`Mathtools Small Matrix Environments psmallmatrix*[r] 1`] = ` b - + c @@ -3061,8 +3061,8 @@ exports[`Mathtools Small Matrix Environments psmallmatrix*[r] 1`] = ` exports[`Mathtools Small Matrix Environments smallmatrix 1`] = ` " - - + + a @@ -3071,7 +3071,7 @@ exports[`Mathtools Small Matrix Environments smallmatrix 1`] = ` b - + c @@ -3088,8 +3088,8 @@ exports[`Mathtools Small Matrix Environments smallmatrix 1`] = ` exports[`Mathtools Small Matrix Environments smallmatrix 2`] = ` " - - + + a @@ -3098,7 +3098,7 @@ exports[`Mathtools Small Matrix Environments smallmatrix 2`] = ` b - + c @@ -3115,8 +3115,8 @@ exports[`Mathtools Small Matrix Environments smallmatrix 2`] = ` exports[`Mathtools Small Matrix Environments smallmatrix* 1`] = ` " - - + + a @@ -3125,7 +3125,7 @@ exports[`Mathtools Small Matrix Environments smallmatrix* 1`] = ` b - + c @@ -3142,8 +3142,8 @@ exports[`Mathtools Small Matrix Environments smallmatrix* 1`] = ` exports[`Mathtools Small Matrix Environments smallmatrix*[c] 1`] = ` " - - + + a @@ -3152,7 +3152,7 @@ exports[`Mathtools Small Matrix Environments smallmatrix*[c] 1`] = ` b - + c @@ -3169,8 +3169,8 @@ exports[`Mathtools Small Matrix Environments smallmatrix*[c] 1`] = ` exports[`Mathtools Small Matrix Environments smallmatrix*[l] 1`] = ` " - - + + a @@ -3179,7 +3179,7 @@ exports[`Mathtools Small Matrix Environments smallmatrix*[l] 1`] = ` b - + c @@ -3196,8 +3196,8 @@ exports[`Mathtools Small Matrix Environments smallmatrix*[l] 1`] = ` exports[`Mathtools Small Matrix Environments smallmatrix*[r] 1`] = ` " - - + + a @@ -3206,7 +3206,7 @@ exports[`Mathtools Small Matrix Environments smallmatrix*[r] 1`] = ` b - + c @@ -3225,8 +3225,8 @@ exports[`Mathtools Small Matrix Environments vsmallmatrix 1`] = ` | - - + + a @@ -3235,7 +3235,7 @@ exports[`Mathtools Small Matrix Environments vsmallmatrix 1`] = ` b - + c @@ -3256,8 +3256,8 @@ exports[`Mathtools Small Matrix Environments vsmallmatrix* 1`] = ` | - - + + a @@ -3266,7 +3266,7 @@ exports[`Mathtools Small Matrix Environments vsmallmatrix* 1`] = ` b - + c @@ -3287,8 +3287,8 @@ exports[`Mathtools Small Matrix Environments vsmallmatrix*[c] 1`] = ` | - - + + a @@ -3297,7 +3297,7 @@ exports[`Mathtools Small Matrix Environments vsmallmatrix*[c] 1`] = ` b - + c @@ -3318,8 +3318,8 @@ exports[`Mathtools Small Matrix Environments vsmallmatrix*[l] 1`] = ` | - - + + a @@ -3328,7 +3328,7 @@ exports[`Mathtools Small Matrix Environments vsmallmatrix*[l] 1`] = ` b - + c @@ -3349,8 +3349,8 @@ exports[`Mathtools Small Matrix Environments vsmallmatrix*[r] 1`] = ` | - - + + a @@ -3359,7 +3359,7 @@ exports[`Mathtools Small Matrix Environments vsmallmatrix*[r] 1`] = ` b - + c @@ -3570,8 +3570,8 @@ exports[`Mathtools Spacing Control crampedsubstack 1`] = ` - - + + x @@ -3579,7 +3579,7 @@ exports[`Mathtools Spacing Control crampedsubstack 1`] = ` - + y @@ -3915,14 +3915,14 @@ exports[`Mathtools Symbols Other 1`] = ` exports[`Mathtools Tagging Tags add 1`] = ` " - + | 1 | - x + x @@ -3932,7 +3932,7 @@ exports[`Mathtools Tagging Tags add 1`] = ` exports[`Mathtools Tagging newtagform 1`] = ` " - + [ 1 @@ -3955,7 +3955,7 @@ exports[`Mathtools Tagging newtagform 1`] = ` exports[`Mathtools Tagging newtagform styled 1`] = ` " - + [ \\textbf{1} @@ -3978,7 +3978,7 @@ exports[`Mathtools Tagging newtagform styled 1`] = ` exports[`Mathtools Tagging refeq 1`] = ` " - + \\textsf{A} @@ -3992,10 +3992,10 @@ exports[`Mathtools Tagging refeq 1`] = ` - + - - \\textsf{A} + + \\textsf{A} @@ -4006,7 +4006,7 @@ exports[`Mathtools Tagging refeq 1`] = ` exports[`Mathtools Tagging renewtagform 1`] = ` " - + (( 1 @@ -4107,7 +4107,7 @@ exports[`Mathtools options legacycolonsymbols option 2`] = ` exports[`Mathtools options mathtoolsset 1`] = ` " - + a @@ -4247,7 +4247,7 @@ exports[`Mathtools options pairedDelimiters 3`] = ` exports[`Mathtools options tagforms 1`] = ` " - + [[ \\mathbf{x} @@ -4256,7 +4256,7 @@ exports[`Mathtools options tagforms 1`] = ` a = - b + b @@ -4266,14 +4266,14 @@ exports[`Mathtools options tagforms 1`] = ` exports[`Mathtools options tagforms reset 1`] = ` " - + ( 1 ) - a + a @@ -4307,13 +4307,13 @@ exports[`Mathtools setoptions multlined gap and pos 1`] = ` a + - + a - + b @@ -4328,13 +4328,13 @@ exports[`Mathtools setoptions multlined gap and pos 1`] = ` exports[`Mathtools setoptions multlined skips 1`] = ` " - + a - + b @@ -4347,13 +4347,13 @@ exports[`Mathtools setoptions multlined skips 1`] = ` exports[`Mathtools setoptions multlined width 1`] = ` " - + a - + b @@ -4368,13 +4368,13 @@ exports[`Mathtools setoptions multlined-pos override 1`] = ` a + - + a - + b @@ -4414,13 +4414,13 @@ exports[`Mathtools setoptions smallmatrix-align 1`] = ` ( - - + + a - + b diff --git a/testsuite/tests/input/tex/__snapshots__/Newcommand.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Newcommand.test.ts.snap index a0b254542..3e5af71fa 100644 --- a/testsuite/tests/input/tex/__snapshots__/Newcommand.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Newcommand.test.ts.snap @@ -14,11 +14,11 @@ exports[`Nested Environments Environments Intermixed 1`] = ` exports[`Nested Environments Environments Nested 1`] = ` " - - + + - - + + a @@ -26,7 +26,7 @@ exports[`Nested Environments Environments Nested 1`] = ` b - + c @@ -56,8 +56,8 @@ exports[`Nested Environments Nested Begins 1`] = ` exports[`Nested Environments Newenvironment with Begin 1`] = ` " - - + + a @@ -65,7 +65,7 @@ exports[`Nested Environments Newenvironment with Begin 1`] = ` b - + c diff --git a/testsuite/tests/input/tex/__snapshots__/Physics.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Physics.test.ts.snap index 1291e5686..ace091799 100644 --- a/testsuite/tests/input/tex/__snapshots__/Physics.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Physics.test.ts.snap @@ -901,12 +901,12 @@ exports[`Matrix Macros Rest antidiagonalmatrix 1`] = ` " ( - - + + - + 0 @@ -914,15 +914,15 @@ exports[`Matrix Macros Rest antidiagonalmatrix 1`] = ` - + - + 1 - + 2 @@ -943,11 +943,11 @@ exports[`Matrix Macros Rest diagonalmatrix 1`] = ` " ( - - + + - + 0 @@ -955,16 +955,16 @@ exports[`Matrix Macros Rest diagonalmatrix 1`] = ` - + - + 1 - + 2 @@ -985,8 +985,8 @@ exports[`Matrix Macros Rest paulimatrix 0 1`] = ` " ( - - + + 1 @@ -994,7 +994,7 @@ exports[`Matrix Macros Rest paulimatrix 0 1`] = ` 0 - + 0 @@ -1012,8 +1012,8 @@ exports[`Matrix Macros Rest paulimatrix 1 1`] = ` " ( - - + + 0 @@ -1021,7 +1021,7 @@ exports[`Matrix Macros Rest paulimatrix 1 1`] = ` 1 - + 1 @@ -1039,8 +1039,8 @@ exports[`Matrix Macros Rest paulimatrix 2 1`] = ` " ( - - + + 0 @@ -1049,7 +1049,7 @@ exports[`Matrix Macros Rest paulimatrix 2 1`] = ` i - + i @@ -1067,8 +1067,8 @@ exports[`Matrix Macros Rest paulimatrix 3 1`] = ` " ( - - + + 1 @@ -1076,7 +1076,7 @@ exports[`Matrix Macros Rest paulimatrix 3 1`] = ` 0 - + 0 @@ -1095,7 +1095,7 @@ exports[`Matrix Macros Rest paulimatrix 4 1`] = ` " ( - + ) " @@ -1105,8 +1105,8 @@ exports[`Matrix Macros Rest zeromatrix 1`] = ` " ( - - + + 0 @@ -1117,7 +1117,7 @@ exports[`Matrix Macros Rest zeromatrix 1`] = ` 0 - + 0 @@ -7995,7 +7995,7 @@ exports[`Physics6_4 BraKet_MatrixEl_7 1`] = ` exports[`Physics7_0 Matrices_Quantity_0 1`] = ` " - + Q @@ -8007,7 +8007,7 @@ exports[`Physics7_0 Matrices_Quantity_0 1`] = ` exports[`Physics7_0 Matrices_Quantity_1 1`] = ` " - + a @@ -8015,7 +8015,7 @@ exports[`Physics7_0 Matrices_Quantity_1 1`] = ` b - + c @@ -8031,8 +8031,8 @@ exports[`Physics7_0 Matrices_Quantity_2 1`] = ` " - - + + a @@ -8040,7 +8040,7 @@ exports[`Physics7_0 Matrices_Quantity_2 1`] = ` b - + c @@ -8058,8 +8058,8 @@ exports[`Physics7_0 Matrices_Quantity_3 1`] = ` " ( - - + + a @@ -8067,7 +8067,7 @@ exports[`Physics7_0 Matrices_Quantity_3 1`] = ` b - + c @@ -8085,8 +8085,8 @@ exports[`Physics7_0 Matrices_Quantity_4 1`] = ` " [ - - + + a @@ -8094,7 +8094,7 @@ exports[`Physics7_0 Matrices_Quantity_4 1`] = ` b - + c @@ -8112,8 +8112,8 @@ exports[`Physics7_0 Matrices_Quantity_5 1`] = ` " | - - + + a @@ -8121,7 +8121,7 @@ exports[`Physics7_0 Matrices_Quantity_5 1`] = ` b - + c @@ -8138,7 +8138,7 @@ exports[`Physics7_0 Matrices_Quantity_5 1`] = ` exports[`Physics7_0 Matrices_Quantity_6 1`] = ` " - + a @@ -8146,7 +8146,7 @@ exports[`Physics7_0 Matrices_Quantity_6 1`] = ` b - + c @@ -8162,8 +8162,8 @@ exports[`Physics7_0 Matrices_Quantity_7 1`] = ` " ( - - + + a @@ -8171,7 +8171,7 @@ exports[`Physics7_0 Matrices_Quantity_7 1`] = ` b - + c @@ -8189,8 +8189,8 @@ exports[`Physics7_0 Matrices_Quantity_8 1`] = ` " - - + + a @@ -8198,7 +8198,7 @@ exports[`Physics7_0 Matrices_Quantity_8 1`] = ` b - + c @@ -8216,8 +8216,8 @@ exports[`Physics7_0 Matrices_Quantity_9 1`] = ` " [ - - + + a @@ -8225,7 +8225,7 @@ exports[`Physics7_0 Matrices_Quantity_9 1`] = ` b - + c @@ -8243,8 +8243,8 @@ exports[`Physics7_0 Matrices_Quantity_10 1`] = ` " | - - + + a @@ -8252,7 +8252,7 @@ exports[`Physics7_0 Matrices_Quantity_10 1`] = ` b - + c @@ -8270,8 +8270,8 @@ exports[`Physics7_0 Matrices_Quantity_11 1`] = ` " | - - + + a @@ -8279,7 +8279,7 @@ exports[`Physics7_0 Matrices_Quantity_11 1`] = ` b - + c @@ -8297,8 +8297,8 @@ exports[`Physics7_1 Matrices_Fenced_0 1`] = ` " ( - - + + Q @@ -8308,8 +8308,8 @@ exports[`Physics7_1 Matrices_Fenced_0 1`] = ` ( - - + + R @@ -8324,8 +8324,8 @@ exports[`Physics7_1 Matrices_Fenced_1 1`] = ` " - - + + Q @@ -8335,8 +8335,8 @@ exports[`Physics7_1 Matrices_Fenced_1 1`] = ` - - + + R @@ -8351,8 +8351,8 @@ exports[`Physics7_1 Matrices_Fenced_2 1`] = ` " [ - - + + Q @@ -8362,8 +8362,8 @@ exports[`Physics7_1 Matrices_Fenced_2 1`] = ` [ - - + + R @@ -8378,8 +8378,8 @@ exports[`Physics7_1 Matrices_Fenced_3 1`] = ` " | - - + + Q @@ -8389,8 +8389,8 @@ exports[`Physics7_1 Matrices_Fenced_3 1`] = ` | - - + + R @@ -8405,8 +8405,8 @@ exports[`Physics7_1 Matrices_Fenced_4 1`] = ` " ( - - + + a @@ -8414,7 +8414,7 @@ exports[`Physics7_1 Matrices_Fenced_4 1`] = ` b - + c @@ -8432,8 +8432,8 @@ exports[`Physics7_1 Matrices_Fenced_5 1`] = ` " - - + + a @@ -8441,7 +8441,7 @@ exports[`Physics7_1 Matrices_Fenced_5 1`] = ` b - + c @@ -8459,8 +8459,8 @@ exports[`Physics7_1 Matrices_Fenced_6 1`] = ` " [ - - + + a @@ -8468,7 +8468,7 @@ exports[`Physics7_1 Matrices_Fenced_6 1`] = ` b - + c @@ -8486,8 +8486,8 @@ exports[`Physics7_1 Matrices_Fenced_7 1`] = ` " | - - + + a @@ -8495,7 +8495,7 @@ exports[`Physics7_1 Matrices_Fenced_7 1`] = ` b - + c @@ -8512,8 +8512,8 @@ exports[`Physics7_1 Matrices_Fenced_7 1`] = ` exports[`Physics7_2 Matrices_Small_0 1`] = ` " - - + + Q @@ -8527,8 +8527,8 @@ exports[`Physics7_2 Matrices_Small_0 1`] = ` exports[`Physics7_2 Matrices_Small_1 1`] = ` " - - + + a @@ -8537,7 +8537,7 @@ exports[`Physics7_2 Matrices_Small_1 1`] = ` b - + c @@ -8555,8 +8555,8 @@ exports[`Physics7_2 Matrices_Small_2 1`] = ` - - + + a @@ -8565,7 +8565,7 @@ exports[`Physics7_2 Matrices_Small_2 1`] = ` b - + c @@ -8585,8 +8585,8 @@ exports[`Physics7_2 Matrices_Small_3 1`] = ` ( - - + + a @@ -8595,7 +8595,7 @@ exports[`Physics7_2 Matrices_Small_3 1`] = ` b - + c @@ -8615,8 +8615,8 @@ exports[`Physics7_2 Matrices_Small_5 1`] = ` | - - + + a @@ -8625,7 +8625,7 @@ exports[`Physics7_2 Matrices_Small_5 1`] = ` b - + c @@ -8643,8 +8643,8 @@ exports[`Physics7_2 Matrices_Small_5 1`] = ` exports[`Physics7_2 Matrices_Small_6 1`] = ` " - - + + a @@ -8653,7 +8653,7 @@ exports[`Physics7_2 Matrices_Small_6 1`] = ` b - + c @@ -8671,8 +8671,8 @@ exports[`Physics7_2 Matrices_Small_7 1`] = ` ( - - + + a @@ -8681,7 +8681,7 @@ exports[`Physics7_2 Matrices_Small_7 1`] = ` b - + c @@ -8701,8 +8701,8 @@ exports[`Physics7_2 Matrices_Small_8 1`] = ` - - + + a @@ -8711,7 +8711,7 @@ exports[`Physics7_2 Matrices_Small_8 1`] = ` b - + c @@ -8731,8 +8731,8 @@ exports[`Physics7_2 Matrices_Small_9 1`] = ` [ - - + + a @@ -8741,7 +8741,7 @@ exports[`Physics7_2 Matrices_Small_9 1`] = ` b - + c @@ -8761,8 +8761,8 @@ exports[`Physics7_2 Matrices_Small_10 1`] = ` | - - + + a @@ -8771,7 +8771,7 @@ exports[`Physics7_2 Matrices_Small_10 1`] = ` b - + c @@ -8791,8 +8791,8 @@ exports[`Physics7_3 Matrices_SmallFenced_0 1`] = ` ( - - + + Q @@ -8805,8 +8805,8 @@ exports[`Physics7_3 Matrices_SmallFenced_0 1`] = ` ( - - + + R @@ -8824,8 +8824,8 @@ exports[`Physics7_3 Matrices_SmallFenced_1 1`] = ` - - + + Q @@ -8838,8 +8838,8 @@ exports[`Physics7_3 Matrices_SmallFenced_1 1`] = ` - - + + R @@ -8857,8 +8857,8 @@ exports[`Physics7_3 Matrices_SmallFenced_2 1`] = ` [ - - + + Q @@ -8871,8 +8871,8 @@ exports[`Physics7_3 Matrices_SmallFenced_2 1`] = ` [ - - + + R @@ -8890,8 +8890,8 @@ exports[`Physics7_3 Matrices_SmallFenced_3 1`] = ` | - - + + Q @@ -8904,8 +8904,8 @@ exports[`Physics7_3 Matrices_SmallFenced_3 1`] = ` | - - + + R @@ -8923,8 +8923,8 @@ exports[`Physics7_3 Matrices_SmallFenced_4 1`] = ` ( - - + + a @@ -8933,7 +8933,7 @@ exports[`Physics7_3 Matrices_SmallFenced_4 1`] = ` b - + c @@ -8953,8 +8953,8 @@ exports[`Physics7_3 Matrices_SmallFenced_5 1`] = ` - - + + a @@ -8963,7 +8963,7 @@ exports[`Physics7_3 Matrices_SmallFenced_5 1`] = ` b - + c @@ -8983,8 +8983,8 @@ exports[`Physics7_3 Matrices_SmallFenced_6 1`] = ` [ - - + + a @@ -8993,7 +8993,7 @@ exports[`Physics7_3 Matrices_SmallFenced_6 1`] = ` b - + c @@ -9013,8 +9013,8 @@ exports[`Physics7_3 Matrices_SmallFenced_7 1`] = ` | - - + + a @@ -9023,7 +9023,7 @@ exports[`Physics7_3 Matrices_SmallFenced_7 1`] = ` b - + c @@ -9042,8 +9042,8 @@ exports[`Physics7_4 Matrices_Det_0 1`] = ` " | - - + + a @@ -9051,7 +9051,7 @@ exports[`Physics7_4 Matrices_Det_0 1`] = ` b - + c @@ -9069,8 +9069,8 @@ exports[`Physics7_4 Matrices_Det_1 1`] = ` " | - - + + a @@ -9078,7 +9078,7 @@ exports[`Physics7_4 Matrices_Det_1 1`] = ` b - + c @@ -9097,8 +9097,8 @@ exports[`Physics7_4 Matrices_Det_2 1`] = ` | - - + + a @@ -9107,7 +9107,7 @@ exports[`Physics7_4 Matrices_Det_2 1`] = ` b - + c @@ -9126,8 +9126,8 @@ exports[`Physics7_4 Matrices_Det_3 1`] = ` " | - - + + a @@ -9143,8 +9143,8 @@ exports[`Physics7_4 Matrices_Det_4 1`] = ` " | - - + + a @@ -9161,8 +9161,8 @@ exports[`Physics7_4 Matrices_Det_5 1`] = ` | - - + + a @@ -9179,7 +9179,7 @@ exports[`Physics7_4 Matrices_Det_5 1`] = ` exports[`Physics7_5 Matrices_Identity_0 1`] = ` " - + 1 @@ -9190,7 +9190,7 @@ exports[`Physics7_5 Matrices_Identity_0 1`] = ` 0 - + 0 @@ -9201,7 +9201,7 @@ exports[`Physics7_5 Matrices_Identity_0 1`] = ` 0 - + 0 @@ -9220,8 +9220,8 @@ exports[`Physics7_5 Matrices_Identity_1 1`] = ` " | - - + + 1 @@ -9238,7 +9238,7 @@ exports[`Physics7_5 Matrices_Identity_1 1`] = ` 0 - + 0 @@ -9255,7 +9255,7 @@ exports[`Physics7_5 Matrices_Identity_1 1`] = ` 0 - + 0 @@ -9272,7 +9272,7 @@ exports[`Physics7_5 Matrices_Identity_1 1`] = ` 0 - + 0 @@ -9289,7 +9289,7 @@ exports[`Physics7_5 Matrices_Identity_1 1`] = ` 0 - + 0 @@ -9316,8 +9316,8 @@ exports[`Physics7_5 Matrices_Identity_2 1`] = ` " | - - + + 1 @@ -9332,8 +9332,8 @@ exports[`Physics7_5 Matrices_Identity_3 1`] = ` " | - - + + 1 @@ -9348,8 +9348,8 @@ exports[`Physics7_5 Matrices_Identity_4 1`] = ` " | - - + + 1 @@ -9364,8 +9364,8 @@ exports[`Physics7_5 Matrices_Identity_5 1`] = ` " ( - - + + 1 @@ -9376,7 +9376,7 @@ exports[`Physics7_5 Matrices_Identity_5 1`] = ` 0 - + 0 @@ -9387,7 +9387,7 @@ exports[`Physics7_5 Matrices_Identity_5 1`] = ` 0 - + 0 @@ -9402,7 +9402,7 @@ exports[`Physics7_5 Matrices_Identity_5 1`] = ` 0 - + 0 @@ -9421,8 +9421,8 @@ exports[`Physics7_6 Matrices_XMatrix_0 1`] = ` ( - - + + 1 @@ -9434,7 +9434,7 @@ exports[`Physics7_6 Matrices_XMatrix_0 1`] = ` 1 - + 1 @@ -9457,8 +9457,8 @@ exports[`Physics7_6 Matrices_XMatrix_1 1`] = ` ( - - + + a @@ -9470,7 +9470,7 @@ exports[`Physics7_6 Matrices_XMatrix_1 1`] = ` a - + a @@ -9481,7 +9481,7 @@ exports[`Physics7_6 Matrices_XMatrix_1 1`] = ` a - + a @@ -9504,19 +9504,19 @@ exports[`Physics7_6 Matrices_XMatrix_2 1`] = ` ( - - + + a - + a - + a @@ -9533,8 +9533,8 @@ exports[`Physics7_6 Matrices_XMatrix_3 1`] = ` ( - - + + a @@ -9558,8 +9558,8 @@ exports[`Physics7_6 Matrices_XMatrix_4 1`] = ` ( - - + + @@ -9601,7 +9601,7 @@ exports[`Physics7_6 Matrices_XMatrix_4 1`] = ` - + 1 @@ -9654,8 +9654,8 @@ exports[`Physics7_6 Matrices_XMatrix_5 1`] = ` ( - - + + @@ -9697,7 +9697,7 @@ exports[`Physics7_6 Matrices_XMatrix_5 1`] = ` - + a @@ -9738,7 +9738,7 @@ exports[`Physics7_6 Matrices_XMatrix_5 1`] = ` - + a @@ -9791,8 +9791,8 @@ exports[`Physics7_6 Matrices_XMatrix_6 1`] = ` ( - - + + @@ -9803,7 +9803,7 @@ exports[`Physics7_6 Matrices_XMatrix_6 1`] = ` - + a @@ -9813,7 +9813,7 @@ exports[`Physics7_6 Matrices_XMatrix_6 1`] = ` - + a @@ -9835,8 +9835,8 @@ exports[`Physics7_6 Matrices_XMatrix_7 1`] = ` ( - - + + @@ -9875,8 +9875,8 @@ exports[`Physics7_6 Matrices_XMatrix_8 1`] = ` ( - - + + a @@ -9894,8 +9894,8 @@ exports[`Physics7_6 Matrices_XMatrix_9 1`] = ` ( - - + + a @@ -9913,8 +9913,8 @@ exports[`Physics7_6 Matrices_XMatrix_10 1`] = ` ( - - + + 0 @@ -9938,8 +9938,8 @@ exports[`Physics7_6 Matrices_XMatrix_11 1`] = ` ( - - + + 0 @@ -9951,7 +9951,7 @@ exports[`Physics7_6 Matrices_XMatrix_11 1`] = ` 0 - + 0 @@ -9974,19 +9974,19 @@ exports[`Physics7_6 Matrices_XMatrix_12 1`] = ` ( - - + + 0 - + 0 - + 0 @@ -10001,7 +10001,7 @@ exports[`Physics7_6 Matrices_XMatrix_12 1`] = ` exports[`Physics7_7 Matrices_Pauli_0 1`] = ` " - + 1 @@ -10009,7 +10009,7 @@ exports[`Physics7_7 Matrices_Pauli_0 1`] = ` 0 - + 0 @@ -10025,8 +10025,8 @@ exports[`Physics7_7 Matrices_Pauli_1 1`] = ` " ( - - + + 1 @@ -10034,7 +10034,7 @@ exports[`Physics7_7 Matrices_Pauli_1 1`] = ` 0 - + 0 @@ -10051,7 +10051,7 @@ exports[`Physics7_7 Matrices_Pauli_1 1`] = ` exports[`Physics7_7 Matrices_Pauli_2 1`] = ` " - + 0 @@ -10059,7 +10059,7 @@ exports[`Physics7_7 Matrices_Pauli_2 1`] = ` 1 - + 1 @@ -10074,7 +10074,7 @@ exports[`Physics7_7 Matrices_Pauli_2 1`] = ` exports[`Physics7_7 Matrices_Pauli_3 1`] = ` " - + 0 @@ -10083,7 +10083,7 @@ exports[`Physics7_7 Matrices_Pauli_3 1`] = ` i - + i @@ -10098,7 +10098,7 @@ exports[`Physics7_7 Matrices_Pauli_3 1`] = ` exports[`Physics7_7 Matrices_Pauli_4 1`] = ` " - + 1 @@ -10106,7 +10106,7 @@ exports[`Physics7_7 Matrices_Pauli_4 1`] = ` 0 - + 0 @@ -10128,7 +10128,7 @@ exports[`Physics7_7 Matrices_Pauli_5 1`] = ` exports[`Physics7_7 Matrices_Pauli_6 1`] = ` " - + 0 @@ -10136,7 +10136,7 @@ exports[`Physics7_7 Matrices_Pauli_6 1`] = ` 1 - + 1 @@ -10151,7 +10151,7 @@ exports[`Physics7_7 Matrices_Pauli_6 1`] = ` exports[`Physics7_7 Matrices_Pauli_7 1`] = ` " - + 0 @@ -10160,7 +10160,7 @@ exports[`Physics7_7 Matrices_Pauli_7 1`] = ` i - + i @@ -10175,7 +10175,7 @@ exports[`Physics7_7 Matrices_Pauli_7 1`] = ` exports[`Physics7_7 Matrices_Pauli_8 1`] = ` " - + 1 @@ -10183,7 +10183,7 @@ exports[`Physics7_7 Matrices_Pauli_8 1`] = ` 0 - + 0 @@ -10206,7 +10206,7 @@ exports[`Physics7_7 Matrices_Pauli_10 1`] = ` " ( - + ) " @@ -10215,7 +10215,7 @@ exports[`Physics7_7 Matrices_Pauli_10 1`] = ` exports[`Physics7_7 Matrices_Pauli_11 1`] = ` " - + a @@ -10228,8 +10228,8 @@ exports[`Physics7_7 Matrices_Pauli_12 1`] = ` " ( - - + + . a @@ -10239,7 +10239,7 @@ exports[`Physics7_7 Matrices_Pauli_12 1`] = ` 0 - + 0 @@ -10257,8 +10257,8 @@ exports[`Physics7_8 Matrices_PauliFenced_0 1`] = ` " ( - - + + 0 @@ -10266,7 +10266,7 @@ exports[`Physics7_8 Matrices_PauliFenced_0 1`] = ` 1 - + 1 @@ -10284,8 +10284,8 @@ exports[`Physics7_8 Matrices_PauliFenced_1 1`] = ` " ( - - + + 0 @@ -10294,7 +10294,7 @@ exports[`Physics7_8 Matrices_PauliFenced_1 1`] = ` i - + i @@ -10312,8 +10312,8 @@ exports[`Physics7_8 Matrices_PauliFenced_2 1`] = ` " ( - - + + 1 @@ -10321,7 +10321,7 @@ exports[`Physics7_8 Matrices_PauliFenced_2 1`] = ` 0 - + 0 @@ -10340,7 +10340,7 @@ exports[`Physics7_8 Matrices_PauliFenced_3 1`] = ` " ( - + ) " @@ -10350,8 +10350,8 @@ exports[`Physics7_8 Matrices_PauliFenced_4 1`] = ` " ( - - + + 0 @@ -10359,7 +10359,7 @@ exports[`Physics7_8 Matrices_PauliFenced_4 1`] = ` 1 - + 1 @@ -10377,8 +10377,8 @@ exports[`Physics7_8 Matrices_PauliFenced_5 1`] = ` " ( - - + + 0 @@ -10387,7 +10387,7 @@ exports[`Physics7_8 Matrices_PauliFenced_5 1`] = ` i - + i @@ -10405,8 +10405,8 @@ exports[`Physics7_8 Matrices_PauliFenced_6 1`] = ` " ( - - + + 1 @@ -10414,7 +10414,7 @@ exports[`Physics7_8 Matrices_PauliFenced_6 1`] = ` 0 - + 0 @@ -10433,8 +10433,8 @@ exports[`Physics7_8 Matrices_PauliFenced_7 1`] = ` " ( - - + + a @@ -10449,11 +10449,11 @@ exports[`Physics7_9 Matrices_Diag_0 1`] = ` " ( - - + + - + 1 @@ -10461,11 +10461,11 @@ exports[`Physics7_9 Matrices_Diag_0 1`] = ` - + - + 2 @@ -10473,7 +10473,7 @@ exports[`Physics7_9 Matrices_Diag_0 1`] = ` 3 - + 4 @@ -10494,8 +10494,8 @@ exports[`Physics7_9 Matrices_Diag_1 1`] = ` " ( - - + + 1 @@ -10510,8 +10510,8 @@ exports[`Physics7_9 Matrices_Diag_2 1`] = ` " ( - - + + 1 , @@ -10528,11 +10528,11 @@ exports[`Physics7_9 Matrices_Diag_3 1`] = ` " ( - - + + - + 1 @@ -10540,11 +10540,11 @@ exports[`Physics7_9 Matrices_Diag_3 1`] = ` - + - + 2 @@ -10552,7 +10552,7 @@ exports[`Physics7_9 Matrices_Diag_3 1`] = ` 3 - + 4 @@ -10566,12 +10566,12 @@ exports[`Physics7_9 Matrices_Diag_3 1`] = ` - + - + 7 @@ -10579,13 +10579,13 @@ exports[`Physics7_9 Matrices_Diag_3 1`] = ` - + - + 8 @@ -10603,11 +10603,11 @@ exports[`Physics7_9 Matrices_Diag_4 1`] = ` " ( - - + + - + 1 @@ -10615,11 +10615,11 @@ exports[`Physics7_9 Matrices_Diag_4 1`] = ` - + - + 2 @@ -10627,7 +10627,7 @@ exports[`Physics7_9 Matrices_Diag_4 1`] = ` 3 - + 4 @@ -10638,12 +10638,12 @@ exports[`Physics7_9 Matrices_Diag_4 1`] = ` - + - + 6 @@ -10651,13 +10651,13 @@ exports[`Physics7_9 Matrices_Diag_4 1`] = ` - + - + 7 @@ -10665,14 +10665,14 @@ exports[`Physics7_9 Matrices_Diag_4 1`] = ` - + - + 8 @@ -10690,11 +10690,11 @@ exports[`Physics7_9 Matrices_Diag_5 1`] = ` " ( - - + + - + 1 @@ -10702,31 +10702,31 @@ exports[`Physics7_9 Matrices_Diag_5 1`] = ` - + - + 2 - + 3 - + 4 - + 5 - + 6 @@ -10734,12 +10734,12 @@ exports[`Physics7_9 Matrices_Diag_5 1`] = ` - + - + 7 @@ -10747,13 +10747,13 @@ exports[`Physics7_9 Matrices_Diag_5 1`] = ` - + - + 8 @@ -10771,11 +10771,11 @@ exports[`Physics7_9 Matrices_Diag_6 1`] = ` " ( - - + + - + 1 @@ -10783,11 +10783,11 @@ exports[`Physics7_9 Matrices_Diag_6 1`] = ` - + - + 2 @@ -10795,7 +10795,7 @@ exports[`Physics7_9 Matrices_Diag_6 1`] = ` 3 - + 4 @@ -10809,12 +10809,12 @@ exports[`Physics7_9 Matrices_Diag_6 1`] = ` - + - + 7 @@ -10822,13 +10822,13 @@ exports[`Physics7_9 Matrices_Diag_6 1`] = ` - + - + 8 @@ -10836,17 +10836,17 @@ exports[`Physics7_9 Matrices_Diag_6 1`] = ` - + - - + + - + 9 @@ -10854,11 +10854,11 @@ exports[`Physics7_9 Matrices_Diag_6 1`] = ` - + - + 10 @@ -10879,12 +10879,12 @@ exports[`Physics7_10 Matrices_Adiag_0 1`] = ` " ( - - + + - + 1 @@ -10892,10 +10892,10 @@ exports[`Physics7_10 Matrices_Adiag_0 1`] = ` - + - + 2 @@ -10903,7 +10903,7 @@ exports[`Physics7_10 Matrices_Adiag_0 1`] = ` 3 - + 4 @@ -10924,8 +10924,8 @@ exports[`Physics7_10 Matrices_Adiag_1 1`] = ` " ( - - + + 1 @@ -10940,8 +10940,8 @@ exports[`Physics7_10 Matrices_Adiag_2 1`] = ` " ( - - + + 1 , @@ -10958,14 +10958,14 @@ exports[`Physics7_10 Matrices_Adiag_3 1`] = ` " ( - - + + - + 1 @@ -10973,12 +10973,12 @@ exports[`Physics7_10 Matrices_Adiag_3 1`] = ` - + - + 2 @@ -10986,7 +10986,7 @@ exports[`Physics7_10 Matrices_Adiag_3 1`] = ` 3 - + 4 @@ -11000,11 +11000,11 @@ exports[`Physics7_10 Matrices_Adiag_3 1`] = ` - + - + 7 @@ -11012,10 +11012,10 @@ exports[`Physics7_10 Matrices_Adiag_3 1`] = ` - + - + 8 @@ -11033,15 +11033,15 @@ exports[`Physics7_10 Matrices_Adiag_4 1`] = ` " ( - - + + - + 1 @@ -11049,13 +11049,13 @@ exports[`Physics7_10 Matrices_Adiag_4 1`] = ` - + - + 2 @@ -11063,7 +11063,7 @@ exports[`Physics7_10 Matrices_Adiag_4 1`] = ` 3 - + 4 @@ -11074,12 +11074,12 @@ exports[`Physics7_10 Matrices_Adiag_4 1`] = ` - + - + 6 @@ -11087,11 +11087,11 @@ exports[`Physics7_10 Matrices_Adiag_4 1`] = ` - + - + 7 @@ -11099,10 +11099,10 @@ exports[`Physics7_10 Matrices_Adiag_4 1`] = ` - + - + 8 @@ -11120,15 +11120,15 @@ exports[`Physics7_10 Matrices_Adiag_5 1`] = ` " ( - - + + - + 1 @@ -11136,13 +11136,13 @@ exports[`Physics7_10 Matrices_Adiag_5 1`] = ` - + - + 2 @@ -11150,7 +11150,7 @@ exports[`Physics7_10 Matrices_Adiag_5 1`] = ` 3 - + 4 @@ -11164,12 +11164,12 @@ exports[`Physics7_10 Matrices_Adiag_5 1`] = ` - + - + 7 @@ -11177,11 +11177,11 @@ exports[`Physics7_10 Matrices_Adiag_5 1`] = ` - + - + 8 @@ -11189,13 +11189,13 @@ exports[`Physics7_10 Matrices_Adiag_5 1`] = ` - + - - + + - + 9 @@ -11203,11 +11203,11 @@ exports[`Physics7_10 Matrices_Adiag_5 1`] = ` - + - + 10 @@ -11228,7 +11228,7 @@ exports[`Physics7_11 Matrices_Other_0 1`] = ` " ( - + ) a @@ -11239,7 +11239,7 @@ exports[`Physics7_11 Matrices_Other_1 1`] = ` " ( - + ) 1 @@ -11250,8 +11250,8 @@ exports[`Physics7_11 Matrices_Other_2 1`] = ` " ( - - + + @@ -11267,11 +11267,11 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` " ( - - + + - + 1 @@ -11279,11 +11279,11 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + - + 2 @@ -11294,12 +11294,12 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + - + 4 @@ -11310,7 +11310,7 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` 5 - + 4 @@ -11321,13 +11321,13 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + - + 33 @@ -11335,14 +11335,14 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + - + 4 @@ -11350,7 +11350,7 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + @@ -11358,7 +11358,7 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + 5 @@ -11366,7 +11366,7 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + @@ -11375,7 +11375,7 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + 7 @@ -11383,7 +11383,7 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + @@ -11393,17 +11393,17 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + 8 - + 0 - + 10 @@ -11411,7 +11411,7 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` 20 - + 3 @@ -11419,7 +11419,7 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + @@ -11430,7 +11430,7 @@ exports[`Physics7_11 Matrices_Other_3 1`] = ` - + 200 @@ -11448,11 +11448,11 @@ exports[`Physics7_11 Matrices_Other_4 1`] = ` " ( - - + + - + 1 @@ -11460,11 +11460,11 @@ exports[`Physics7_11 Matrices_Other_4 1`] = ` - + - + 2 @@ -11472,7 +11472,7 @@ exports[`Physics7_11 Matrices_Other_4 1`] = ` 3 - + 4 @@ -11493,11 +11493,11 @@ exports[`Physics7_11 Matrices_Other_5 1`] = ` " ( - - + + - + 1 @@ -11505,11 +11505,11 @@ exports[`Physics7_11 Matrices_Other_5 1`] = ` - + - + 2 @@ -11517,7 +11517,7 @@ exports[`Physics7_11 Matrices_Other_5 1`] = ` 3 - + 4 @@ -11531,12 +11531,12 @@ exports[`Physics7_11 Matrices_Other_5 1`] = ` - + - - + + 1 @@ -11547,7 +11547,7 @@ exports[`Physics7_11 Matrices_Other_5 1`] = ` 0 - + 0 @@ -11558,7 +11558,7 @@ exports[`Physics7_11 Matrices_Other_5 1`] = ` 0 - + 0 @@ -11572,13 +11572,13 @@ exports[`Physics7_11 Matrices_Other_5 1`] = ` - + - + 7 @@ -11586,14 +11586,14 @@ exports[`Physics7_11 Matrices_Other_5 1`] = ` - + - + 8 @@ -11601,18 +11601,18 @@ exports[`Physics7_11 Matrices_Other_5 1`] = ` - + - - + + - + 9 @@ -11620,11 +11620,11 @@ exports[`Physics7_11 Matrices_Other_5 1`] = ` - + - + 10 @@ -11645,11 +11645,11 @@ exports[`Physics7_11 Matrices_Other_6 1`] = ` " ( - - + + - + 1 @@ -11657,11 +11657,11 @@ exports[`Physics7_11 Matrices_Other_6 1`] = ` - + - + 2 @@ -11669,7 +11669,7 @@ exports[`Physics7_11 Matrices_Other_6 1`] = ` 3 - + 4 @@ -11683,12 +11683,12 @@ exports[`Physics7_11 Matrices_Other_6 1`] = ` - + - - + + 1 @@ -11699,7 +11699,7 @@ exports[`Physics7_11 Matrices_Other_6 1`] = ` 0 - + 0 @@ -11710,7 +11710,7 @@ exports[`Physics7_11 Matrices_Other_6 1`] = ` 0 - + 0 @@ -11724,13 +11724,13 @@ exports[`Physics7_11 Matrices_Other_6 1`] = ` - + - + 7 @@ -11760,8 +11760,8 @@ exports[`Physics7_11 Matrices_Other_7 1`] = ` exports[`Physics7_11 Matrices_Other_8 1`] = ` " - - + + a @@ -11769,7 +11769,7 @@ exports[`Physics7_11 Matrices_Other_8 1`] = ` b - + c @@ -11785,8 +11785,8 @@ exports[`Physics7_11 Matrices_Other_8 1`] = ` exports[`Physics7_11 Matrices_Other_9 1`] = ` " - - + + 1 @@ -11798,7 +11798,7 @@ exports[`Physics7_11 Matrices_Other_9 1`] = ` 0 - + 0 @@ -11809,7 +11809,7 @@ exports[`Physics7_11 Matrices_Other_9 1`] = ` 0 - + 0 @@ -11828,7 +11828,7 @@ exports[`Physics7_11 Matrices_Other_9 1`] = ` exports[`Physics7_11 Matrices_Other_10 1`] = ` " - + 1 @@ -11860,7 +11860,7 @@ exports[`Physics7_11 Matrices_Other_10 1`] = ` 0 - + 0 @@ -11892,7 +11892,7 @@ exports[`Physics7_11 Matrices_Other_10 1`] = ` 0 - + 0 @@ -11924,7 +11924,7 @@ exports[`Physics7_11 Matrices_Other_10 1`] = ` 0 - + 0 @@ -11956,7 +11956,7 @@ exports[`Physics7_11 Matrices_Other_10 1`] = ` 0 - + 0 @@ -11988,7 +11988,7 @@ exports[`Physics7_11 Matrices_Other_10 1`] = ` 0 - + 0 @@ -12020,7 +12020,7 @@ exports[`Physics7_11 Matrices_Other_10 1`] = ` 0 - + 0 @@ -12052,7 +12052,7 @@ exports[`Physics7_11 Matrices_Other_10 1`] = ` 0 - + 0 @@ -12084,7 +12084,7 @@ exports[`Physics7_11 Matrices_Other_10 1`] = ` 0 - + 0 @@ -12116,7 +12116,7 @@ exports[`Physics7_11 Matrices_Other_10 1`] = ` 0 - + 0 diff --git a/testsuite/tests/input/tex/__snapshots__/SetOptions.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/SetOptions.test.ts.snap index c73a13af8..3db061637 100644 --- a/testsuite/tests/input/tex/__snapshots__/SetOptions.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/SetOptions.test.ts.snap @@ -24,7 +24,7 @@ exports[`Setoptions Require Require with option 1`] = ` exports[`Setoptions Set TeX option 1`] = ` " - + ( 1 @@ -33,19 +33,13 @@ exports[`Setoptions Set TeX option 1`] = ` a = - b + b " `; -exports[`Setoptions Set pacjage regexp option 1`] = ` -" - ab1 -" -`; - exports[`Setoptions Set package boolean option 1`] = ` " 1 @@ -56,10 +50,16 @@ exports[`Setoptions Set package boolean option 1`] = ` " `; +exports[`Setoptions Set package regexp option 1`] = ` +" + ab1 +" +`; + exports[`Setoptions Set package string option 1`] = ` " - + a @@ -77,7 +77,7 @@ exports[`Setoptions Set regexp option with flags 1`] = ` exports[`Setoptions options allowOptionsDefault false ams multlineWidth true 1`] = ` " - + a @@ -89,7 +89,7 @@ exports[`Setoptions options allowOptionsDefault false ams multlineWidth true 1`] exports[`Setoptions options allowPackageDefault false ams true 1`] = ` " - + a @@ -101,7 +101,7 @@ exports[`Setoptions options allowPackageDefault false ams true 1`] = ` exports[`Setoptions options filterOption 1`] = ` " - + a @@ -113,7 +113,7 @@ exports[`Setoptions options filterOption 1`] = ` exports[`Setoptions options filterPackage 1`] = ` " - + a @@ -125,7 +125,7 @@ exports[`Setoptions options filterPackage 1`] = ` exports[`Setoptions options filterValue 1`] = ` " - + a diff --git a/testsuite/tests/input/tex/__snapshots__/Tag.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Tag.test.ts.snap index 79660e10a..7a5d585bb 100644 --- a/testsuite/tests/input/tex/__snapshots__/Tag.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Tag.test.ts.snap @@ -4,7 +4,7 @@ exports[`Page References Forward Reference 1`] = ` [ " - + ( 1 @@ -13,14 +13,14 @@ exports[`Page References Forward Reference 1`] = ` a = - b + b ", " - (1) + (1) ", ] @@ -30,12 +30,12 @@ exports[`Page References Forward Reference 2`] = ` [ " - (1) + (1) ", " - + ( 1 @@ -44,7 +44,7 @@ exports[`Page References Forward Reference 2`] = ` a = - b + b @@ -55,14 +55,14 @@ exports[`Page References Forward Reference 2`] = ` exports[`Page References LabelIds 1`] = ` " - + ( 1 ) - a + a @@ -72,7 +72,7 @@ exports[`Page References LabelIds 1`] = ` exports[`TagAll Align 1`] = ` " - + ( 1 @@ -89,7 +89,7 @@ exports[`TagAll Align 1`] = ` exports[`TagAll Align Two labels 1`] = ` " - + ( 1 @@ -98,10 +98,10 @@ exports[`TagAll Align Two labels 1`] = ` a = - b + b - + ( 2 @@ -114,7 +114,7 @@ exports[`TagAll Align Two labels 1`] = ` = - d + d @@ -125,19 +125,19 @@ exports[`TagAll Align Two labels 1`] = ` exports[`TagAll Eqref 1`] = ` " - + ( 1 ) - a + a - - (1) + + (1) " `; @@ -145,14 +145,14 @@ exports[`TagAll Eqref 1`] = ` exports[`TagAll Label 1`] = ` " - + ( 1 ) - a + a @@ -162,14 +162,14 @@ exports[`TagAll Label 1`] = ` exports[`TagAll Label Default 1`] = ` " - + ( 1 ) - a + a @@ -179,14 +179,14 @@ exports[`TagAll Label Default 1`] = ` exports[`TagAll Label Empty 1`] = ` " - + ( 1 ) - a + a @@ -196,14 +196,14 @@ exports[`TagAll Label Empty 1`] = ` exports[`TagAll Label Named 1`] = ` " - + ( A ) - a + a @@ -213,24 +213,24 @@ exports[`TagAll Label Named 1`] = ` exports[`TagAll Label Named Default 1`] = ` " - + ( A ) - a + a - + ( 1 ) - b + b @@ -240,24 +240,24 @@ exports[`TagAll Label Named Default 1`] = ` exports[`TagAll Label Named Named 1`] = ` " - + ( A ) - a + a - + ( B ) - b + b @@ -267,17 +267,17 @@ exports[`TagAll Label Named Named 1`] = ` exports[`TagAll MultLine 1`] = ` " - + a - + b - + ( 1 @@ -294,9 +294,9 @@ exports[`TagAll MultLine 1`] = ` exports[`TagAll Notag Align 1`] = ` " - + - a + a @@ -306,19 +306,19 @@ exports[`TagAll Notag Align 1`] = ` exports[`TagAll Notag Multline 1`] = ` " - + a - + b - + - c + c @@ -328,9 +328,9 @@ exports[`TagAll Notag Multline 1`] = ` exports[`TagAll Notag Tag 1`] = ` " - + - a + a @@ -340,19 +340,19 @@ exports[`TagAll Notag Tag 1`] = ` exports[`TagAll Ref 1`] = ` " - + ( 1 ) - a + a - - 1 + + 1 " `; @@ -360,19 +360,19 @@ exports[`TagAll Ref 1`] = ` exports[`TagAll Ref Default 1`] = ` " - + ( 1 ) - a + a - - 1 + + 1 " `; @@ -380,19 +380,19 @@ exports[`TagAll Ref Default 1`] = ` exports[`TagAll Ref Named 1`] = ` " - + ( A ) - a + a - - A + + A " `; @@ -400,32 +400,32 @@ exports[`TagAll Ref Named 1`] = ` exports[`TagAll Ref Named Default 1`] = ` " - + ( A ) - a + a - + ( 1 ) - b + b - - A + + A - - 1 + + 1 " `; @@ -433,32 +433,32 @@ exports[`TagAll Ref Named Default 1`] = ` exports[`TagAll Ref Named Named 1`] = ` " - + ( A ) - a + a - + ( B ) - b + b - - A + + A - - B + + B " `; @@ -466,19 +466,19 @@ exports[`TagAll Ref Named Named 1`] = ` exports[`TagAll Ref Unknown 1`] = ` " - + ( 1 ) - a + a - - ??? + + ??? " `; @@ -486,7 +486,7 @@ exports[`TagAll Ref Unknown 1`] = ` exports[`TagAll Single Expression 1`] = ` " - + ( 1 @@ -503,7 +503,7 @@ exports[`TagAll Single Expression 1`] = ` exports[`TagAll Tag Default 1`] = ` " - + ( 1 @@ -520,14 +520,14 @@ exports[`TagAll Tag Default 1`] = ` exports[`TagAll Tag Named 1`] = ` " - + ( A ) - a + a @@ -537,17 +537,17 @@ exports[`TagAll Tag Named 1`] = ` exports[`TagAll Tag Named Default 1`] = ` " - + ( A ) - a + a - + ( 1 @@ -564,24 +564,24 @@ exports[`TagAll Tag Named Default 1`] = ` exports[`TagAll Tag Named Named 1`] = ` " - + ( A ) - a + a - + ( B ) - b + b @@ -591,7 +591,7 @@ exports[`TagAll Tag Named Named 1`] = ` exports[`TagAms Align 1`] = ` " - + ( 1 @@ -608,7 +608,7 @@ exports[`TagAms Align 1`] = ` exports[`TagAms Align Two labels 1`] = ` " - + ( 1 @@ -617,10 +617,10 @@ exports[`TagAms Align Two labels 1`] = ` a = - b + b - + ( 2 @@ -633,7 +633,7 @@ exports[`TagAms Align Two labels 1`] = ` = - d + d @@ -644,19 +644,19 @@ exports[`TagAms Align Two labels 1`] = ` exports[`TagAms Eqref 1`] = ` " - + ( 1 ) - a + a - - (1) + + (1) " `; @@ -664,14 +664,14 @@ exports[`TagAms Eqref 1`] = ` exports[`TagAms Label 1`] = ` " - + ( 1 ) - a + a @@ -681,14 +681,14 @@ exports[`TagAms Label 1`] = ` exports[`TagAms Label Default 1`] = ` " - + ( 1 ) - a + a @@ -698,14 +698,14 @@ exports[`TagAms Label Default 1`] = ` exports[`TagAms Label Empty 1`] = ` " - + ( 1 ) - a + a @@ -715,14 +715,14 @@ exports[`TagAms Label Empty 1`] = ` exports[`TagAms Label Named 1`] = ` " - + ( A ) - a + a @@ -732,24 +732,24 @@ exports[`TagAms Label Named 1`] = ` exports[`TagAms Label Named Default 1`] = ` " - + ( A ) - a + a - + ( 1 ) - b + b @@ -759,24 +759,24 @@ exports[`TagAms Label Named Default 1`] = ` exports[`TagAms Label Named Named 1`] = ` " - + ( A ) - a + a - + ( B ) - b + b @@ -786,17 +786,17 @@ exports[`TagAms Label Named Named 1`] = ` exports[`TagAms MultLine 1`] = ` " - + a - + b - + ( 1 @@ -813,9 +813,9 @@ exports[`TagAms MultLine 1`] = ` exports[`TagAms Notag Align 1`] = ` " - + - a + a @@ -825,19 +825,19 @@ exports[`TagAms Notag Align 1`] = ` exports[`TagAms Notag Multline 1`] = ` " - + a - + b - + - c + c @@ -847,9 +847,9 @@ exports[`TagAms Notag Multline 1`] = ` exports[`TagAms Notag Tag 1`] = ` " - + - a + a @@ -859,19 +859,19 @@ exports[`TagAms Notag Tag 1`] = ` exports[`TagAms Ref 1`] = ` " - + ( 1 ) - a + a - - 1 + + 1 " `; @@ -879,19 +879,19 @@ exports[`TagAms Ref 1`] = ` exports[`TagAms Ref Default 1`] = ` " - + ( 1 ) - a + a - - 1 + + 1 " `; @@ -899,19 +899,19 @@ exports[`TagAms Ref Default 1`] = ` exports[`TagAms Ref Named 1`] = ` " - + ( A ) - a + a - - A + + A " `; @@ -919,32 +919,32 @@ exports[`TagAms Ref Named 1`] = ` exports[`TagAms Ref Named Default 1`] = ` " - + ( A ) - a + a - + ( 1 ) - b + b - - A + + A - - 1 + + 1 " `; @@ -952,32 +952,32 @@ exports[`TagAms Ref Named Default 1`] = ` exports[`TagAms Ref Named Named 1`] = ` " - + ( A ) - a + a - + ( B ) - b + b - - A + + A - - B + + B " `; @@ -985,19 +985,19 @@ exports[`TagAms Ref Named Named 1`] = ` exports[`TagAms Ref Unknown 1`] = ` " - + ( 1 ) - a + a - - ??? + + ??? " `; @@ -1011,7 +1011,7 @@ exports[`TagAms Single Expression 1`] = ` exports[`TagAms Split 1`] = ` " - + a @@ -1023,7 +1023,7 @@ exports[`TagAms Split 1`] = ` exports[`TagAms Tag Default 1`] = ` " - + ( 1 @@ -1040,14 +1040,14 @@ exports[`TagAms Tag Default 1`] = ` exports[`TagAms Tag Named 1`] = ` " - + ( A ) - a + a @@ -1057,17 +1057,17 @@ exports[`TagAms Tag Named 1`] = ` exports[`TagAms Tag Named Default 1`] = ` " - + ( A ) - a + a - + ( 1 @@ -1084,24 +1084,24 @@ exports[`TagAms Tag Named Default 1`] = ` exports[`TagAms Tag Named Named 1`] = ` " - + ( A ) - a + a - + ( B ) - b + b @@ -1111,7 +1111,7 @@ exports[`TagAms Tag Named Named 1`] = ` exports[`TagNone Align 1`] = ` " - + a @@ -1123,14 +1123,14 @@ exports[`TagNone Align 1`] = ` exports[`TagNone Eqref 1`] = ` " - + - a + a - - (???) + + (???) " `; @@ -1138,9 +1138,9 @@ exports[`TagNone Eqref 1`] = ` exports[`TagNone Label 1`] = ` " - + - a + a @@ -1150,9 +1150,9 @@ exports[`TagNone Label 1`] = ` exports[`TagNone Label Default 1`] = ` " - + - a + a @@ -1162,9 +1162,9 @@ exports[`TagNone Label Default 1`] = ` exports[`TagNone Label Empty 1`] = ` " - + - a + a @@ -1174,14 +1174,14 @@ exports[`TagNone Label Empty 1`] = ` exports[`TagNone Label Named 1`] = ` " - + ( A ) - a + a @@ -1191,19 +1191,19 @@ exports[`TagNone Label Named 1`] = ` exports[`TagNone Label Named Default 1`] = ` " - + ( A ) - a + a - + - b + b @@ -1213,24 +1213,24 @@ exports[`TagNone Label Named Default 1`] = ` exports[`TagNone Label Named Named 1`] = ` " - + ( A ) - a + a - + ( B ) - b + b @@ -1240,17 +1240,17 @@ exports[`TagNone Label Named Named 1`] = ` exports[`TagNone MultLine 1`] = ` " - + a - + b - + c @@ -1262,9 +1262,9 @@ exports[`TagNone MultLine 1`] = ` exports[`TagNone Notag Align 1`] = ` " - + - a + a @@ -1274,19 +1274,19 @@ exports[`TagNone Notag Align 1`] = ` exports[`TagNone Notag Multline 1`] = ` " - + a - + b - + - c + c @@ -1296,9 +1296,9 @@ exports[`TagNone Notag Multline 1`] = ` exports[`TagNone Notag Tag 1`] = ` " - + - a + a @@ -1308,14 +1308,14 @@ exports[`TagNone Notag Tag 1`] = ` exports[`TagNone Ref 1`] = ` " - + - a + a - - ??? + + ??? " `; @@ -1323,14 +1323,14 @@ exports[`TagNone Ref 1`] = ` exports[`TagNone Ref Default 1`] = ` " - + - a + a - - ??? + + ??? " `; @@ -1338,19 +1338,19 @@ exports[`TagNone Ref Default 1`] = ` exports[`TagNone Ref Named 1`] = ` " - + ( A ) - a + a - - A + + A " `; @@ -1358,27 +1358,27 @@ exports[`TagNone Ref Named 1`] = ` exports[`TagNone Ref Named Default 1`] = ` " - + ( A ) - a + a - + - b + b - - A + + A - - ??? + + ??? " `; @@ -1386,32 +1386,32 @@ exports[`TagNone Ref Named Default 1`] = ` exports[`TagNone Ref Named Named 1`] = ` " - + ( A ) - a + a - + ( B ) - b + b - - A + + A - - B + + B " `; @@ -1419,14 +1419,14 @@ exports[`TagNone Ref Named Named 1`] = ` exports[`TagNone Ref Unknown 1`] = ` " - + - a + a - - ??? + + ??? " `; @@ -1434,14 +1434,14 @@ exports[`TagNone Ref Unknown 1`] = ` exports[`TagNone Simple Tag 1`] = ` " - + ( 0 ) - a + a @@ -1457,7 +1457,7 @@ exports[`TagNone Single Expression 1`] = ` exports[`TagNone Split 1`] = ` " - + a @@ -1469,7 +1469,7 @@ exports[`TagNone Split 1`] = ` exports[`TagNone Tag Default 1`] = ` " - + a @@ -1481,14 +1481,14 @@ exports[`TagNone Tag Default 1`] = ` exports[`TagNone Tag Named 1`] = ` " - + ( A ) - a + a @@ -1498,17 +1498,17 @@ exports[`TagNone Tag Named 1`] = ` exports[`TagNone Tag Named Default 1`] = ` " - + ( A ) - a + a - + b @@ -1520,24 +1520,24 @@ exports[`TagNone Tag Named Default 1`] = ` exports[`TagNone Tag Named Named 1`] = ` " - + ( A ) - a + a - + ( B ) - b + b diff --git a/testsuite/tests/input/tex/__snapshots__/TagFormat.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/TagFormat.test.ts.snap index d32e09fc4..2714b6037 100644 --- a/testsuite/tests/input/tex/__snapshots__/TagFormat.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/TagFormat.test.ts.snap @@ -3,14 +3,14 @@ exports[`Tagformat Array tag 1`] = ` " - + | 1 | - x + x @@ -20,13 +20,13 @@ exports[`Tagformat Array tag 1`] = ` exports[`Tagformat Array tag with empty entry 1`] = ` " - + 1 . - x + x @@ -36,13 +36,13 @@ exports[`Tagformat Array tag with empty entry 1`] = ` exports[`Tagformat Array tag with null entry 1`] = ` " - + 1 . - x + x @@ -52,14 +52,14 @@ exports[`Tagformat Array tag with null entry 1`] = ` exports[`Tagformat Basic tag 1`] = ` " - + [ 1 ] - x + x @@ -69,25 +69,25 @@ exports[`Tagformat Basic tag 1`] = ` exports[`Tagformat Custom ref 1`] = ` " - + ( x ) - x + x - + ( 1 ) - - **x** + + **x** @@ -98,25 +98,25 @@ exports[`Tagformat Custom ref 1`] = ` exports[`Tagformat Eqref 1`] = ` " - + [ x ] - x + x - + [ A1 ] - - [x] + + [x] @@ -127,25 +127,25 @@ exports[`Tagformat Eqref 1`] = ` exports[`Tagformat Ref 1`] = ` " - + [ x ] - x + x - + [ A1 ] - - x + + x @@ -156,14 +156,14 @@ exports[`Tagformat Ref 1`] = ` exports[`Tagformat Text tag 1`] = ` " - + [ x ] - x + x diff --git a/testsuite/tests/input/tex/__snapshots__/Tex.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Tex.test.ts.snap index 3c6ca50f5..01b104ff7 100644 --- a/testsuite/tests/input/tex/__snapshots__/Tex.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Tex.test.ts.snap @@ -46,7 +46,7 @@ exports[`FindTeX ref undefined 1`] = ` [ " - ??? + ??? ", ] @@ -94,7 +94,7 @@ exports[`TexParser GetBrackets nested [ 1`] = ` exports[`TexParser Removed delimiter 1`] = ` " - + a diff --git a/testsuite/tests/input/tex/__snapshots__/Textmacros.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Textmacros.test.ts.snap index c876abb13..ab7400a49 100644 --- a/testsuite/tests/input/tex/__snapshots__/Textmacros.test.ts.snap +++ b/testsuite/tests/input/tex/__snapshots__/Textmacros.test.ts.snap @@ -181,11 +181,11 @@ exports[`Textmacros Macros Quoted Specials 1`] = ` exports[`Textmacros Macros Ref and Eqref 1`] = ` " - - ??? + + ??? - - (???) + + (???) " @@ -593,8 +593,8 @@ exports[`Textmacros Text ref 1`] = ` " - - ??? + + ??? " diff --git a/ts/input/tex.ts b/ts/input/tex.ts index 205ecd4ff..5b27367a2 100644 --- a/ts/input/tex.ts +++ b/ts/input/tex.ts @@ -161,6 +161,7 @@ export class TeX extends AbstractInputJax { [FilterUtil.cleanSubSup, -7], [FilterUtil.setInherited, -6], [FilterUtil.checkScriptlevel, -5], + [FilterUtil.fixArrayLatex, -4.5], [FilterUtil.moveLimits, -4], [FilterUtil.cleanStretchy, -3], [FilterUtil.cleanAttributes, -2], diff --git a/ts/input/tex/FilterUtil.ts b/ts/input/tex/FilterUtil.ts index 0252d8b0f..bc21e0828 100644 --- a/ts/input/tex/FilterUtil.ts +++ b/ts/input/tex/FilterUtil.ts @@ -341,6 +341,62 @@ const FilterUtil = { } options.removeFromList('mstyle', remove); }, + + /** + * Fixes the `data-latex` attribute of mtable nodes produced by array-like + * environments, in the cases where the parser's string was rewritten during + * parsing: + * + * - Column templates rewrite the parser's string entry by entry, so we end up + * using a leftover fragment instead of the actual source. + * + * - When the table is nested inside another environment (e.g., inside a + * tagged equation, or another array), `addLatexItem` sets `data-latex` from + * the `\end{name}` argument alone (e.g., `{array}`), which is wrong. + * + * This filter only replaces a `data-latex` value that looks missing or + * broken, so that already correct values (e.g., the literal source of a bare + * top-level array, or the macro call for macros that build their own + * array-like content) are left alone. + * + * @param {object} arg The argument object. + * @param {ParseOptions} arg.data The parse options. + */ + fixArrayLatex(arg: { data: ParseOptions }) { + const LATEX = TexConstant.Attr.LATEX; + for (const mml of arg.data.getList('mtable')) { + const tex = mml.getProperty('rawLatex') as string; + if (!tex) continue; + const name = mml.getProperty('rawLatexName') as string; + const current = mml.attributes.getExplicit(LATEX) as string; + if (!current || FilterUtil.isBrokenArrayLatex(current, name)) { + mml.attributes.set(TexConstant.Attr.LATEXITEM, tex); + mml.attributes.set(LATEX, tex); + } + } + }, + + /** + * Checks whether a `data-latex` value looks like one of the broken fragments, + * rather than a genuine, complete piece of LaTeX source. + * + * This could be fragile or incomplete! + * + * @param {string} current The current `data-latex` value. + * @param {string} name The environment name (e.g., `array`, `matrix`). + * @returns {boolean} True if the value looks broken. + */ + isBrokenArrayLatex(current: string, name: string): boolean { + if (current === `{${name}}`) { + // @test Ams Issues Array with Tag + return true; + } + // @test Complete Array column r c l > + return ( + current.includes(`\\end{${name}}`) && + !current.includes(`\\begin{${name}}`) + ); + }, }; export default FilterUtil; diff --git a/ts/input/tex/NodeUtil.ts b/ts/input/tex/NodeUtil.ts index d04028da2..fb678c393 100644 --- a/ts/input/tex/NodeUtil.ts +++ b/ts/input/tex/NodeUtil.ts @@ -32,6 +32,7 @@ import { MmlMo } from '../../core/MmlTree/MmlNodes/mo.js'; import { Property, PropertyList } from '../../core/Tree/Node.js'; import { Args } from './Types.js'; import { OperatorDef } from '../../core/MmlTree/OperatorDictionary.js'; +import { TexConstant } from './TexConstants.js'; const NodeUtil = { attrs: new Set([ @@ -78,6 +79,32 @@ const NodeUtil = { return node.getText(); }, + /** + * Reconstructs the LaTeX source of a node (e.g., an mtd) from the + * `data-latex` attributes of the children of its first child (e.g., to + * rebuild the source of a table cell from its content nodes). + * + * @param {MmlNode} node The node whose content's LaTeX source should be + * reconstructed. + * @returns {string} The reconstructed LaTeX source. + */ + getChildrenLatex(node: MmlNode): string { + const children = node.childNodes[0]?.childNodes || []; + let expr = ''; + for (const child of children) { + // For table child we prefer the `rawLatex` property. + const att = ((child as MmlNode)?.getProperty?.('rawLatex') || + (child as MmlNode)?.attributes?.get(TexConstant.Attr.LATEX) || + '') as string; + if (!att) continue; + expr += + expr && expr.match(/[a-zA-Z]$/) && att.match(/^[a-zA-Z]/) + ? ' ' + att + : att; + } + return expr; + }, + /** * Append children to a node. * diff --git a/ts/input/tex/Tags.ts b/ts/input/tex/Tags.ts index 7e4f87749..703e9bc3d 100644 --- a/ts/input/tex/Tags.ts +++ b/ts/input/tex/Tags.ts @@ -26,6 +26,8 @@ import { MmlNode } from '../../core/MmlTree/MmlNode.js'; import { MathItem } from '../../core/MathItem.js'; import { EnvList } from './StackItem.js'; import ParseOptions from './ParseOptions.js'; +import NodeUtil from './NodeUtil.js'; +import { TexConstant } from './TexConstants.js'; import { Locale } from '../../util/Locale.js'; import { COMPONENT } from './__locales__/Component.js'; @@ -537,6 +539,14 @@ export class AbstractTags implements Tags { const nf = this.configuration.nodeFactory; const cell = nf.create('node', 'mtd', [node]); const row = nf.create('node', 'mlabeledtr', [tag, cell]); + const latex = [ + NodeUtil.getChildrenLatex(tag), + NodeUtil.getChildrenLatex(cell), + ].join('&'); + if (latex) { + row.attributes.set(TexConstant.Attr.LATEXITEM, latex); + row.attributes.set(TexConstant.Attr.LATEX, latex); + } const table = nf.create('node', 'mtable', [row], { side: this.configuration.options['tagSide'], minlabelspacing: this.configuration.options['tagIndent'], diff --git a/ts/input/tex/TexParser.ts b/ts/input/tex/TexParser.ts index 7e6117732..38405415f 100644 --- a/ts/input/tex/TexParser.ts +++ b/ts/input/tex/TexParser.ts @@ -74,6 +74,12 @@ export default class TexParser { */ private saveI: number = 0; + /** + * Set by skipLatex() to tell the next call to updateResult() that LaTeX + * sources of the current macro does not produce an Mml node. + */ + private _skipLatex: boolean = false; + /** * @class * @param {string} _string The string to parse. @@ -246,6 +252,15 @@ export default class TexParser { } } + /** + * Marks the LaTeX source as skippable, so macros producing no Mml node (e.g., + * \label, \tag, \notag) do not have their source code attached to the + * `data-latex` attribute of the most recently created node. + */ + public skipLatex() { + this._skipLatex = true; + } + /** * @returns {MmlNode} The internal Mathml structure. */ @@ -608,6 +623,10 @@ export default class TexParser { */ // Currently works without translating environments that generate typesetting. private updateResult(input: string, old: number) { + if (this._skipLatex) { + this._skipLatex = false; + return; + } const node = this.stack.Prev(true) as MmlNode; if (!node) { return; diff --git a/ts/input/tex/ams/AmsItems.ts b/ts/input/tex/ams/AmsItems.ts index c4f122a93..1e06b30a7 100644 --- a/ts/input/tex/ams/AmsItems.ts +++ b/ts/input/tex/ams/AmsItems.ts @@ -70,6 +70,7 @@ export class MultlineItem extends ArrayItem { ); this.setProperty('shove', null); this.row.push(mtd); + this.rowLatex.push(this.cellLatex(mtd)); this.Clear(); } @@ -82,8 +83,10 @@ export class MultlineItem extends ArrayItem { texError(COMPONENT, 'MultlineRowsOneCol', 'multline'); } const row = this.create('node', 'mtr', this.row); + this.setRowLatex(row); this.table.push(row); this.row = []; + this.rowLatex = []; } /** @@ -131,6 +134,16 @@ export class MultlineItem extends ArrayItem { [tag].concat(NodeUtil.getChildren(mtr)) ); NodeUtil.copyAttributes(mtr, mlabel); + const latex = [ + this.cellLatex(tag), + mtr.attributes.get(TexConstant.Attr.LATEX), + ] + .filter((x) => x) + .join('&'); + if (latex) { + mlabel.attributes.set(TexConstant.Attr.LATEXITEM, latex); + mlabel.attributes.set(TexConstant.Attr.LATEX, latex); + } this.table[label] = mlabel; } } diff --git a/ts/input/tex/ams/AmsMethods.ts b/ts/input/tex/ams/AmsMethods.ts index 9b0254645..28153f527 100644 --- a/ts/input/tex/ams/AmsMethods.ts +++ b/ts/input/tex/ams/AmsMethods.ts @@ -765,6 +765,7 @@ export const AmsMethods: { [key: string]: ParseMethod } = { const tagId = UnitUtil.trimSpaces(parser.GetArgument(name)); parser.tags.tag(tagId, star); parser.Push(parser.itemFactory.create('null')); + parser.skipLatex(); }, HandleNoTag: BaseMethods.HandleNoTag, diff --git a/ts/input/tex/base/BaseItems.ts b/ts/input/tex/base/BaseItems.ts index 46c27a908..4f4ee73a7 100644 --- a/ts/input/tex/base/BaseItems.ts +++ b/ts/input/tex/base/BaseItems.ts @@ -38,6 +38,7 @@ import StackItemFactory from '../StackItemFactory.js'; import { CheckType, BaseItem, StackItem, EnvList } from '../StackItem.js'; import { TRBL } from '../../../util/Styles.js'; import { TexConstant } from '../TexConstants.js'; +import { quotePattern } from '../../../util/string.js'; import { COMPONENT as TEX_COMPONENT } from '../__locales__/Component.js'; import { COMPONENT } from './__locales__/Component.js'; @@ -961,6 +962,14 @@ export class ArrayItem extends BaseItem { */ public row: MmlNode[] = []; + /** + * The LaTeX source for the content cells of the current row, used to + * reconstruct the `data-latex` attribute of the row (mtr/mlabeledtr) node. + * + * @type {string[]} + */ + public rowLatex: string[] = []; + /** * Frame specification as a list of pairs of strings [side, style]. * @@ -1095,6 +1104,7 @@ export class ArrayItem extends BaseItem { const scriptlevel = this.arraydef['scriptlevel']; delete this.arraydef['scriptlevel']; let mml = this.create('node', 'mtable', this.table, this.arraydef); + this.setTableLatex(mml); if (scriptlevel) { mml.setProperty('smallmatrix', true); } @@ -1111,7 +1121,13 @@ export class ArrayItem extends BaseItem { } mml = this.handleFrame(mml); if (scriptlevel !== undefined) { + const table = mml; mml = this.create('node', 'mstyle', [mml], { scriptlevel }); + const rawLatex = table.getProperty('rawLatex'); + if (rawLatex) { + mml.setProperty('rawLatex', rawLatex); + mml.setProperty('rawLatexName', table.getProperty('rawLatexName')); + } } if (this.getProperty('open') || this.getProperty('close')) { // @test Cross Product Formula @@ -1338,6 +1354,7 @@ export class ArrayItem extends BaseItem { this.breakAlign.cell = ''; // this.row.push(mtd); + this.rowLatex.push(this.cellLatex(mtd)); this.Clear(); this.hfill = []; } @@ -1362,12 +1379,160 @@ export class ArrayItem extends BaseItem { NodeUtil.setAttribute(node, 'data-break-align', this.breakAlign.row); this.breakAlign.row = ''; } - this.addLatexItem(node); + this.setRowLatex(node); this.table.push(node); this.row = []; + this.rowLatex = []; this.atEnd = false; } + /** + * Reconstructs the LaTeX source of a single table cell from the `data-latex` + * attributes of its content nodes. + * + * @param {MmlNode} mtd The mtd node whose content is reconstructed. + * @returns {string} The LaTeX source of the cell content. + */ + public cellLatex(mtd: MmlNode): string { + return NodeUtil.getChildrenLatex(mtd); + } + + /** + * Captures the LaTeX source of this array/table environment (e.g., `>{...}`, + * `<{...}`, `@{...}`, or `!{...}`) before any entry-template substitutions + * are made. + * + * @param {TexParser} parser The current parser, positioned right after + * `\begin{name}`, before the column-alignment argument (if any) has + * been read. + * @param {string} name The environment name (e.g., `array`, `matrix`). + */ + public captureLatex(parser: TexParser, name: string) { + this.setProperty('rawLatexName', name); + const source = parser.string.slice(parser.i); + const end = ArrayItem.findEnvEnd(source, name); + if (end >= 0) { + this.setProperty('rawLatex', `\\begin{${name}}${source.slice(0, end)}`); + return; + } + // No matching \end{name} could be found (e.g., produced by + // \newenvironment), save the start position instead, so the raw source can + // be taken from the parser's string once the table actually closes. + this.setProperty('rawLatexStart', parser.i); + this.setProperty( + 'rawLatexGen', + (parser.stack.global['envSplice'] as number) || 0 + ); + } + + /** + * Stashes the original source when a table is opened as a fall-back value for + * `data-latex` if the the postprocessing filter decides the attribute is + * incorrect. + * + * @param {MmlNode} mml The mtable node. + */ + public setTableLatex(mml: MmlNode) { + const name = this.getProperty('rawLatexName') as string; + let tex = this.getProperty('rawLatex') as string; + if (!tex && name) { + const start = this.getProperty('rawLatexStart') as number; + const gen = this.getProperty('rawLatexGen') as number; + const currentGen = this.parser + ? (this.parser.stack.global['envSplice'] as number) || 0 + : -1; + if (start != null && this.parser && gen === currentGen) { + // The environment's closing text is now in the parser's string, so the + // full source can finally be recovered. Expanded environment's + // can leave extra whitespace, so collapse. + // @test Environments Nested + const body = this.parser.string + .slice(start, this.parser.i) + .replace(/ {2,}/g, ' '); + tex = `\\begin{${name}}${body}`; + } + } + if (!tex && name) { + // Last resort: reconstruct the source from the table's own rows, + // whose `data-latex` is always tracked correctly. + const LATEX = TexConstant.Attr.LATEX; + const rows = this.table + .map((row) => (row.attributes.get(LATEX) as string) || '') + .filter((row) => row); + if (rows.length) { + tex = `\\begin{${name}}${rows.join('\\\\')}\\end{${name}}`; + } + } + if (!tex) return; + mml.setProperty('rawLatex', tex); + mml.setProperty('rawLatexName', name); + } + + /** + * Find the position of the corresponding `\end{name}` in the string starting + * right after the corresponding `\begin{name}` (skipping nested environments + * of that name). + * + * @param {string} str The string to search. + * @param {string} name The environment name to look for. + * @returns {number} The index right after the matching `\end{name}`, or + * -1 if no matching end was found. + */ + private static findEnvEnd(str: string, name: string): number { + const escaped = quotePattern(name); + const begin = new RegExp(`^\\\\begin\\s*\\{${escaped}\\}`); + const end = new RegExp(`^\\\\end\\s*\\{${escaped}\\}`); + let depth = 0; + let nested = 0; + let i = 0; + while (i < str.length) { + const c = str.charAt(i); + if (c === '\\') { + const rest = str.slice(i); + const mBegin = rest.match(begin); + if (mBegin) { + if (depth === 0) nested++; + i += mBegin[0].length; + continue; + } + const mEnd = rest.match(end); + if (mEnd) { + if (depth === 0) { + if (!nested) { + return i + mEnd[0].length; + } + nested--; + } + i += mEnd[0].length; + continue; + } + i += 2; + continue; + } + if (c === '{') { + depth++; + } else if (c === '}' && depth > 0) { + depth--; + } + i++; + } + return -1; + } + + /** + * Sets the `data-latex` attribute of a row node by joining the LaTeX source + * of its content cells with `&`. + * + * @param {MmlNode} node The mtr/mlabeledtr node. + */ + public setRowLatex(node: MmlNode) { + const tex = this.rowLatex.join('&'); + if (tex) { + node.attributes.set(TexConstant.Attr.LATEXITEM, tex); + node.attributes.set(TexConstant.Attr.LATEX, tex); + } + } + /** * Finishes the table layout. */ @@ -1482,6 +1647,7 @@ export class EqnArrayItem extends ArrayItem { const tag = this.factory.configuration.tags.getTag(); if (tag) { this.row = [tag].concat(this.row); + this.rowLatex = [this.cellLatex(tag)].concat(this.rowLatex); this.setProperty('isLabeled', true); } this.factory.configuration.tags.clearTag(); diff --git a/ts/input/tex/base/BaseMethods.ts b/ts/input/tex/base/BaseMethods.ts index 675da5c92..cb5656b33 100644 --- a/ts/input/tex/base/BaseMethods.ts +++ b/ts/input/tex/base/BaseMethods.ts @@ -1849,11 +1849,12 @@ const BaseMethods: { [key: string]: ParseMethod } = { style: string, raggedHeight: boolean ): ParseResult { + const array = parser.itemFactory.create('array') as sitem.ArrayItem; + array.captureLatex(parser, begin.getName()); if (!align) { // @test Array Single align = parser.GetArgument('\\begin{' + begin.getName() + '}'); } - const array = parser.itemFactory.create('array') as sitem.ArrayItem; if (begin.getName() === 'array') { array.setProperty('arrayPadding', '.5em .125em'); } @@ -2070,6 +2071,7 @@ const BaseMethods: { [key: string]: ParseMethod } = { */ HandleNoTag(parser: TexParser, _name: string) { parser.tags.notag(); + parser.skipLatex(); }, /** @@ -2083,6 +2085,7 @@ const BaseMethods: { [key: string]: ParseMethod } = { const label = parser.GetArgument(name); if (label === '') { // @test Label Empty + parser.skipLatex(); return; } // @test Label, Ref, Ref Unknown @@ -2102,6 +2105,7 @@ const BaseMethods: { [key: string]: ParseMethod } = { // TODO: This should be set in the tags structure! parser.tags.labels[label] = new Label(); // will be replaced by tag value later } + parser.skipLatex(); }, /** @@ -2127,15 +2131,25 @@ const BaseMethods: { [key: string]: ParseMethod } = { // @test Eqref tag = parser.tags.formatRef(tag); } - const node = parser.create( - 'node', - 'mrow', - ParseUtil.internalMath(parser, Array.isArray(tag) ? tag.join('') : tag), - { - href: parser.tags.formatUrl(ref.id, parser.options.baseURL), - class: 'MathJax_ref', - } - ); + const tagStr = Array.isArray(tag) ? tag.join('') : tag; + const mml = new TexParser( + `\\text{${tagStr}}`, + {}, + parser.tags.configuration + ).mml(); + const node = parser.create('node', 'mrow', [mml], { + href: parser.tags.formatUrl(ref.id, parser.options.baseURL), + class: 'MathJax_ref', + }); + const latex = (mml.attributes.get(TexConstant.Attr.LATEX) || '') as string; + if (latex) { + // Protects the latex from being overwritten by the generic + // source-tracking in TexParser.updateResult, which would otherwise + // record the raw `\ref{...}`/`\eqref{...}` call instead of the + // latex that was actually used to build the reference's content. + node.attributes.set(TexConstant.Attr.LATEXITEM, latex); + node.attributes.set(TexConstant.Attr.LATEX, latex); + } parser.Push(node); }, diff --git a/ts/input/tex/colortbl/ColortblConfiguration.ts b/ts/input/tex/colortbl/ColortblConfiguration.ts index 02143cc4c..99f55cd9a 100644 --- a/ts/input/tex/colortbl/ColortblConfiguration.ts +++ b/ts/input/tex/colortbl/ColortblConfiguration.ts @@ -58,6 +58,18 @@ export class ColorArrayItem extends ArrayItem { col: [], }; + /** + * The LaTeX source of a pending \cellcolor, \rowcolor, or \columncolor + * macro, used to include the macro itself in the `data-latex` attribute + * of the mtr/mlabeledtr row it belongs to (it produces no Mml node of its + * own, so it does not appear in the data-latex of any content node). + */ + public colorLatex: ColorData = { + cell: '', + row: '', + col: [], + }; + /** * True if any cell is colored (we will make sure the edge cells are full sized). */ @@ -68,14 +80,23 @@ export class ColorArrayItem extends ArrayItem { */ public EndEntry() { super.EndEntry(); - const cell = this.row[this.row.length - 1]; - const color = - this.color.cell || this.color.row || this.color.col[this.row.length - 1]; + const n = this.row.length - 1; + const cell = this.row[n]; + const color = this.color.cell || this.color.row || this.color.col[n]; if (color) { cell.attributes.set('mathbackground', color); this.color.cell = ''; this.hasColor = true; } + const colorLatex = + this.colorLatex.cell || this.colorLatex.row || this.colorLatex.col[n]; + if (colorLatex) { + const i = this.rowLatex.length - 1; + this.rowLatex[i] = colorLatex + this.rowLatex[i]; + this.colorLatex.cell = ''; + this.colorLatex.row = ''; + delete this.colorLatex.col[n]; + } } /** @@ -84,6 +105,7 @@ export class ColorArrayItem extends ArrayItem { public EndRow() { super.EndRow(); this.color.row = ''; + this.colorLatex.row = ''; } /** @@ -126,7 +148,9 @@ export class ColorArrayItem extends ArrayItem { function TableColor(parser: TexParser, name: string, type: keyof ColorData) { const lookup = parser.configuration.packageData.get('color').model; // use the color extension's color model const model = parser.GetBrackets(name, ''); - const color = lookup.getColor(model, parser.GetArgument(name)); + const arg = parser.GetArgument(name); + const color = lookup.getColor(model, arg); + const latex = `${name}${model ? `[${model}]` : ''}{${arg}}`; // // Check that we are in a colorable array. // @@ -142,6 +166,7 @@ function TableColor(parser: TexParser, name: string, type: keyof ColorData) { texError(COMPONENT, 'ColumnColorNotTop', name); } top.color.col[top.row.length] = color; + top.colorLatex.col[top.row.length] = latex; // // Ignore the left and right overlap options. // @@ -150,10 +175,18 @@ function TableColor(parser: TexParser, name: string, type: keyof ColorData) { } } else { top.color[type] = color; + top.colorLatex[type] = latex; if (type === 'row' && (top.Size() || top.row.length)) { texError(COMPONENT, 'RowColorNotFirst', name); } } + // + // This macro produces no Mml node of its own, so don't let its source + // text be attached as the data-latex of whatever node precedes it. Its + // own source is instead folded into the data-latex of the mtr/mlabeledtr + // row it belongs to (see ColorArrayItem.EndEntry). + // + parser.skipLatex(); } // diff --git a/ts/input/tex/newcommand/NewcommandMethods.ts b/ts/input/tex/newcommand/NewcommandMethods.ts index d43ce9c8f..305f92cc6 100644 --- a/ts/input/tex/newcommand/NewcommandMethods.ts +++ b/ts/input/tex/newcommand/NewcommandMethods.ts @@ -32,6 +32,7 @@ import { ParseUtil } from '../ParseUtil.js'; import { UnitUtil } from '../UnitUtil.js'; import { StackItem } from '../StackItem.js'; import { NewcommandUtil } from './NewcommandUtil.js'; +import { quotePattern } from '../../../util/string.js'; import { COMPONENT } from './__locales__/Component.js'; @@ -267,11 +268,20 @@ const NewcommandMethods: { [key: string]: ParseMethod } = { if (edef) { // Parse the commands in the end environment definition. const rest = parser.string.slice(parser.i); - parser.string = ParseUtil.addArgs( - parser, - parser.string.substring(0, parser.i), - edef + let prefix = parser.string.substring(0, parser.i); + // Here `\end{name}` has already been parsed, but left in place it + // ends up in the LaTeX source. Remove it using whitespace to keep the + // counter correct. + const escaped = quotePattern(name); + const endTag = prefix.match( + new RegExp(`\\\\end\\s*\\{\\s*${escaped}\\s*\\}$`) ); + if (endTag) { + prefix = + prefix.slice(0, prefix.length - endTag[0].length) + + ' '.repeat(endTag[0].length); + } + parser.string = ParseUtil.addArgs(parser, prefix, edef); parser.Parse(); // Reset to parsing the remainder of the expression. parser.string = rest; @@ -304,6 +314,10 @@ const NewcommandMethods: { [key: string]: ParseMethod } = { parser.string.slice(parser.i) ); parser.i = 0; + // This destroys any absolute positions recorded by an enclosing environment + // This counter allows to detect that. + parser.stack.global['envSplice'] = + ((parser.stack.global['envSplice'] as number) || 0) + 1; parser.stack.global['beginEnv'] = ((parser.stack.global['beginEnv'] as number) || 0) + 1; return parser.itemFactory.create('beginEnv').setProperty('name', name);