TeXnik - Tips TeX and LaTeX

Welcome to the TeXnik website (under construction)

Input/Include
 Main page Index UK FAQ Documentation Software CTAN Search CTAN: Statistics Google c.t.t. Google d.c.t.t.

These two commands are very often used in a wrong way.
1. The command \input{file_name} inserts the file as is! This means that the \input command is replaced exactly with the contents of the file. Therefore this inserted file cannot be a complete LaTeX file, because \input makes no difference between preamble and text. In fact of these behaviour the \input command can be used in preambles, too. You can write the whole preamble in a file like myText.pre and insert it in the preamble of your text with \input{myText.pre} as the only command in your preamble. Every single change in any of the included files makes a new compilation of all files possible.
Input-commands can be nested.
2. The command \include{file_name} makes sense when you want to split your document in different parts, which can be handled as stand-alone-documents. Remember that in this case all documents must have the same documentclass and the same preamble.

local time: Tue Jan 19 06:03:16 CET 2021 ; file is: 572.550613425926 days old
contact webmaster _at_ TeXnik.de