Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Examples of using latex in cocalc

1858 views
% This file was *autogenerated* from sagetex.sagetex.sage with
 % sagetex.py version 2015/08/26 v3.0-92d9f7a
sage: 1+1
2
sage: is_prime(57)
False
sage: if is_prime(57):
....:     print 'prime'
....: else:
....:     print 'composite'
sage: x = 2010; len(x.divisors())
sage: print 'Hola, mundo!'
sage: l = matrix([[1,0,0],[3/5,1,0],[-2/5,-2,1]])
sage: d = diagonal_matrix([15, -1, 4]) #@\label{diagonal}
sage: u = matrix([[1,0,1/3],[0,1,2],[0,0,1]]) #@\label{anotherlabel} \# foo
sage: l*d*u   # this is a comment
[15  0  5]
[ 9 -1  1]
[-6  2  6]
sage: l*d*u
sage: x = var('x')
sage: (1-cos(x)^2).trig_simplify()
sage: pi.n(100)
3.1415926535897932384626433833
sage: plot(sin(x), (x, 0, 2*pi))
Graphics object consisting of 1 graphics primitive
sage: factor(x^2 + 2*x + 1)
(x + 1)^2
%f9fcb91765cf03a33c58a31198f26bad% md5sum of corresponding .sage file (minus "goboom", "current_tex_line", and pause/unpause lines)