For almost every document that I type in LaTeX, I start by opening one of the most recent documents that I made, copying all of the packages and pre-set commands, and pasting them in the new document. This is because I have a lot of packages that I use on a regular basis. However, it gets pretty annoying and my preamble is messy.

I would like to create some sort of a template that contains all of the packages and commands that I normally use so that when I decide to start a new document I can use a single command and call on a file that has all of those packages already set up. Is something like this possible?

Thank you for your time

  • You can save your preamble in a separate file and use \input{preamble} in your documents. But i would advise against it. – Johannes_B May 31 '20 at 2:52
  • @Johannes_B What type (extension) should that file be? And why are you advising against it? – Vladimir May 31 '20 at 2:59
  • Extension would be .tex – Johannes_B May 31 '20 at 3:01
  • 3
    I am advising against it, because it will clutter up over time like an attic. As LaTeX keeps evolving and is updated regularly, you will have to keep the file up to date, which possibly will break older documents. – Johannes_B May 31 '20 at 3:03
  • It should be mentioned that you could also put your stuff in a package or even class. The principle is pretty much the same, with the same disadvantages as well. – Johannes_B May 31 '20 at 3:15