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
I toyed with the idea during my PhD, and spend quite a lot of time on the searching for the best type of solution.
To me this essentially changing from writing a personal (or shared) wiki rather than a pdf document. There are many tools for it.
During my PhD, I used tiddlywiki for this https://tiddlywiki.com/. It is very friendly, can compile latex with either latex or mathjax. I used this to organise my notes during qualification exam. It allows for collapsing and so on. But it has its own little problems.
Nowadays, I use vimwiki, which is a vim plugin, just because of convenience and speed.