Skip to content

Math directive output overflows the content area, is clipped in tabs, and renders twice #4375

Open

Description

@georgewallace

What happened?

Block math ({math} directive) renders incorrectly on the published page https://www.elastic.co/docs/deploy-manage/production-guidance/optimize-performance/approximate-knn-search:

  1. Overflow outside the content column. In "Total disk per replica", the rendered equation is wider than the content column and spills over the right-hand "On this page" sidebar, overlapping the sidebar links.
  2. Cut off inside a tab. In "Index structure in RAM" (HNSW tab), the long estimated bytes = (1,000,000 × 4 × 16) + ... = 64,000,000 + 4,09... equation is clipped at the container edge with no way to scroll to the rest.
  3. Duplicated output. Each equation appears to render twice in a row. For example, total disk = raw vector bytes + quantized disk + index structure bytes is followed immediately by the same text in plain form (total disk = raw vector bytes + ...), and HNSW RAM = num_vectors × 4 × m is followed by HNSW RAM = num_vectors × 4 × m again. This looks like the raw source or an accessible fallback is shown alongside the rendered math (it also contributes to the width problem).

Expected: long equations stay within the content area (for example, overflow-x: auto on the math block so it scrolls horizontally, or wrapping), and each equation renders once.

Screenshots (attached by the reporter in a comment): overflow into "On this page" sidebar, and clipped equation in the HNSW tab.

How can we reproduce it?

Open the page above and scroll to "Total disk per replica" and to the "Index structure in RAM" tabs (HNSW tab). Any sufficiently long {math} block (in a tab or in the main content) should reproduce it at typical desktop widths.

Version or commit

Production docs site as of 2026-10-08.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions