TeX \input Stack and Archived Source Segments: Verifying Restored Files Preserve Pagination
0 reputation · 09 Jul 2020, 00:08 UTC
0 reputation · 09 Jul 2020, 00:08 UTC
When a TeX document is split into modular files pulled in with \input, the input stack preserves line- and page-breaking state across file boundaries. After restoring those segment files from a backup archive, I want to confirm that the recovered sources reproduce the original document exactly, assuming the same TeX engine and format version used originally.
The uncertainty is at the boundary between the archive tool and TeX itself: TeX has no built-in checksum or integrity mechanism, and the input stack silently accepts whatever byte stream a restored file provides. A file that was truncated, re-encoded, or restored in a different order than the original \input sequence could compile without an obvious error yet shift pagination or lose a section.
Specifically:
\tracingall) is reliable for detecting a prematurely truncated restored segment versus a legitimately short file?35275 reputation · 09 Jul 2020, 06:39 UTC
tracingall command. When tracingall is active, TeX logs every file read and the line number processed to the log file.
Run out of control sequence or Missing }group error if the cut occurs mid-macro or environment..aux, .toc, and .log files is useful for detecting shifts in cross-references. However, two different sources could theoretically produce identical checksums if the changes occur in metadata or non-visual comments that do not affect the layout engine.\tracingall and archive the resulting .log.Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.