Skip to main content

substitute_file_request

Function substitute_file_request 

Source
pub fn substitute_file_request(request: &str) -> Option<String>
Expand description

LaTeX file substitution (latex.ltx:19677-19716 \declare@file@substitution, applied by \set@curr@file → \__filehook_file_subst_begin:nnn, latex.ltx:19785-19810): \input, \InputIfFileExists and friends read the REPLACEMENT when a \@file-subst@<name><ext> macro exists. The key is the request’s basename (the directory is dropped on both sides, \use_ii_iii:nnn) with .tex supplied for a missing extension (\__filehook_subst_empty_name_chk:NN); the value is the composed replacement name. Chains are followed with the same bound as the kernel’s tortoise/hare loop. Perl has no such step (its \input binding bypasses \set@curr@file, Package.pm:2248-2270), so it re-reads the ORIGINAL file: tikzlings-doc.tex:73-75 substitutes each animal .sty by the \jobname.cif its comment harvester just wrote and \inputs it — without the substitution the raw .sty re-executes in the document body (\RequirePackage “only in the preamble”, @threeD text leaks) and the per-animal documentation is lost. Guard: perfect_kernel_batch52::input_honors_file_substitution.