Next: , Previous: , Up: AT commands   [Contents][Index]


5.5.9 ‘@i’: Include file (unconditional)

If one says

@i test.hweb

the file test.hweb is inserted at the present point of the web file. By default, the current directory is searched. Files can be included from other directories by means of the FWEB_INCLUDES environment variable and/or the ‘-I’ command-line option. See Environment variables and -I_.

In principle, the included file may contain any fragment of source text. However, it is best to make it a complete section (begun by ‘@*’ or ‘) if at all possible.

Unfortunately, the ‘@i’ command cannot be commented out or conditionally included by use of an FWEB preprocessor command. That is because ‘@i’ is processed very early in the parsing process. (Consider: ‘@i’ could include TeX text, but the preprocessor is only active in the definition and code parts.)

Include commands may be nested to a depth set by the option ‘-yid’. See -yid.

In the woven output, if a section comes from an include file, the name of the include file is printed in square brackets as the first text of the TeX part. To inhibit printing of that name, say

\def\WIF#1{}

in the limbo section. To change the way that name is formatted, redefine the macro ‘\WIFfmt’, whose single argument is the name of the include file. (It is not called when there is no current include file.) The default definition is

\def\WIFfmt#1{[{\tt#1}]}