File tree Expand file tree Collapse file tree
src/compute-engine/latex-syntax/dictionary Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9595 and allows proper algebraic manipulation. Use ` .N() ` to get numeric approximations
9696 when needed.
9797
98+ - ** LaTeX ` \exp() ` Juxtaposition** : Fixed adjacent ` \exp() ` calls not parsing as
99+ multiplication. Now ` \exp(x)\exp(2) ` correctly parses as ` e^x · e^2 ` instead of
100+ producing a parse error. The expression then simplifies to ` e^{x+2} ` as expected.
101+
98102### Features
99103
100104- ** ([ #163 ] ( https://github.com/cortex-js/compute-engine/issues/163 ) ) Additional
Original file line number Diff line number Diff line change @@ -699,11 +699,19 @@ export const DEFINITIONS_ARITHMETIC: LatexDictionary = [
699699 {
700700 kind : 'function' ,
701701 symbolTrigger : 'exp' ,
702- parse : 'Exp' ,
702+ parse : ( parser : Parser ) => {
703+ const args = parser . parseArguments ( 'implicit' ) ;
704+ if ( args === null ) return 'Exp' as Expression ;
705+ return [ 'Exp' , ...args ] as Expression ;
706+ } ,
703707 } ,
704708 {
705709 latexTrigger : '\\exp' ,
706- parse : 'Exp' ,
710+ parse : ( parser : Parser ) => {
711+ const args = parser . parseArguments ( 'implicit' ) ;
712+ if ( args === null ) return 'Exp' as Expression ;
713+ return [ 'Exp' , ...args ] as Expression ;
714+ } ,
707715 } ,
708716 {
709717 name : 'ImaginaryUnit' ,
You can’t perform that action at this time.
0 commit comments