UTMOST Sage Cell Repository

Welcome to the UTMOST Sage Cell Repository. The repository is part of the Undergraduate Teaching in Mathematics with Open Software and Textbooks project (UTMOST), which is sponsored by the National Science Foundation. UTMOST is investigating how students and faculty actually use textbooks in undergraduate mathematics courses and using this understanding to produce textbooks that are more effective in promoting student learning. The major components of the project involve education research, resource development, dissemination, and evaluation.

One component of UTMOST is the Sage Cell Repository. The repository is a highly structured catalog of reusable Sage cells that can be easily embedded into online documents. Each Sage cell is tagged with important attributes to make it easy for instructors, authors, and anyone using Sage to find examples of Sage code appropriate for their needs. The Sage Cell Repository is being jointly developed with the National Science Foundation sponsored project Curated Courses (https://curatedcourses.org).

What is a Sage cell?

A Sage cell is a web interface to the free open-source mathematics software system Sage. A Sage cell looks like this.

Once you have clicked on “Evaluate” to execute the Sage commands, you will see a “Share” button. If you click on the “Share,” you will receive a permanent link to your Sage cell. You can also edit the contents of a Sage cell. Try entering and evaluating the following Sage commands:

plot(sin(x), (x, -10,10))

If you make a mistake, you can reload your web page, and the original Sage command(s) will appear.

Embedding into a webpage

Embedding a Sage cell into a webpage is straightforward:

  • Include the following HTML at the top of the webpage (optionally replacing sagecell.sagemath.org with the name of your server). The second line makes it so that any element with a class of sage will turn into a Sage cell.
<script src="https://sagecell.sagemath.org/static/embedded_sagecell.js"></script>
<script>sagecell.makeSagecell({"inputLocation": ".sage"});</script>

If you are embedding into a webpage with lots of styling (like a blog, or a deck.js presentation), there might be conflicts between the page styling and the styles for the Sage cell. If you notice that the Sage cell is not looking normal, you might also include the following code after the above in order to fix the Sage cell styles.

<link rel="stylesheet" type="text/css" href="https://sagecell.sagemath.org/static/sagecell_embed.css">
  • Include code in the body of the page. The code is wrapped in <script> tags so that it is not treated as HTML.
<div class="sage">
  <script type="text/x-sage">1+2</script>

For more information about embedding Sage cells see https://sagecell.sagemath.org/static/about.html?v=076b8b4093fa6a45a81e291c7e2b8fb7

Topics Index

Find a Sage cell by topic; e.g. calculus, linear algebra, statistics.

Commands Index

Find a Sage cell by command; e.g. two-dimensional plotting, matrices, calculus commands.

How to contribute to the repository

Look here to contribute to the Sage cell repository.

Where to get more information about Sage and Sage cells

To find out more about Sage, see http://www.sagemath.org. To find out more about the Sage cell server, see https://sagecell.sagemath.org.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License