mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
shortcut to mhchem
This commit is contained in:
parent
9fd085af37
commit
a1d1ea9b23
1 changed files with 7 additions and 0 deletions
|
@ -193,6 +193,7 @@ class Editor:
|
||||||
("Ctrl+T, M", self.insertLatexMathEnv),
|
("Ctrl+T, M", self.insertLatexMathEnv),
|
||||||
("Ctrl+M, M", self.insertMathjaxInline),
|
("Ctrl+M, M", self.insertMathjaxInline),
|
||||||
("Ctrl+M, E", self.insertMathjaxBlock),
|
("Ctrl+M, E", self.insertMathjaxBlock),
|
||||||
|
("Ctrl+M, C", self.insertMathjaxChemistry),
|
||||||
("Ctrl+Shift+X", self.onHtmlEdit),
|
("Ctrl+Shift+X", self.onHtmlEdit),
|
||||||
("Ctrl+Shift+T", self.onFocusTags, True)
|
("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 = m.addAction(_("MathJax block"))
|
||||||
a.triggered.connect(self.insertMathjaxBlock)
|
a.triggered.connect(self.insertMathjaxBlock)
|
||||||
a.setShortcut(QKeySequence("Ctrl+M, E"))
|
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 = m.addAction(_("LaTeX"))
|
||||||
a.triggered.connect(self.insertLatex)
|
a.triggered.connect(self.insertLatex)
|
||||||
a.setShortcut(QKeySequence("Ctrl+T, T"))
|
a.setShortcut(QKeySequence("Ctrl+T, T"))
|
||||||
|
@ -774,6 +778,9 @@ to a cloze type first, via Edit>Change Note Type."""))
|
||||||
def insertMathjaxBlock(self):
|
def insertMathjaxBlock(self):
|
||||||
self.web.eval("wrap('\\\\[', '\\\\]');")
|
self.web.eval("wrap('\\\\[', '\\\\]');")
|
||||||
|
|
||||||
|
def insertMathjaxChemistry(self):
|
||||||
|
self.web.eval("wrap('\\\\(\\\\ce{', '}\\\\)');")
|
||||||
|
|
||||||
# Links from HTML
|
# Links from HTML
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue