Skip to content

Commit

Permalink
feat: added some shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
arnog committed Jan 29, 2025
1 parent 0e5e882 commit 72394d1
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions src/editor/shortcuts-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const INLINE_SHORTCUTS: InlineShortcutDefinitions = {
'$': '\\$',

// Primes
// "'": '^{\\prime}', // Conflicts with text zone shortcut
"''": '^{\\doubleprime}',
"'''": '^{\\prime\\prime\\prime}',
"''''": '^{\\prime\\prime\\prime\\prime}',
Expand Down Expand Up @@ -116,10 +117,10 @@ export const INLINE_SHORTCUTS: InlineShortcutDefinitions = {
'arg': '\\arg',
'lg': '\\lg',
'lb': '\\operatorname{lb}', // not in amsmath
'log': '\\log',
'log': '\\log_{#?}',
'ln': '\\ln',
'exp': '\\exp',
'lim': '\\lim_{#?}',
'lim': '\\lim_{#?\\to#?}',

// Differentials
// According to ISO31/XI (ISO 80000-2), differentials should be upright
Expand Down Expand Up @@ -324,6 +325,18 @@ export const INLINE_SHORTCUTS: InlineShortcutDefinitions = {
after: 'nothing+digit+operator',
value: '\\operatorname{kg}', // Kilogram
},
'ft': {
after: 'nothing+digit+operator',
value: '\\operatorname{ft}', // feet
},
'inch': {
after: 'nothing+digit+operator',
value: '\\operatorname{inch}', // inch
},
'mi': {
after: 'nothing+digit+operator',
value: '\\operatorname{mi}', // mile
},

// '||': '\\lor',
'...': '\\ldots', // In general, use \ldots
Expand All @@ -340,7 +353,7 @@ export const INLINE_SHORTCUTS: InlineShortcutDefinitions = {
'=>': '\\Rightarrow',
'==>': '\\Longrightarrow',
// '<=': '\\Leftarrow', // CONFLICTS WITH LESS THAN OR EQUAL
'<=>': '\\Leftrightarrow',
'<=>': '\\iff',
'<->': '\\leftrightarrow',

'(.)': '\\odot',
Expand Down Expand Up @@ -434,6 +447,18 @@ export const INLINE_SHORTCUTS: InlineShortcutDefinitions = {
'->>': '\\twoheadrightarrow', // \char"21A0
'>->>': '\\twoheadrightarrowtail', // \char"2916

'times': '\\times',
// "?=":"\\questeq"
'of': '\\circ',
'infinity': '\\infty',
'defint': '\\int_{#?}^{#?}',

'approaches': '\\to',
'ceil': '\\left\\lceil#?\\right\\rceil',
'floor': '\\left\\lfloor#?\\right\\rfloor',
'union': '\\cup',
'asterisk': '\\ast',

//
// Desmos Graphing Calculator
//
Expand Down

0 comments on commit 72394d1

Please sign in to comment.