diff --git a/aqt/editor.py b/aqt/editor.py index 8accb1232..4e75ba095 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -193,6 +193,7 @@ class Editor: ("Ctrl+T, M", self.insertLatexMathEnv), ("Ctrl+M, M", self.insertMathjaxInline), ("Ctrl+M, E", self.insertMathjaxBlock), + ("Ctrl+M, C", self.insertMathjaxChemistry), ("Ctrl+Shift+X", self.onHtmlEdit), ("Ctrl+Shift+T", self.onFocusTags, True) ] @@ -742,6 +743,9 @@ to a cloze type first, via Edit>Change Note Type.""")) a = m.addAction(_("MathJax block")) a.triggered.connect(self.insertMathjaxBlock) a.setShortcut(QKeySequence("Ctrl+M, E")) + a = m.addAction(_("MathJax chemistry")) + a.triggered.connect(self.insertMathjaxChemistry) + a.setShortcut(QKeySequence("Ctrl+M, C")) a = m.addAction(_("LaTeX")) a.triggered.connect(self.insertLatex) a.setShortcut(QKeySequence("Ctrl+T, T")) @@ -774,6 +778,9 @@ to a cloze type first, via Edit>Change Note Type.""")) def insertMathjaxBlock(self): self.web.eval("wrap('\\\\[', '\\\\]');") + def insertMathjaxChemistry(self): + self.web.eval("wrap('\\\\(\\\\ce{', '}\\\\)');") + # Links from HTML ######################################################################