From Wiki
Jump to navigation Jump to search



The command \ReadFile includes an external file



file name of the file


The command \ReadFile {filename} is replaced by the content of the text file filename, if it exists. If it does not exist, no error message is generated and the compile process continues.

When no file extension is specified, the extension .tex is assumed.

Similar to the case with project structure commands such as \environment, \ReadFile causes ConTeXt to look in ancestor directories for the specified file.


Example 1

We have a chapter 1 file, but no chapter 2 file:

% chapter-01.tex
\subject{Chapter 1}

This is the first chapter.

The book file attempts to incorporate both chapters, using \ReadFile{filename}:

% complete-book.tex

% No extension specified, so .tex assumed


Compiling book.tex produces the following:

No error message is generated for the missing chapter 2, and the compilation completes successfully.


See also

Help from ConTeXt-Mailinglist/Forum

All issues with: