Hi,
I have a huge document and I am using a number of additional packages. Is there a way that I can put all my "\usepackage" commands in a separate file altogether rather than in the main tex file.
General ⇒ Header
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Header
Hi,
that's no problem, use \input.
For instance create a file header.tex and load the packages there, in the preamble of your main document write
Stefan
that's no problem, use \input.
For instance create a file header.tex and load the packages there, in the preamble of your main document write
Code: Select all
\input{header}
LaTeX.org admin
Re: Header
Hi Stefan,
thanks. That solved it. Just wondering, I tried to do the same thing, but instead of \input{}, I used \include{} and it gave me an error. Why is that?
thanks. That solved it. Just wondering, I tried to do the same thing, but instead of \input{}, I used \include{} and it gave me an error. Why is that?
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Header
\include may not appear in the preamble. It uses \clearpage before including, tha'ts not meaningful in the preamble.
\include is especially useful to swap out chapters, so it's a good idea to use it in a document body. \input is appropriate for small pieces of code or text.
Stefan
\include is especially useful to swap out chapters, so it's a good idea to use it in a document body. \input is appropriate for small pieces of code or text.
Stefan
LaTeX.org admin