Most interactive textbooks are crap. It’s not clear to me what would be a better electronic textbook, and it likely depends entirely on the intended audience: an introductory text needs different features from a graduate-level book intended as a reference. Nonetheless, I may speculate wildly about a web-based interactive book.

- Extensive cross-referencing. Full text search is not a substitute for good indexing and referencing. I should be able to find the definition of a term, the statement of a theorem, or a particular example or homework problem, with just a quick search. I suggest a
*contextual index*: tag terms that belong in the index, much as you would in a LaTeX document, but have the indexer be context-aware, so that the index entry for the Dominated Convergence Theorem looks something like this:- dominated convergence theorem. Definition, section 3.2.
*See*examples 3.2.4, 3.2.7, 3.2.8, problems 3.17 - 3.24.*See also*monotone convergence theorem.

with hyperlinks to everything, of course. (Presumably a viewer could offer popups showing the example excerpts and such.)

- dominated convergence theorem. Definition, section 3.2.
Full text search taking advantage of the cross-referencing.

Hyperlinked notation. Advanced books tend to define all sorts of notation for convergence in distribution, expectation with respect to certain measures, sigma algebras, etc. etc. If we offer a mechanism to define math macros – e.g. I could define

`\convd`

for convergence in distribution – we could have the system automatically hyperlink the use of these symbols to their definition, or some sort of notation table. This might mean using a custom language for math, instead of LaTeX syntax.Embedded code in R or whatever relevant language, with output included, in the style of R Markdown. Tools for including values from code in text, so code can be used to derive values used in the text.

Hyperlinked code, in the style of the Racket documentation, in which each function call is automatically linked to the function documentation, as well as being syntax-highlighted.

Domain-specific languages and tools for things like drawing causal diagrams, generating probability tables, generating boilerplate code for certain tasks, etc.

Explorable interactive text, like Tangle or Idyll, so problems and examples can be defined to let the user play with input values and see the results. (This might be tricky to implement; if values are calculated in embedded R, how do we implement that in-browser when the user manipulates the values?)

Automatic cross-referencing, in the style of LaTeX’s

`\ref`

or`\cleveref`

. Maybe the indexer could take advantage of this information in some clever way, or the reference target could include a back-reference in the margin pointing to the sections that reference it.Built-in plotting and diagram drawing, via R or TikZ (or whatever favored languages you might have – should be extensible).

Automatic bibliography management via something imitating BibTeX. (Naturally, there should be back-references to where references are used.)

Good ways of writing proofs, in the style of Lamport’s 21st Century Proof. (See Writing proofs.)

See also Scientific typesetting.

LaTeX isn’t suited for the Web. Pollen is an extensible option, given enough willingness to write Racket; Sphinx could perhaps be adapted with enough hacking. MathBook XML is interesting, but I’m not enthused about writing in XML; worth investigating to see whether it’s capable of supporting the features I want, since perhaps writing XML is preferable to reinventing an entire system from scratch.

- Immersive Linear Algebra, which uses JavaScript-based interactive animations for pretty much every figure in the book. There’s also good use of hyperlinking and cross-referencing: definitions of common terms appear as pop-ups upon hovering over the terms, and referenced equations have both links to context and popups giving the equation itself, so you don’t have to flip back and forth between pages just to see the equation. The book isn’t yet complete, and I think needs some editing and improvement, but the implementation is innovative.