This TeX.SE thread is a good resource for how to make your usual preamble into a package or document class. I would like to know why I should do that. What are the pros and cons of doing so, as compared with just leaving the preamble in every document you write?
Here's how I see it:
Pros of leaving the preamble in every document
- Easy to edit it if necessary
- If I forget how I defined something, I can just scroll up and look
- Only one file to keep track of per document
- If I send my document to someone else, they can compile it immediately, without any fussing over where to put my package/class file
- Progressive changes to my preamble don't cause an accumulation of files that can never be moved lest all old documents break
Cons of leaving the preamble in every document
- Takes up more room on the computer
- You have to scroll down a bit more before getting to start writing in your document
(the pros and cons of making a package or class being exactly dual)
To me, this comes down heavily against making a package or class. Am I missing considerations that would tip the balance the other way? Perhaps for certain documents, one choice is better than the other?
ifluatexpackage, a basic font setup forpdfTeXand one forLuaTeX. I do custom packages for things like law citation definitions (which are used across several articles/projects I'm working on). However, I like to load things likehyperrefin each file separately; things likemulticolmight be in one document, but not in others, so I load those packages individually on a case-by-case basis. Having everything in only one package is too inflexible for my tastes. – jon May 26 '13 at 22:44.texfile that is then\inputted. The simplest package is just this file with a.styextension and\usepackageinstead of\input. It really boils down to how often you can use this out-sourced file (package or not), how often you will add new features to it (for new documents), how hard it will be to maintain compatibility for older documents. The main file of my documents usually start with\input{preamble}. – Qrrbrbirlbel May 27 '13 at 00:36.sty) or a class file (.cls) can simply be copied along with the document and will be used then. There is no need to “install” your custom package or class first. – Qrrbrbirlbel May 27 '13 at 00:40