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: math480-2016
Views: 3174% this is a comment -- it is a line starting in %12% the pre-eamble is everything from \documentclass to \begin{document}3\documentclass[12pt]{article} % the 12pt makes the font bigger4\title{Math 480: Lectures 11 -- Latex (2 of 3)} % document title5\author{William Stein} % who wrote this6\date{April 20, 2016}78\usepackage{amssymb}910\usepackage{hyperref} % make it so there is a \url{} command and links work (in pdf!)1112% include support for putting pdf's and png's in our file13\usepackage{graphicx}1415% Package for the "newtheorem" command16\usepackage{amsthm}17\newtheorem{exercise}{Exercise}[section] % exercise environment1819\begin{document}20% this is the body of the document2122% This is a command that says: "put the title block here".23% Try copying this command and putting it somewhere else and get multiple titles24\maketitle2526\tableofcontents2728% Use \section{...} to make a new section.29\section*{Reminders\label{reminders}}3031{\bf Some reminders:} % md the {\bf ...} makes it bold3233\begin{enumerate}34\item Start screencast!35\item You should open {\tt lectures/2016-04-20/2016-04-20.tex} in your project36\item \label{reminder-homework} Homework and peer grading due Friday at 6pm. (Questions?)37\end{enumerate}3839\section{Math formulas}40\LaTeX is massively different than Microsoft Word. You focus41entirely on the content and structure of what you are42writing, not on how it looks. Also, the result is much more43professional looking. And you can define functions, e.g.,4445\newcommand{\hello}[1]{Hello #1, hello #1 !! }4647\hello{World} - I say \hello{to you}!4849\subsection{Some basics}50Google ``latex symbols''\footnote{Look in the tex file for how I did those quotes and this footnote.} for tables giving how to typeset51interesting symbols, like this:52$$53\varphi, \Xi, \partial, \hookleftarrow, \bigoplus54$$5556Consider $\varphi + \Xi^3$.5758Top hit (and I'm having dinner with them on Friday):\\ \url{https://www.artofproblemsolving.com/wiki/index.php/LaTeX:Symbols}5960This webpage explains a lot of math typesetting. Here's61some key things:62\begin{itemize}63\item Braces: $\{ x : x \in \mathbb{Q}\}$64\item Powers: $x^{2+3}$, $x^2+3$, $x^(2+3)$65\item Subscripts: $x_2, x_5, x_{2+3}$66\item Both: $x^{2+3}_{5}$67\item A fraction: $\frac{2+3 \hello{10}}{5}$68\item An integral: $\int_0^{\pi+e^i} \sin(x) dx$69\item A ``displayed'' integral: $$\int_0^{\pi} \sin(x) dx$$70\end{itemize}7172\url{http://detexify.kirelabs.org/classify.html}7374\subsection{Using Sage}7576Given any object {\tt obj} in a Sage worksheet you77can (try to) do {\tt latex(obj)} to see how to typeset78obj. You already learned about sagetex, which uses79this under the hood, on Monday.8081$$82x + \frac{1}{6} x^{3} + {(-\frac{1}{40})} x^{5} + {(-\frac{55}{1008})} x^{7} + \mathcal{O}\left(x^{8}\right)83$$8485$$86\displaystyle \left(\begin{array}{rrr}871 & -2 & \frac{1}{2} \\881 & 0 & 0 \\89-2 & 0 & 190\end{array}\right)91$$9293\begin{exercise}94Use Sage to find a latex formula for the first few terms95of the Taylor series of $\tan(x)$ about96zero.\footnote{Hint: use {\tt latex(tan(x).series(x, 10))} in a worksheet, then copy/paste.}97\end{exercise}9899$$100your series here!101$$102103104\begin{exercise}105Use Sage to Find a latex formula for a matrix using Sage. Use the command {\tt matrix} to make a matrix.106\end{exercise}107108$$109your matrix here!110$$111112113114115\subsection{Use Some random webpage}116117If you do a Google search for {\tt latex formula editor}118you'll find (many) kind-of-ugly websites with119various programs that120let you graphically construct an equation, which show121you the latex code.122123This is an unusual new demo, where they use machine learning124to recognize handwriting (it is pretty impressive):\\125\url{http://webdemo.myscript.com/#/demo/equation}126127$$128\frac{\Omega +\alpha ^{3}} {2}129$$130131\section{Sectioning and cross referencing\label{a-label}}132This is Section \ref{a-label}. The next section is Section \ref{graphics}.133You can reference anything, e.g., reminder \ref{reminder-homework}134from Section \ref{reminders}.135136\begin{exercise}137Try reordering the enumerate list above in some random way and or the sections138(or adding new ones), then recompile and see all the cross reference numbers139get updated.140\end{exercise}141142143\section{Including graphics\label{graphics}}144145You can take any pdf, png, or jpg file, put it in the146same directory as your tex file (+New, drag and drop),147and display them as follows:148149\begin{center} % this centers it150\includegraphics[width=.6\textwidth]{svr.jpg}151\end{center}152153\hello{\includegraphics[width=.1\textwidth]{svr.jpg}}154155$$x^{\includegraphics[width=.1\textwidth]{a.pdf}} + 1$$156157\begin{exercise}158Upload and insert an image of your choice below. It must159be png or pdf.160\end{exercise}161162% Copy paste the includegraphics thing above here, change163% the name from image to the name of your file:164165166167Sage can also produce pdf's of plots.168E.g., if {\tt g = plot(sin) + plot(cos)}, then169{\tt g.save('a.pdf')} will create a file {\tt a.pdf}170that you can include. This is a little more tedious171than Sagetex, but you have more control.172173\begin{exercise}174Create a plot and save it to a file175as above in a Sage worksheet, then include it below:176\end{exercise}177178% Copy paste the includegraphics thing above here, change179% the name from image to the name of your file:180181182183184\end{document}185186187