4

This might seem like dumb question, but I don't know quite how this works, actually.

I'm working on my Phd and I already have something like 20 different packages, new commands and other stuff.

The question is : is it bad?

Can I have as much as I want/need of all this? or is there a limit that the Latex can handle? I once have been told that it is not very good to put too many things in preamble as it overwhelms the memory. What would you say?

Leucippus
  • 1,636

1 Answers1

11

There's technically no limit to what you can include in your preamble. As such, the short answer is "No."

However, from a programming point of view, it's always good to think about structure and maintenance. In an extreme case, would you rather sift through this:

enter image description here

...or something that is a little more organized, like this:

enter image description here

In terms of structure, you should ideally attempt to compartmentalize document. Analogous to keeping each chapter in a separate file that you \include, keep preamble components together in (perhaps) separate .sty files that you \usepackage. The same goes for the definition of a number of macros in your preamble. Split them out in a separate file and \input it.

The above suggestions should add to the ease of maintenance. You should be to easily maintain code that is clean/structured this way.

Werner
  • 603,163