LaTeX-auto-activating-snippets
LaTeX-auto-activating-snippets copied to clipboard
combine with siunitx
Hi,
very interesting snippets approach... is there some thinking about handling siunitx with the convenient approach as well?
It would be great if the units get converted like m
gets converted to \m
and e.g. kg
to \kg
... but only if it is located in the second part of the SI-environment $\SI{10}{\m}
... maybe this already possible!?
Thank you in advance!
Fab
Hmmm. That's would be nice. I can't say I'll work on this any time soon but feel free to propose something.
ok, thank you for your quick reply; I try to get familiar with it
I was about to recommend writing a yasnippet
snippet for \SI{}{}
with a field transformation in the second {}
. But then I thought that maybe my concept of \SI
is wrong, so I went to the siunitx
documentation and fount:
Anyway, having these \m
\kg
snippets expand only in \SI
* macros is troublesome.
If that field transformation is too complicated to write maybe you could make another yasnippet for \SI
that enables a snippet keymap only in the context of the snippet.
Hi,
could there be the option to use e.g. ,,
after the unit as it is a quicker way to write a backslash.
your code from yesterday includes a wrapping
(aas-set-snippets 'laas-mode
:cond #'laas-object-on-left-condition
". " (lambda () (interactive)
(laas-wrap-previous-object "dot")
;; if you want a space after the \dot{}, I think it's an improvement
;; and I changed ".. " to this behavior in the latest commit
;;(insert " ")
))
maybe a similar way exists to just a "" before the previous object?
Thank you in advance! Fab
maybe a similar way exists to just [add?] a "" before [after?] the previous object?
You can give laas-wrap-previous-object a cons, it's in the function documentation.
could there be the option to use e.g. ",, " after the unit as it is a quicker way to write a backslash.
Not sure how this is quicker.
Thank you for your quick response! For my current arm/hand position typing the backslash is a bit outside so I need to twist a bit the fingers... this results (it seems) in a slowdown for me typing siunitx equations.
ok, not sure yet if this is really better ;-)
",, " (lambda () (interactive)
(laas-wrap-previous-object (cons "\\" " "))
)