Skip to main content

projected_source_bytes

Function projected_source_bytes 

Source
pub fn projected_source_bytes(source: &str) -> u64
Expand description

The byte size the memory projection must reason from: the DOCUMENT, not the main file.

A 2 KB index.tex that \inputs a thousand chapters is a half-gigabyte document, but metadata(main).len() projects it at 2 KB — “fits easily” — and the eager path then dies on it. When the main file actually names an inclusion command, sum the source tree (.tex/.ltx/.bbl) instead.

Gated on the command being present so a SELF-CONTAINED paper sitting in a directory of unused alternates (a common arXiv bundle shape) still projects as itself and keeps the eager path.

Known limitation: an inclusion assembled by macro expansion (\myinput{ch1}) names no literal command and is not detected; such a document needs an explicit --streaming.