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

    Interface FloatContext

    What prepareFloat needs beyond the block. The two callbacks hand over vlist.ts's block and inline setting as capabilities, so this file needs none of its internals — see TableContext in table.ts for the same shape and the same reason (a mutual import would be a real cycle).

    interface FloatContext {
        bodySize: FontSize;
        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;
        measure: number;
        shaper: Shaper;
        size: number;
        setBlocks(blocks: readonly Block[], measure: number): VList;
        setInlines(inlines: readonly Inline[], size: number, at: SourceRef): HList;
    }

    Hierarchy (View Summary)

    Index
    bodySize: FontSize

    The type size in force. A caption is set at \normalsize in article.

    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";
    }[]

    Where diagnostics go. Appended to, never replaced.

    file: string

    The entrypoint, for a diagnostic with no better position than the document.

    measure: number

    The measure a float's content may occupy — \textwidth for a full-width float.

    shaper: Shaper
    size: number

    The type size in force, for an em/ex length.

    • Set a list of blocks as vertical material at measure, using the vertical list's own block layout — the way a float's content (paragraphs, a tabular, an \includegraphics) gets set without this file re-deriving page design.

      CaptionBlocks never reach it: prepareFloat sets captions itself and splits the float's content around them (see setCaption), which is the second of the two designs chunk 39.1 offered. It was chosen because \@makecaption centres a one-line caption and only line-breaks a longer one — a decision that has to be taken after measuring the caption, which is a thing this file can do with setInlines and a thing the block dispatcher, which only ever hands back a finished vertical list, cannot. Filling in vlist.ts's case "caption" arm would have meant either losing the centring or growing a second capability on this context.

      Parameters

      • blocks: readonly Block[]
      • measure: number

      Returns VList