[Tex/LaTex] Automatically define macros in LyX documents

lyxmacrospreamble

I'm using LyX all the time and over the last 2 years I've accumulated some very handy macros for my lecture notes. As it is today, every time I start a new document, I copy and paste the macros from one of my other documents. Is it possible, somehow, to automatically load macros for all files?

(I asked this on SO a while back and got no answers. I hope in this new home I'll get a response).

Best Answer

I am not sure if you mean LyX macros or not. But if they are standard LaTeX macros, you can make your own style file, say "rachum.sty". Put all of your macros in there, and then have it included in the preamble by default.

This is useful for (La)TeX users in general. I have a lot of common things in my own file, such as \newcommand{\Integers}{\mathbb{Z}} and such.