-
-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Hi!
In math, you know the importance of \mathbb to write special sets (R, N, Q, Z, etc.).
I tried to add this to my local configuration, following your code (
LaTeX-auto-activating-snippets/laas.el
Lines 421 to 435 in a00f0ab
| (defun laas-accent--rm () (interactive) (laas-wrap-previous-object (if (laas-mathp) "mathrm" "textrm"))) | |
| (defun laas-accent--it () (interactive) (laas-wrap-previous-object (if (laas-mathp) "mathit" "textit"))) | |
| (defun laas-accent--bf () (interactive) (laas-wrap-previous-object (if (laas-mathp) "mathbf" "textbf"))) | |
| (defun laas-accent--emph () (interactive) (laas-wrap-previous-object (if (laas-mathp) "mathem" "emph"))) | |
| (defun laas-accent--tt () (interactive) (laas-wrap-previous-object (if (laas-mathp) "mathtt" "texttt"))) | |
| (defun laas-accent--sf () (interactive) (laas-wrap-previous-object (if (laas-mathp) "mathsf" "textsf"))) | |
| (defvar laas-accent-snippets | |
| `(;; work in both normal latex text and math | |
| :cond laas-latex-accent-cond | |
| :expansion-desc "Wrap in \\mathrm{} or \\textrm{}" "'r" laas-accent--rm | |
| :expansion-desc "Wrap in \\mathit{} or \\textit{}" "'i" laas-accent--it | |
| :expansion-desc "Wrap in \\mathbf{} or \\textbf{}" "'b" laas-accent--bf | |
| :expansion-desc "Wrap in \\mathemph{} or \\textemph{}" "'e" laas-accent--emph | |
| :expansion-desc "Wrap in \\mathtt{} or \\texttt{}" "'y" laas-accent--tt | |
| :expansion-desc "Wrap in \\mathsf{} or \\textsf{}" "'f" laas-accent--sf |
But, I failed miserably. This is what I have:
(defun laas-accent--bb ()
(interactive)
(laas-wrap-previous-object (if (laas-mathp) "mathbb" "")))
(aas-set-snippets 'laas-mode
:cond #'laas-latex-accent-cond
:expansion-desc "Wrap in \\mathbb{}"
"B" #'laas-accent--bb))I don't know if you could give me some pointers about what I am missing, or even better, see if this could be implemented in the package itself.
In any case, thanks for your assistance.
Best.
Metadata
Metadata
Assignees
Labels
No labels