"Leonardo da Vinci was of the few great artists to leave a large quantity of writings; large and small notebooks, pocket books, and separate sheets. They were written in Leonardo's famous mirror-image script, with his left hand. All were left to Francesco Melzi, Leonardo's pupil, friend, and heir, who began the frustrating job of editing the jumble of notes with the aim of publishing them.
Melzi's first and only, project (c. 1550) was to compile a treatise on painting, the Trattato, which he never finished, and after Melzi died in 1570 Leonardo's original manuscripts were soon dispersed. Some given away, some stolen, some lost, some sold. Some were cut up for their drawings. Martin Kemp estimates that about three quarters of Leonardo's manuscripts are lost.
Melzi's unfinished manuscript for the Trattato found its way to the Urbino Library of Federigo da Montefeltro in 1472 ... After Federigo's death the contents of his library wound up in the Vatican Library under the name Codex Urbinas Latinus 1270, or simply the Codex Urbinas where it lay forgotten until 1817, when Guglielmo Manzi had it published."
This and more about Leonardo's work in the 'Leonardo' section of Geometry in Art & Architecture by Paul Calter.