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 212212 lower precedence (230-235) than comparison operators (245) and set relations
213213 (240), so compound propositions parse correctly without requiring parentheses.
214214
215+ - ** ([ #156 ] ( https://github.com/cortex-js/compute-engine/issues/156 ) ) Logical
216+ Connective Arrows** : Added support for lowercase arrow notation in logical
217+ expressions:
218+ - ` \rightarrow ` now parses as ` Implies ` (previously parsed as ` To ` for
219+ set/function mapping)
220+ - ` \leftrightarrow ` now parses as ` Equivalent ` (previously produced an
221+ "unexpected-command" error)
222+ - The uppercase variants ` \Rightarrow ` and ` \Leftrightarrow ` continue to work
223+ - ` \to ` remains available for function/set mapping notation (e.g., ` f: A \to B ` )
224+
215225- ** Simplification Rules** : Added and fixed several simplification rules:
216226 - ` x + x ` now correctly simplifies to ` 2x ` (term combination)
217227 - ` e^x * e^{-x} ` now correctly simplifies to ` 1 ` (exponential inverse)
Original file line number Diff line number Diff line change @@ -7,10 +7,4 @@ export const DEFINITIONS_ALGEBRA: LatexDictionary = [
77 kind : 'infix' ,
88 precedence : 270 , // MathML rightwards arrow
99 } ,
10- {
11- latexTrigger : [ '\\rightarrow' ] ,
12- kind : 'infix' ,
13- precedence : 270 , // MathML rightwards arrow
14- parse : 'To' ,
15- } ,
1610] ;
Original file line number Diff line number Diff line change @@ -159,6 +159,13 @@ export const DEFINITIONS_LOGIC: LatexDictionary = [
159159 associativity : 'right' ,
160160 parse : 'Implies' ,
161161 } ,
162+ {
163+ latexTrigger : [ '\\rightarrow' ] ,
164+ kind : 'infix' ,
165+ precedence : 220 ,
166+ associativity : 'right' ,
167+ parse : 'Implies' ,
168+ } ,
162169
163170 {
164171 name : 'Equivalent' , // MathML: identical to, Mathematica: Congruent
@@ -174,6 +181,13 @@ export const DEFINITIONS_LOGIC: LatexDictionary = [
174181 precedence : 219 ,
175182 parse : 'Equivalent' ,
176183 } ,
184+ {
185+ latexTrigger : [ '\\leftrightarrow' ] ,
186+ kind : 'infix' ,
187+ associativity : 'right' ,
188+ precedence : 219 ,
189+ parse : 'Equivalent' ,
190+ } ,
177191 {
178192 latexTrigger : [ '\\equiv' ] ,
179193 kind : 'infix' ,
You can’t perform that action at this time.
0 commit comments