I have a preamble that I copy and paste into nearly all of my documents. Is there a nice way to turn this into a package than I can use? I would prefer to do this in a way that doesn't depend on my Latex front end or compiler, so I can just \usepackage{coolpreamble}. This would also be useful for distributing to others to keep a standard LaTeX format amongst my research group.
|
|
||||
|
|
You can put your preamble code into a
Note that style files can get much more complicated (if you want to include options like Save your file as You can also take a look at the LaTeX2e for class and package writers guide. It'll walk you through this in more detail. |
|||||||||
|
|
I’d say: don’t. There’s a plethora of This is what classes are there for, not packages. So if you find yourself reusing the same preamble, chances are it’s for the same kind of documents. In that case, don’t make a package out of it – make a class. The differences are minimal:
|
|||||||||||||||
|
|
Putting your preamble in a It is important to realize that in a style file Now, if you want to go a step further, you can specify what format is needed, a name and description of the package using |
|||||||
|
|
The easiest way would be to put it into a I recommend you look at another style file to kind of see the layout, like how to declare the package, etc. |
|||
|
|
|
I use a different approach other than a style file. I use
The software can do much more, e.g. inserting (calculated) dates in different formats or moving the cursor after expansion. The definition file is in my dropbox so changes go to all my machines more or less immediately. |
|||
|
|
