Scroll Position Drifts on Theme Change

Symptom

When switching themes (e.g., from System to Paper), the document scroll position shifts slightly. This is more noticeable on documents with many math equations.

Cause

Each theme uses different fonts and spacing, which changes the height of every element. Markant rebuilds the entire attributed string when you switch themes. While it preserves scroll position using a character-index anchor, the pixel offset can drift when:

  • Math equations render at a different height in the new theme
  • Code blocks have different line spacing
  • The content width changes (narrow vs. wide)

Workaround

After switching themes, use ⌘F to search for nearby text, or click a heading in the sidebar to re-anchor your position.

Status

This is a known issue. A future update will improve the scroll anchor precision for math-heavy documents.

Download this article Markdown (.md) MarkBook (.mkb)

Last updated: 2026-04-14