Skip to content


Harald Schilly edited this page Apr 3, 2017 · 2 revisions

Getting Started with CoCalc


After signing up you have an account. It consists of your name, password, and email address. You can change your name or email address any time.

The primary purpose of providing an email address is that you can use it to reset your password when you forget it.


Computational Documents

To get started, you need to create computational documents in your project: open the "+ New" tab in your project, enter a filename like foo and click on "Sage Worksheet" or "Jupyter Notebook".

Sage Worksheets

Using SageMath

In a "Sage Worksheet", "SageMath" is the default evaluator.

Using R in a Sage Worksheet

In the Sage Worksheet that appears, type

%default_mode r
then press shift+enter to evaluate it. For the rest of the worksheet, type normal R commands, followed by shift+enter. Plotting should just work as usual in R. See these example worksheets.

Using Python

In the Sage Worksheet that appears, type

%default_mode python3
then press shift+enter to evaluate it. This starts up the Anaconda Python environment with many pre-installed libraries and makes it the default for evaluating cells.

Jupyter Notebooks

In a project, click "+New" then the "Jupyter" button, or just open an ipynb file. The notebook will be opened using Jupyter's html-based client, with support for embedded graphics. To support the collaborative nature of CoCalc we've enhanced the Jupyter notebook with realtime sync, so if you open the same notebook on multiple computers (or if multiple people open the same notebook), they will stay in sync. Also, if you want to use the Sage preparser, type %load_ext sage into a notebook cell.

Technical Notes

  • You can also run a normal version of the Jupyter notebook server (no sync, not integrated into cloud) by (1) finding your project id in project settings, then (2) visiting `{BASE_URL}/[project_id]/port/jupyter` (you will possibly have to refresh your browser if this takes too long the first time). Any collaborator on your project can securely use the Jupyter notebook server by visiting this link, but nobody else can.


LaTeX is a system for creating professional quality documents, with excellent support for typesetting mathematical formulas like:

$J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}$
is rendered as

There are two main ways to use LaTeX in CoCalc:

  1. In chats or in CoCalc Worksheet cells that start with `%html` or `%md`, enclose mathematical formulas in single or double dollar signs and they will be typeset (using MathJax) when you submit them. In addition to dollar signs, you can use the other standard latex equation wrappers `\[ \]` and `\( \)`. In CoCalc Worksheets, if `f` is some mathematical object, you can type `show(f)` to see `f` nicely typeset using the latex generated by `latex(f)`. In a worksheet, type `typeset_mode(True)` to show the nicely typeset version of objects by default. You may also use MathJax in Markdown cells in Jupyter notebooks.
  2. You can edit a full LaTeX document by creating or uploading a file with an extension of .tex, then opening it. The tex file appears on the left, and there is a preview of the compiled version on the right, which is updated whenever you save the file (ctrl+s). You can also use inverse and forward search to easily move back and forth between the tex file and the preview. In addition to the preview, there is an error and warning log with buttons to jump to the corresponding issue in the tex file or preview. There is also a button to show or download the final high-quality PDF. In addition, you can see the output of running pdflatex, bibtex, and use SageTex (which should "just work"). If necessary, you can do extremely sophisticated processing of tex files in a Terminal (+New → Terminal), too.


Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.