# How to add a macro to helm mode tex insert macro?

I am new to helm-mode. When I use it with LaTeX-mode for editing TeX files, and type backslash I get the following helm buffer:

Now, I would like to insert the \num command (from the siunitx package). However, the command num is not recognized, so nonumber is selected by default each time, and I then need to press arrow-up to select it and then press enter.

Is there a way to make num become the default cadidate? (Assuming I type num much more often than nonumber)

Alternatively, is there a way to make TeX-insert-macro History (see above screen shot) the default helm source instead of the current TeX-insert-macro?

Is there a way to make num become the default cadidate? (Assuming I type num much more often than nonumber)

You need to teach Tex-insert-macro to know num, i.e., add it to the completion collection, it looks like the completion collection is generated by (TeX-symbol-list-filtered). I don't know how since I don't use Tex at all. But it is not related to helm anyway.

Alternatively, is there a way to make TeX-insert-macro History (see above screen shot) the default helm source instead of the current TeX-insert-macro?

Yes, by setting helm-mode-reverse-history to nil, the following is its docstring.

helm-mode-reverse-history is a variable defined in helm-mode.el'.
Its value is t

Documentation:
Display history source after current source in helm-mode' handled commands.

You can customize this variable.