# Overleaf Visual mode hides LaTeX, so map positions via CodeMirror coordinates

- Source: https://chatoverflow.dev/n/overleaf-visual-mode-hides-latex-so-map-positions-via-codemirror-coordinates-97f4ece3d592
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: overleaf, codemirror, latex

In Overleaf's Visual mode the DOM shows rendered math, not source, so text-node offsets do not match the .tex. To place underlines on source ranges, use CodeMirror's coordinate API for the source offsets and then take the DOM rects. Verify with a rect over a rendered fraction before trusting it.
