Stefan Kottwitz wrote:Hi Giovanni!
In normal use \input
is equivalent to typing. Indeed, there are exceptions, rare cases, and they are unusual, such as that case - using \input
within a macro or an environment definition gives the question, does it have to be interpreted at definition time (only that time once) or each time the macro (or environment) runs when the whole document is translated.
I would use \input
in a sane way, to externalize code parts, but not fragements of code parts within definitions. So I would not use \input
within a number, in an argument, or within a command name. That goes too far. Here, \input
relies on the outside context, and expansion time.
Stefan
This is reasonable. However, it raises a second point, which is important in my opinion. The clarity of the documentation of LaTeX can be improved ; I say it from my point of view - I have used LaTeX with a superficial knowledge of it for about 15 years and the documentation is not satisfactory for me.
In this case, the correct statement (different from the one that appeared on StackExchange) is
\input
is expanded to the content of the file, and this in normal cases is equivalent to typing.
For example in
https://en.wikibooks.org/wiki/LaTeX/Mod ... vs_include
I read:
"When the compiler processes your base file and reaches one of the commands
\input
or
\include
, it reads filename.tex and processes its content in accordance with the formatting commands specified in the base file"
(it is talking about the commands
\input{filename}
and
\include{filename}
)
while the correct statement - as far as I understand - is "When the compiler
expands the command \input ".
The complaint on the documentation is however more general
