Why is it preferable to put inclusions of commonly used packages and user defined commands in a .sty file instead of putting them in an ordinary .tex file?
|
|
||||
| show 1 more comment |
|
First of all: never use The choice is thus between What are the pros of the latter solution? Many. For instance you can define options that can change the behavior of your macros or selectively load parts of it. In a If you don't need options nor access to private macros, loading your definitions and package with As noticed by Andrew Stacey, there is one more pro in using a Example. Suppose you have a macro that must change its behavior when the
If a document does
then "TERM: foo" will be written in the margin. If |
|||||||||||||
|
|
You may put "library" code into |
|||||||||
|
|
A minor point from a very practical point of view: Certain tools such as fig2pdf allow to specify a list of packages to be loaded. This is done with |
|||
|
|

texorstyor evencls… – Tobi Jan 10 at 13:18\inputor\includeatexfile on the preamble? – Sigur Jan 10 at 13:32.texfile with only the commonly used commands as opposed to defining a new style using.styfiles. – recluze Jan 10 at 13:39\inputa file in the preamble. however,\includealways starts a new page, an action that is not permitted in the preamble, only after\begin{document}. – barbara beeton Jan 10 at 13:42