1

Can we store a latex preamble into another file to avoid writing all same stuff in another file.If we can then can we change the title in another Tex file?

1 Answers1

2

Yes. Write your preamble in a tex file, lets say, preamble.tex

In the main file, where you want to add the preamble, just use

\input{preamble.tex}

This is in general, a bad idea though. I hope you have a good justification of using it in this way though.

  • 3
    why is it a bad idea? also it is more idiomatic latex to save it as something.sty and then use \usepackage rather than \input to input it. – David Carlisle Jul 06 '20 at 08:52
  • "Can we store a latex preamble into another file to avoid writing all same stuff in another file.If we can then can we change the title in another Tex file" From the question, it felt like Sachin wants to use the same preamble including information like Title in multiple files. If not maintained correctly, it might be changed to accommodate something in one document, but the same changes might behave differently in another document. It's very easy to mess up when using the same preamble with document-specific information in multiple documents. – Pulkit Verma Jul 06 '20 at 18:43