From a1d1ea9b2308dfa7845774baacb1be47a79d5e01 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 6 Aug 2018 13:17:57 +1000 Subject: [PATCH] shortcut to mhchem --- aqt/editor.py | 7 +++++++ 1 file changed, 7 insertions(+) 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 ######################################################################