| Hosted by CoCalc | Download
1
\documentclass{article}
2
\title{Title of Document}
3
\author{Name of Author}
4
\usepackage{sagetex}
5
\usepackage{graphicx}
6
\begin{document}
7
\maketitle
8
9
You can make it so Sage code gets automatically run:
10
$$
11
\int \sin(x)\cos(x) = \sage{integrate(sin(x)*cos(x),x)}.
12
$$
13
14
Also, here is a plot:
15
16
\begin{sagesilent}
17
var('x')
18
f = cos(x)*sin(x)
19
pltf = plot(f,(x,-10,10))
20
\end{sagesilent}
21
\begin{center}
22
\sageplot[scale=.3]{pltf}
23
\end{center}
24
25
And here is an image:
26
\begin{center}
27
\includegraphics[width=.5\textwidth]{screen}
28
\end{center}
29
30
\end{document}
31
32