CoCalc Tutorial
A tutorial for anyone wanting to use CoCalc, especially for teaching

Other useful features and tricks

In this section we will present some CoCalc features and useful tricks that will make the management of your project easier.

Text fields generally support markdown and LaTeX

CoCalc not only facilitates the creation of LaTex documents, but the multiple text sections in CoCalc support and render LaTex and markdown (specifically GitHub Flavored Markdown).

For example, you can use LaTex syntax in the chat rooms:

before image

which renders as

after image

Making multiple assignment folders quickly

So far we have shown how to create folders and files by using the New button every time. ->New Button

However, such a method could be quite time consuming when you need to create multiple folders, subfolders, and documents. If you are a terminal fan you could create a shell script in your preferred programming language and run it from the terminal.

Alternatively, in the files menu of your project, you can enter paths such as assignments/assignment1/ then hit enter or ctrl+enter to create inside the folder assignment1 within assignments. Hitting enter will open up the new file while ctrl+enter will silently create the necessary files and folders in the path.

search bar file creation

You can also create folders here just by ending with a /

search bar folder creation

Starting up everyone’s project before class

By default, projects have an idle time of 24 hours before they spin down and need to be restarted. However, it may be handy to start everyone’s project before a class or presentation so that they are all “hot loaded”.

You can easily do this from your course manager: first, make sure you are in your course settings and not your project settings.

course settings

Then scroll down to find and click on the Start all... button

after click

Restarting a project

Every time you open a Jupyter notebook or a Sage Worksheet, its state is stored in memory. This can become quite costly if you open multiple files one after the other (e.g. when you are marking your students’ work).

To solve this you can stop every instance using the stop button (for both Jupyter notebooks and Sage worksheets) once you are done with your marking.

Stop notebook

Alternatively, you can restart the entire project, which will clean everything. You just need to go to your project settings and click on Restart project.

Restart project

Using Git

As CoCalc supports the usage of terminal people can collaborate using Git within a course-affiliated project.

If you already have a project or some files allocated in GitHub you can add them to your project. Click on the New button and add/paste the link to your repository in the appropriate text box. Click on the Download from Internet button.

Download from Internet

(Obvious note: You need to have internet access enabled in your project.)

Also you can use the terminal to commit and push changes to your repository in GitHub.

Time Travel Diffs

The editor based documents (e.g. python code, sage worksheets, LaTex documents, etc.) as well as the Jupyter notebooks and Sage worksheets are Time Travel Diffs supported. The Time Travel Diffs feature allows you to see what happened with a file within a certain time interval.

Open up Time travel from any document:

Time travel

then click on changes and drag the sliders to see the document in a given time interval.

TT sliders

If you need to revert the document to a previous state, just drag the sliders to the desired interval and click on Revert live version to this, this will revert the document to that specific version and discard any modifications made afterwards.