answered 7 years ago
Solution 1: sagetex. This is to embbed Sage computation in a LaTeX document.
Solution 2: pretext. This is much more general and designed to write books. It can be used to produce LaTeX but also html pages with embbeded Sage cells.