• write your document in .rst format (same format as Sage documentation and thematic tutorials, and it is pure text, good for versionning)
• compile into static pdf with rst2latex followed by pdflatex (for printing)
• compile into live jupyter notebook with rst2ipynb (for interacting with the computation cells)
Regarding edition, i use a text editor (vim), but if you like to see the rendering on the fly, you can use .rst editors like retext.