<<

TUGboat, Volume 0 (9999), No. 0 preliminary draft, February 16, 2017 9:03 ? 1

SageMathCloud for Collaborative Document on it, then collect it later, grade it, and return Editing and Scientific Computing it. Hal Snyder Multiple Cursors for Each User If a user cre- ates multiple cursors using command- or alt- Abstract click, all cursors are visible to other users. The open-source platform SageMathCloud (SMC) 3 Editing Documents lets users collaborate in real time on scientific com- puting and authoring technical documents with stan- Nothing to Install Because SMC is a cloud ser- vice, there is no software to install locally and dard LATEX tools. This article offers a survey of key features, presenting SMC as a unique, unified plat- projects are reachable from any device with an form for teachers and researchers to be productive internet connection. Files can be compiled on- in today’s mixed software environments and interdis- line to PDF without the need for local installa- A ciplinary problem spaces. tion of LTEX software. Document History and Backups Every edit (at 1 Introduction 2-second resolution) is recorded and stored in- All features of SageMathCloud are available as soon definitely in SMC’s backend database. You can as a free login is created. The following sections offer browse the history using the TimeTravel view, a tour of major features of SMC. which also includes a mode showing exactly what changed between two points in time (and who 2 Collaboration made those changes). Figure 3 shows Time- Travel view comparing two versions of a file. SMC collaboration features apply to both static doc- uments and executable files. Supported file types SMC stores several hundred read-only snap- shots of the complete filesystem state, which include LATEX, , and HTML documents, as well as Sage worksheets, Jupyter notebooks, and users can easily browse. This lets them recover terminal sessions. older versions of files that might not have been edited via the web-editor (e.g., edited by vim or Multiple Users SMC has simultaneous real-time emacs via a terminal). collaboration with no explicit limit on the num- Preview SMC supports online preview, even for ber of simultaneous users. Each user can cus- documents that are 150 or more pages. It pro- tomize the color of their cursor. Figure 1 shows gressively refines the resolution of the preview an example of a second user collaborating during images and nearby pages. One of the SMC de- an edit session. velopers wrote the 2016 Cambridge University Work Through Network Interruptions If your Press book Prime Numbers and the Riemann network connection temporarily fails, you can Hypothesis using SMC [2]. continue editing as long as you want, and your Forward and Inverse Search SMC supports in- changes will be merged into the live document verse search, which means that by double- when you reconnect. clicking on an area on a preview page, the cursor Text and Video Chat SMC has text chat on the in the text editor jumps to the corresponding side of each document. Unlike most other chat location. Similarly, you can jump from a point systems, you can include inline and display in the text editor to the corresponding point in MathJax-compatible LATEX formulas and mark- the preview via forward search. down in the side chat. Users may edit any past Editor User Interface SMC has a full-featured chat message. Other collaborators are notified of text editor for LATEX documents. It has hor- messages via a bell in the upper right. Figure 2 izontal and vertical split view, which lets you shows chat with LATEX beside file views. look at two points in the document simultane- Video chat is available as well by clicking a ously. SMC developers wrote a code folding button in the side chat panel. mode (see https://github.com/codemirror/ Course Management SMC has an integrated CodeMirror/pull/4498), so one can easily tog- course management system, which makes it easy gle display of sections, subsections, etc. Emacs, to fully use LATEX with students in the context Vim, and Sublime keybindings are supported of teaching courses and workshops. For exam- along with many color schemes. ple, you can create a document template with Customizable LATEX Build System SMC fully questions, push it to all students, let them work supports processing very complicated LATEX

preliminary draft, February 16, 2017 9:03 preliminary draft, February 16, 2017 9:03 ? 2 preliminary draft, February 16, 2017 9:03 TUGboat, Volume 0 (9999), No. 0

Figure 1: Editing .tex file, showing cursor of second user Harald.

Figure 2: Editable chat beside file views.

Figure 3: Edit history showing difference between two versions.

preliminary draft, February 16, 2017 9:03 preliminary draft, February 16, 2017 9:03 TUGboat, Volume 0 (9999), No. 0 preliminary draft, February 16, 2017 9:03 ? 3

documents using custom build systems, includ- sheets and Jupyter notebooks, both of which ing several LATEX engines — pdflatex, latexmk, have chat and TimeTravel and support LATEX and xelatex — with most packages preinstalled. mixed with code. Sage worksheets allow users Users can easily request additional packages (by to easily mix different languages and document clicking the help button), or install them them- formats in different cells of a single worksheet. selves in their local projects. The LATEX build Terminal Sessions Any number of text-based ter- command is fully customizable, and can involve minals may be opened to the underlying Ubuntu running arbitrary command sequences, since we , providing access to standard offer a full Linux environment. It is, for example, Linux tools and command-line interfaces to pro- even possible to use GNU make to orchestrate gramming languages. the full compilation via a Makefile. 5 Free and Paid Accounts Dynamic Content Our LATEX editing environ- ment comes with SageTeX, which makes it easy Free accounts provide unlimited projects and collab- to add the output of Python (and SageMath!) orators, with 3GB of disk space per project. SMC computations to any LATEX document. Note charges for a upgrades, including more disk space, that the plots shown in Figure 2 are dynami- CPU power, and outside network access, which makes cally generated using SageTeX commands. The it possible to connect to the Internet from within a figure displays an excerpt from the example file project in order to push and pull data to remote sites for the sagetex package by Dan Drake [1]. (e.g., GitHub). For more about pricing, see https: Besides SageTeX, SMC supports embedding //cloud..com/policies/pricing.html code via knitr into LATEX documents. This technique is popular for generating documents 6 Further Study with statistical and data science content. The best way to learn more about SMC is to create a Spell Checking In addition to normal spell check- free account at https://cloud.sagemath.com and ing, SMC has TEX-aware spell checking. try it out for editing and programming. Other Document Formats Side-by-side editing There is a wealth of tutorial and reference infor- also supports HTML, Markdown, R Markdown, mation at the SMC wiki at https://github.com/ and Sweave formats, all of which support re- sagemathinc/smc/wiki. altime preview and inline and display LATEX. Articles about new features and system inter- Figure 4 shows SMC compiling R Markdown. nals can be found at the SMC blog, http://blog. Autocomplete The keyboard shortcut ctrl-space sagemath.com. Some of the information in this arti- autocompletes common LATEX commands. cle appeared in the SMC blog posting [3]. Source code is on GitHub at https://github. 4 Scientific Computing com/sagemathinc/smc. 4.1 Available Software References Languages SMC includes dozens of programming languages and thousands of libraries and pack- [1] Dan Drake. dandrake/sagetex: embed ages, including computer algebra systems for code, results of computations, and plots theoretical mathematics, scientific packages for from the Sage mathematics software suite physical sciences and bioinformatics, and statis- (http://sagemath.org) into LATEX documents. tical and machine learning software for data sci- https://github.com/dandrake/sagetex, 2017. ence. Here are some of the supported languages: [Online; accessed 2017-02-15]. Python, Sage, R, Julia, , C++, Haskell, Scala. [2] Barry Mazur and William Stein. Prime Num- Packages and Environments Popular packages bers and the Riemann Hypothesis. Cambridge and libraries are provided for each programming University Press, 2016. language. For Python, the entire Anaconda [3] Hal Snyder. SMC for Collaborative LATEX Edit- suite is available. Sage alone includes symbolic ing. http://blog.sagemath.com/latex/2017/ and numeric packages, including NumPy, SciPy, 02/06/smc-for-latex.html, 2017. [Online; ac- matplotlib, Sympy, Maxima, Pari/GP, GAP, R, cessed 2017-02-14]. and Singular. See Figure 5.  Hal Snyder 4.2 Programming Frameworks Sagemath, Inc. Interactive Notebooks In the category of interac- hsnyder (at) sagemath.com tive notebook computing, SMC offers Sage work- https://cloud.sagemath.com/ preliminary draft, February 16, 2017 9:03 preliminary draft, February 16, 2017 9:03 ? 4 preliminary draft, February 16, 2017 9:03 TUGboat, Volume 0 (9999), No. 0

Figure 4: Compiling an R Markdown File in SMC.

Figure 5: Sage worksheet with LATEX in markdown, symbolic expressions, and units of measure.

preliminary draft, February 16, 2017 9:03 preliminary draft, February 16, 2017 9:03