-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: auctex-like siunitx style with org-mode/scimax? #117
Comments
Hi, I think scimax already supports the feature you asked via org-edit-latex: https://github.com/et2010/org-edit-latex You can try it by |
How do you use siunitx in latex? does it help write the units? i.e. how would it help with your example above? |
Thank you @et2010 I will try it out with my setup. Does auctex come with the siunitx style or do I need to add/install it somewhere? Would this also work if the number and unit are in-line/mid sentence and not an equation? |
You're welcome.
Yes, the siunitx style is shipped with auctex.
Yes, it does. |
That said, I think cdlatex is a better approach for completing inline latex. It's not a good idea to open a new buffer just to edit a unit. To complete siuintx with cdlatex, first you need to install cdlatex, then you can add following to you configuration: (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
(setq cdlatex-command-alist '(("ang" "Insert \\ang{}"
"\\ang{?}" cdlatex-position-cursor nil t t)
("si" "Insert \\SI{}{}"
"\\SI{?}{}" cdlatex-position-cursor nil t t)
("sl" "Insert \\SIlist{}{}"
"\\SIlist{?}{}" cdlatex-position-cursor nil t t)
("sr" "Insert \\SIrange{}{}{}"
"\\SIrange{?}{}{}" cdlatex-position-cursor nil t t)
("num" "Insert \\num{}"
"\\num{?}" cdlatex-position-cursor nil t t)
("nl" "Insert \\numlist{}"
"\\numlist{?}" cdlatex-position-cursor nil t t)
("nr" "Insert \\numrange{}{}"
"\\numrange{?}{}" cdlatex-position-cursor nil t t))) After |
The tip with cdlatex is a big help already, thank you @et2010. I still wonder if there is a way to combine this cdlatex approach with the auctex style. Specially when I am using a unit I do not know the exact format for in siunitx or to avoid typos (I keep writing celsius wrong >.<). |
I happen to write many SI-units in org-mode that is exported to latex and html. I end up writing a lot of$\SI{5}{\ng\per\ul}$ for example and it is pretty tedious. I know I could figure out a way using yasnippets to make things easier...
However, I stumbled onto this: https://github.com/emacsmirror/auctex/blob/master/style/siunitx.el
Which is an auctex style for siunitx that makes the entering of SI-units easier in emacs Auctex mode. Is there a way to introduce this into org-mode and then ship it with scimax? I think many people might benefit from it.
The text was updated successfully, but these errors were encountered: