@@ -259,9 +259,9 @@ LatexCmds.textcolor = class extends MathCommand {
259
259
latexRecursive ( ctx : LatexContext ) {
260
260
this . checkCursorContextOpen ( ctx ) ;
261
261
var blocks0 = this . blocks ! [ 0 ] ;
262
- ctx . latex += '\\textcolor{' + this . color + '}{' ;
262
+ ctx . uncleanedLatex += '\\textcolor{' + this . color + '}{' ;
263
263
blocks0 . latexRecursive ( ctx ) ;
264
- ctx . latex += '}' ;
264
+ ctx . uncleanedLatex += '}' ;
265
265
this . checkCursorContextClose ( ctx ) ;
266
266
}
267
267
parser ( ) {
@@ -314,9 +314,9 @@ var Class = (LatexCmds['class'] = class extends MathCommand {
314
314
this . checkCursorContextOpen ( ctx ) ;
315
315
316
316
var blocks0 = this . blocks ! [ 0 ] ;
317
- ctx . latex += '\\class{' + this . cls + '}{' ;
317
+ ctx . uncleanedLatex += '\\class{' + this . cls + '}{' ;
318
318
blocks0 . latexRecursive ( ctx ) ;
319
- ctx . latex += '}' ;
319
+ ctx . uncleanedLatex += '}' ;
320
320
321
321
this . checkCursorContextClose ( ctx ) ;
322
322
}
@@ -488,29 +488,29 @@ class SupSub extends MathCommand {
488
488
this . checkCursorContextOpen ( ctx ) ;
489
489
490
490
if ( this . sub ) {
491
- ctx . latex += '_{' ;
492
- const beforeLength = ctx . latex . length ;
491
+ ctx . uncleanedLatex += '_{' ;
492
+ const beforeLength = ctx . uncleanedLatex . length ;
493
493
this . sub . latexRecursive ( ctx ) ;
494
- const afterLength = ctx . latex . length ;
494
+ const afterLength = ctx . uncleanedLatex . length ;
495
495
if ( beforeLength === afterLength ) {
496
496
// nothing was written. so we write a space
497
- ctx . latex += ' ' ;
497
+ ctx . uncleanedLatex += ' ' ;
498
498
}
499
499
500
- ctx . latex += '}' ;
500
+ ctx . uncleanedLatex += '}' ;
501
501
}
502
502
503
503
if ( this . sup ) {
504
- ctx . latex += '^{' ;
505
- const beforeLength = ctx . latex . length ;
504
+ ctx . uncleanedLatex += '^{' ;
505
+ const beforeLength = ctx . uncleanedLatex . length ;
506
506
this . sup . latexRecursive ( ctx ) ;
507
- const afterLength = ctx . latex . length ;
507
+ const afterLength = ctx . uncleanedLatex . length ;
508
508
if ( beforeLength === afterLength ) {
509
509
// nothing was written. so we write a space
510
- ctx . latex += ' ' ;
510
+ ctx . uncleanedLatex += ' ' ;
511
511
}
512
512
513
- ctx . latex += '}' ;
513
+ ctx . uncleanedLatex += '}' ;
514
514
}
515
515
516
516
this . checkCursorContextClose ( ctx ) ;
@@ -727,25 +727,25 @@ class SummationNotation extends MathCommand {
727
727
latexRecursive ( ctx : LatexContext ) {
728
728
this . checkCursorContextOpen ( ctx ) ;
729
729
730
- ctx . latex += this . ctrlSeq + '_{' ;
731
- let beforeLength = ctx . latex . length ;
730
+ ctx . uncleanedLatex += this . ctrlSeq + '_{' ;
731
+ let beforeLength = ctx . uncleanedLatex . length ;
732
732
this . getEnd ( L ) . latexRecursive ( ctx ) ;
733
- let afterLength = ctx . latex . length ;
733
+ let afterLength = ctx . uncleanedLatex . length ;
734
734
if ( afterLength === beforeLength ) {
735
735
// nothing was written so we write a space
736
- ctx . latex += ' ' ;
736
+ ctx . uncleanedLatex += ' ' ;
737
737
}
738
738
739
- ctx . latex += '}^{' ;
740
- beforeLength = ctx . latex . length ;
739
+ ctx . uncleanedLatex += '}^{' ;
740
+ beforeLength = ctx . uncleanedLatex . length ;
741
741
this . getEnd ( R ) . latexRecursive ( ctx ) ;
742
- afterLength = ctx . latex . length ;
742
+ afterLength = ctx . uncleanedLatex . length ;
743
743
if ( beforeLength === afterLength ) {
744
744
// nothing was written so we write a space
745
- ctx . latex += ' ' ;
745
+ ctx . uncleanedLatex += ' ' ;
746
746
}
747
747
748
- ctx . latex += '}' ;
748
+ ctx . uncleanedLatex += '}' ;
749
749
this . checkCursorContextClose ( ctx ) ;
750
750
}
751
751
mathspeak ( ) {
@@ -1069,7 +1069,7 @@ class Token extends MQSymbol {
1069
1069
latexRecursive ( ctx : LatexContext ) : void {
1070
1070
this . checkCursorContextOpen ( ctx ) ;
1071
1071
1072
- ctx . latex += '\\token{' + this . tokenId + '}' ;
1072
+ ctx . uncleanedLatex += '\\token{' + this . tokenId + '}' ;
1073
1073
1074
1074
this . checkCursorContextClose ( ctx ) ;
1075
1075
}
@@ -1175,11 +1175,11 @@ class NthRoot extends SquareRoot {
1175
1175
latexRecursive ( ctx : LatexContext ) {
1176
1176
this . checkCursorContextOpen ( ctx ) ;
1177
1177
1178
- ctx . latex += '\\sqrt[' ;
1178
+ ctx . uncleanedLatex += '\\sqrt[' ;
1179
1179
this . getEnd ( L ) . latexRecursive ( ctx ) ;
1180
- ctx . latex += ']{' ;
1180
+ ctx . uncleanedLatex += ']{' ;
1181
1181
this . getEnd ( R ) . latexRecursive ( ctx ) ;
1182
- ctx . latex += '}' ;
1182
+ ctx . uncleanedLatex += '}' ;
1183
1183
1184
1184
this . checkCursorContextClose ( ctx ) ;
1185
1185
}
@@ -1328,9 +1328,9 @@ class Bracket extends DelimsNode {
1328
1328
latexRecursive ( ctx : LatexContext ) {
1329
1329
this . checkCursorContextOpen ( ctx ) ;
1330
1330
1331
- ctx . latex += '\\left' + this . sides [ L ] . ctrlSeq ;
1331
+ ctx . uncleanedLatex += '\\left' + this . sides [ L ] . ctrlSeq ;
1332
1332
this . getEnd ( L ) . latexRecursive ( ctx ) ;
1333
- ctx . latex += '\\right' + this . sides [ R ] . ctrlSeq ;
1333
+ ctx . uncleanedLatex += '\\right' + this . sides [ R ] . ctrlSeq ;
1334
1334
1335
1335
this . checkCursorContextClose ( ctx ) ;
1336
1336
}
@@ -1869,7 +1869,7 @@ class EmbedNode extends MQSymbol {
1869
1869
latexRecursive ( ctx : LatexContext ) : void {
1870
1870
this . checkCursorContextOpen ( ctx ) ;
1871
1871
1872
- ctx . latex += this . latex ( ) ;
1872
+ ctx . uncleanedLatex += this . latex ( ) ;
1873
1873
1874
1874
this . checkCursorContextClose ( ctx ) ;
1875
1875
}
0 commit comments