Skip to content

Commit

Permalink
feat: add shortcut for triple-prime
Browse files Browse the repository at this point in the history
  • Loading branch information
arnog committed Jul 26, 2023
1 parent 3002aa8 commit c318b56
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/editor/shortcuts-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const INLINE_SHORTCUTS: InlineShortcutDefinitions = {

// Primes
"''": '^{\\doubleprime}',
"'''": '^{\\prime\\prime\\prime}',

// Greek letters
'alpha': '\\alpha',
Expand Down
48 changes: 48 additions & 0 deletions test/smoke/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@
max-width: 640px;
width: 100%;
}

/* math-field::part(content) {
justify-content: center;
} */
/* math-field {
--selection-background-color: red;
--selection-color: #f80;
} */

.MLK__shift {
transform: translate(0, -5px);
}
</style>
</head>
<body>
Expand Down Expand Up @@ -131,6 +136,49 @@ <h2>Latex to Speakable Text</h2>
// });

// MathfieldElement.computeEngine = ce;
mathVirtualKeyboard.layouts = [
{
label: 'minimal',
tooltip: 'Only the essential',
layers: [
{
style:
'.digit { background: blue !important; color: white !important }',
rows: [
[
{
latex: 'x',
insert: 'x',
shift: { latex: 'a', insert: 's' },
},
'-',
'\\times',
'\\frac{#@}{#?}',
'=',
'.',
'(',
')',
'\\sqrt{#0}',
'#@^{#?}',
],
[
{ class: 'digit', latex: '1' },
{ class: 'digit', latex: '2' },
{ class: 'digit', latex: '3' },
{ class: 'digit', latex: '4' },
{ class: 'digit', latex: '5' },
{ class: 'digit', latex: '6' },
{ class: 'digit', latex: '7' },
{ class: 'digit', latex: '8' },
{ class: 'digit', latex: '9' },
{ class: 'digit', latex: '0' },
],
],
},
],
},
'alphabetic',
];

const mf = document.getElementById('mf');
mf.smartMode = true;
Expand Down

0 comments on commit c318b56

Please sign in to comment.