\import and \subimport read the files they name - #223
Merged
Conversation
The import package is how a paper split across directories pulls its parts in:
\import{sections/}{intro} reads sections/intro.tex
\subimport{proofs/}{lemma} reads <current import path>proofs/lemma.tex
Both were undefined, and a skipped \import does not lose a command, it loses a
FILE. One elsarticle paper imports seven of them: it rendered 5 pages against a
reference of 28, drawing 16868 glyphs where the reference holds 61275 characters —
28% of its own content, with nothing in the skipped-command report to say that a
quarter of the paper had gone missing. With this it is 31 pages and 58849 glyphs.
The path is kept on a stack so an imported file can \subimport relative to where it
lives, and the pop is appended to that file's own text so it runs exactly when the
file ends. The marker carries no @ in its name: it is read in the DOCUMENT's
catcode regime, where @ is not a letter, and \gotex@importpop would have parsed as
\gotex followed by four letters and halted the run.
A file the paper does not ship falls back to the bare name and, failing that, is
recorded as a skipped input rather than failing the render.
Measured over the 157 arXiv papers with a reference: page error 535 → 517.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
importpackage is how a paper split across directories pulls its parts in:Both were undefined — and a skipped
\importdoes not lose a command, it loses afile.
One elsarticle paper in the corpus imports seven of them:
Nothing in the skipped-command report said that a quarter of the paper had gone
missing;
\importappeared there as one more unknown command among sixteen.Details worth knowing
The path is kept on a stack, so an imported file can
\subimportrelative to whereit lives, and the pop is appended to that file's own text so it runs exactly when
the file ends, whatever the file does in between.
The marker carries no
@in its name. It is read in the document's catcoderegime, where
@is not a letter:\gotex@importpopparsed as\gotexfollowed byfour letters and halted the run — which is how the first version of this failed.
A file the paper does not ship falls back to the bare name and, failing that, is
recorded as a skipped input rather than failing the render.
Measured
Page error over the 157 arXiv papers with a tectonic reference: 535 → 517.
Found with a new two-sided census — our drawn glyphs against the reference PDF's
extracted characters — which ranks papers by how much content is missing or
invented rather than by page count. This paper sat at 0.28 of the reference; the
next ones down that list are the same shape.
🤖 Generated with Claude Code