Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Project: JennDiaz_Sage
Views: 364\documentclass{article}12%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%3%4% Hello, this is the start of a LaTeX document5%6% First rule: everything after a percent-sign is a comment.7% It is ignored and does not show up in the final PDF document.8%9% Second rule: everything that starts with a backslash \ is a command.10% This is used for everything!11% * \begin{document} signals where the real meat of the file starts (after the preemble)12% * \section and \subsection structure the document13% * and much more ...14%15% Third rule: In between the commands, or inside the command's arguments in {...} you write text.16% You can make arbitrary single linebreaks, which will not break apart a paragraph.17% Two or more linebreaks signal the start of a new paragraph.18%19% Formulas: LaTeX is most famous for writing formulas. They're inside of $...$ or20% \begin{equation}21% ...22% \end{equation}23% environments.24%25% Why? Well, this might seem overly complex, but in the end it is also very precise.26% You can define exactly what each part of the document should be and LaTeX formats it for you.27%28% Got interested? Here is a link to an online LaTeX book explaining more about all this:29% https://en.wikibooks.org/wiki/LaTeX30%31% Now, skim over the preemble and find the \begin{document} command32%33%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%3435% set font encoding for PDFLaTeX or XeLaTeX36\usepackage{ifxetex}37\ifxetex38\usepackage{fontspec}39\else40\usepackage[T1]{fontenc}41\usepackage[utf8]{inputenc}42\usepackage{lmodern}43\fi4445% used in maketitle46\title{My first \LaTeX{} document}47\author{My Name}4849% Enable SageTeX to run SageMath code right inside this LaTeX file.50% documentation: http://mirrors.ctan.org/macros/latex/contrib/sagetex/sagetexpackage.pdf51\usepackage{sagetex}525354%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55\begin{document}5657\section{First Steps}5859This is a short introduction document to \LaTeX{}.60You write the code on the left hand side of this editor,61while compiled and rendered output shows up on the right hand side.6263Pay attention to any syntax errors!64\LaTeX{} is a programming language and stops compiling and updating the document upon errors.65Any command starts with a backslash.66Watch out for the red "Errors" tab and inspect any problems.6768\subsection{Subsection}6970You can organize your document in sections,71just like this one here is a subsection!7273\subsection{Another one ...}7475Here is \textit{another one},76where the text ``another one'' is formatted italic.7778\textbf{Bold font} is also possible.7980\subsection{Formulas}8182Latex is famous for setting formulas.83This is usually done between dollar signs.84For example: $\int_{x=0}^{\infty} \frac{1}{2 + x^2}\;\mathrm{d}x$.8586\section{SageMath}8788You can also run a couple of computations with Sage and embed the output right here in the document.8990% this line here is an invisble comment91% and the block below some sage code setting x and y but not producing any output.92\begin{sagesilent}93x = var('x')94a = 132878237495b = 239472834762837496\end{sagesilent}9798% Here, we use x and y defined above:99The product of $\sage{a}$ and $\sage{b}$ is \\100$\sage{a*b}$101and its prime factorization: $\sage{factor(a*b)}$.102103It is also possible to create a plot:104105\begin{center}106\sageplot[width=.5\textwidth]{plot(sin(x) * cos(3*x), (x, -10, 10))}107\end{center}108109% this is the last command of the document.110\end{document}111112% Do NOT edit past the last command!113114115116