Atrium — shared contracts and the typesetting engine
    Preparing search index...

    Interface LayoutContext

    interface LayoutContext {
        budget: Budget;
        design: PageDesign;
        diagnostics: {
            code?:
                | "syntax"
                | "unsupported"
                | "undefined-command"
                | "undefined-environment"
                | "undefined-reference"
                | "duplicate-label"
                | "missing-file"
                | "missing-font"
                | "overfull-box"
                | "underfull-box"
                | "budget-exceeded"
                | "limit-exceeded"
                | "stopped"
                | "internal";
            column?: number;
            construct?: string;
            file: string;
            line: number;
            message: string;
            severity: "error"
            | "warning"
            | "info";
        }[];
        file: string;
        files: ImageFiles;
        floats: Map<string, PreparedFloat>;
        fonts: FontProvider;
        footnotes: Map<string, PreparedFootnote>;
        math: MathRenderer | null;
        missingFaces: Set<string>;
        missingGlyphs: Set<string>;
        pageOf: ReadonlyMap<string, number>;
        reportedImages: Set<string>;
        reportedMath: Set<string>;
        shaper: Shaper;
    }
    Index
    budget: Budget
    design: PageDesign
    diagnostics: {
        code?:
            | "syntax"
            | "unsupported"
            | "undefined-command"
            | "undefined-environment"
            | "undefined-reference"
            | "duplicate-label"
            | "missing-file"
            | "missing-font"
            | "overfull-box"
            | "underfull-box"
            | "budget-exceeded"
            | "limit-exceeded"
            | "stopped"
            | "internal";
        column?: number;
        construct?: string;
        file: string;
        line: number;
        message: string;
        severity: "error"
        | "warning"
        | "info";
    }[]
    file: string

    The entrypoint, for diagnostics with no better position.

    files: ImageFiles

    The project's files, for \includegraphics. An image is an input like the .tex itself (D38): the engine opens nothing, so the bytes have to be handed in. Empty when a caller lays out without them, which every image then reports as a missing file rather than guessing a size.

    floats: Map<string, PreparedFloat>

    Floats discovered while building, keyed by the marker that rides in the vertical list where the author wrote them — the same mechanism as footnotes above, which is why deferring a float needs no new node kind. layout/page.ts is what reads this.

    footnotes: Map<string, PreparedFootnote>

    Footnotes discovered while building, keyed by the marker that carries them.

    math: MathRenderer | null

    The math renderer, or null when the caller supplied none. Injected for the same reason fonts is — createMathRenderer() is async and the engine is synchronous, and the engine acquires nothing for itself (D38). A math-free document never touches it; a document with math and no renderer gets a diagnostic rather than a silently empty page (layout/math.ts).

    missingFaces: Set<string>

    Faces already reported as missing, so one absent face is one diagnostic.

    missingGlyphs: Set<string>

    font id + codepoint pairs already reported missing, so one is one diagnostic.

    pageOf: ReadonlyMap<string, number>

    marker name → page, from the previous layout pass. Empty on the first pass, which is why a first-pass table of contents reads ??.

    reportedImages: Set<string>

    Image paths already reported as unusable, so one bad file is one diagnostic.

    reportedMath: Set<string>

    Math failures already reported once for the whole document — today just the absent renderer, which would otherwise repeat itself per formula. Same mechanism as missingFaces and reportedImages.

    shaper: Shaper

    One shaper for the whole document — including across layout passes. Line breaking re-measures constantly and the font layer has no cache of its own.