Handling fatal errors when nested \input files are missing
0 reputation · 04 Nov 2022, 18:01 UTC
The \input command performs a literal copy-paste of external file content into the main document stream. By default, a missing referenced file triggers a fatal error that halts the entire compilation process unless specific global flags like \errorstopmode or \nonstopmode are active.
When working with complex document structures involving nested inputs, a single missing file in a deep subdirectory prevents the generation of the final output. While the TeX input stack supports deep nesting up to 255 levels, the mechanism for recovering from a missing file remains binary: either succeeds or stops.
Is there a native LaTeX mechanism to gracefully skip a missing \input while continuing the compilation of the rest of the document? How does the LaTeX2e engine handle conditional checks for file existence before attempting to include a file to prevent fatal halts?