File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -32,4 +32,9 @@ export function configureMF(mfe: MathfieldElement) {
3232 } catch ( err ) {
3333 logseq . UI . showMsg ( `Fail to configure MathLive inline shortcuts: ${ err } ` , 'error' )
3434 }
35+ try {
36+ mfe . macros = { ...mfe . macros , ...logseq . settings ?. macros }
37+ } catch ( err ) {
38+ logseq . UI . showMsg ( `Fail to configure MathLive macros: ${ err } ` , 'error' )
39+ }
3540}
Original file line number Diff line number Diff line change @@ -111,6 +111,25 @@ export const settingsConfig: SettingSchemaDesc[] = [
111111 align : '\\begin{align*}\n#? &= #? \\\\\n #? &= #?\\end{align*}' ,
112112 } ,
113113 } ,
114+ {
115+ title : 'Macros' ,
116+ description :
117+ 'Configure [MathLive macros](https://cortexjs.io/mathlive/guides/macros/).' +
118+ '\n\nOne trick is to copy over default macros with `expand: false` to avoid automatic macro expansion.\n\n' +
119+ '**Note**: MathLive have [bugs](https://github.com/arnog/mathlive/issues/1565) with `expand: false`, ' +
120+ 'Use it with caution.\n\nYou can also check [this discussion]' +
121+ '(https://github.com/AllanChain/logseq-live-math/discussions/14) for more examples.' ,
122+ key : 'macros' ,
123+ type : 'object' ,
124+ default : {
125+ phase : {
126+ def : '\\enclose{phasorangle}{#1}' ,
127+ args : 1 ,
128+ captureSelection : false ,
129+ expand : false ,
130+ } ,
131+ } ,
132+ } ,
114133 {
115134 title : 'Disable default shortcuts' ,
116135 description : 'Disable default inline shortcuts defined by MathLive.' ,
You can’t perform that action at this time.
0 commit comments