Why do \include and \input handle extension name differently?

There is no inconsistency. The \include command should have an argument that is a file name without extension; this is the documented behavior and is a requirement.

The command is only meant for inputting .tex files in order to do “selective processing” of the material by means of \includeonly.

On the other hand, \input can be used for any kind file (even binaries, if you are bold enough), provided they have an extension, because the default for TeX is to add .tex if an extension is missing (except on some implementations).

So the two commands are very different from each other and are not interchangeable. Ultimately, \include uses \input, but this is not something a user should be concerned with.


The clue is in the terminal output that you show.

(./bar.tex.aux)

\include needs to construct the name of an aux file, and in tex if the user requests foo you can not tell if the actual file input is foo or foo.tex so the most reliable way (if you have reliable users) is to document that the file should always have an extension, and the \include argument should not mention the extension. then #1.tex is the document file, and #1.aux is the aux file.

Tags:

Include

Input