Traditionally, mathematical work is presented in a linear fashion. Books, papers and articles are single streams of text meant to be read sequentially, from beginning to end.
However, mathematical content often has a not-so-linear underlying structure. Sometimes it can be imagined to be tree-like, with nodes being results and directed edges being dependencies.
Question
Is there a format for presenting maths that is faithful to some underlying logical structure of the work? The 'logical structure' could be defined by the author. Using digital devices, we are obviously not restricted to linear text anymore.
Have you seen such an 'untraditional' format being used?
Prototype
Imagine a PDF-viewer that can collapse and expand certain blocks of texts, as defined by the author and with the possibility of nesting.
In proofs there are often steps which are very unclear to some readers and trivial to others. These steps could get elaborated on in an expandable block -- providing the necessary details for the people who want it while maintaining reading flow and brevity for the others.
Using layers in LaTeX something similar can be achieved as described in this question