Section4.1Sage Cell Calculations¶ permalink
Sage cells are easily inserted into the text with a \(\texttt{sage}\) tag. Within that tag, Sage code is placed within an \(\texttt{input}\). Within the \(\texttt{input}\) tag, line breaks and indentation is maintained. The appeal to these cells is that the reader can edit default text to experiment with the concept that is being introduced.
Here is basic calculation from Chapter 2. It is part of the text, but using an XML id on the paragraph that it is contained in, a link to this cell can be inserted at exercises where similar calculations would need to be done.
Here is a graphic that appears in Chapter 1 of Applied Discrete Structures. Graphics calculations like this can be inserted into source code and through a Python script, the appropriate type of image can be created. For example, svg files are ideally created for html conversion. See Section 4.2 for more on the conversion process.