I've created a set of macros in Lyx that I use continuously. I want to automatically include them in all my .lyx
documents.
From what I've been reading in the forums, perhaps the most elegant way is to create a .sty
file with my macros in it, save it in some folder, and then add stuff to the LaTeX preamble in the document settings of Lyx.
What I wasn't able to find is how to actually do the above, given that I'm not an experienced Tex/Lyx user. So my questions are:
- How do you create and edit a
.sty
file? - What exactly do you need to type in the
.sty
file? Say I want the macro (I'm typing it as it appears in Lyx).
\sequence{#1}:=(#1)^\infty _{n=1}
I understand the above should be wrapped by some extra code (\newcommand
etc.), but I don't know the precise format.
- Where do you place your
.sty
file such that it can be included in all*.lyx
documents globally? I'm a Windows user if it matters and I want to avoid adding it to every folder that contains a lyx document. - What do I need to type in the preamble? or more generally, how do I implement it in my document defaults?
Thanks!
\input
that in the preamble. To save the preamble so it is used by default for all files, you can click on "Save as Document Defaults" in the Document > Settings dialog. A different approach would be to create a module. For more information on this, see Help > Customization.@
key, followed by the user name. Otherwise, they will not know that you directed a comment at them (unless they happen to check back on their own but usually this does not happen).