A Beginner s guide to L A TEX for CSCA67/MATA67. Kohilan Mohanarajan

Similar documents
Using L A TEX Tom Edgar

Become a L A TEX Guru

Guide to using L A TEX

Assessments for CS students:

Useful L A TEX Commands

L A TEX. The Logo. Introduction to L A TEX. Overview. Primary Benefits. Kinds of Documents. Bill Slough and Andrew Mertz

Math 235: Introduction to LaTeX

Introduction to L A TEX

A Brief Introduction to L A TEX

LaTeX A Tutorial. Mohsen Alimomeni, 2010

CSE 150: Notation Examples

Basics. Options. Commands

Learning LaTeX: The Basics

Formatting with LaTeX

Intro to LATEX I. Aaron Erlich POLS/CSSS 510, Why LATEX? Programming Document Structure Floats Tables Lists Math

L A TEX Tutorial. 1 Introduction. 2 Running L A TEX. J. E. Rice. May 2010

L A TEX minicourse. dstowell, mag, sar, scannell,... September Typeset by FoilTEX

Typesetting Text. Spring 2013 TEX-Bit #1 Math 406

An Introduction to LATEX

L A TEXInstallation and Introduction

LAT E X week 2: Basics for Writing a Document

The basics of LaTeX. Cédric Buron. April 25, 2016

Paul Gartside. March 2, 2013

David Helmbold, October 2005, Revised October 2007

Learn how to [learn] LATEX

EBESS and MESS Presents: Learn to LaTeX. Presented by Joshua Tambunan 13 February 2018

A Very Brief Introduction to L A T E X MAT 3535

L A TEX for Psychological Researchers

A Short Introduction to L A TEX

1 Obtaining LyX and L A TEX

A Grasshopper s Approach to L A TEX

L A TEX examples. a b c a b c b b a c b c c b a. This table was typeset with the following commands.

Learning L A TEX. Patrick Lam

Course A, Part 1 Basic Formatting in L A TEX

LaTeX Seminar III: Environments and More Advanced Mathematical Typesetting

Introduction to Latex. A workshop by Dr. Ala Eshmawi

Introduction to L A TEX

Introduzione a LaTex. Fabrizio Messina

simpletex Documentation

A Brief Introduction to LaTeX

Mikkel Madsen

What is LaTeX. Is a document markup language and document preparation system for the TeX typesetting program

How to L A TEX. George Wong, David Mykytyn. 6 October 2016

L A TEX Overview. Jiayi Liu. January 31, Colorado School of Mines

MATLAB for the Sciences

L A TEX Workshop. Don Brower

Introduction to L A TEX

A Beginner s Guide to LATEX. Last Revised: August 21, 2013

Introduction to LaTeX. Christoph Pickl

L A TEX for Psychological Researchers

LATEX Workshop. Yi Liu Chen SUNY Geneseo PRISM Math Club. February 6, Wordmark Reversed Geneseo Wordmark Style Guide 4

Introduction to L A TEX

عمادة البحث العلمي جامعة الملك سعود

LearningLatex. % This file walks you through some basic things with LaTex % Thanks to Patrick Lam and Maya Sen for letting me borrow their materials

A quick guide to L A TEX

An Introduction to LATEX

Getting Started in L A TEX

Getting Funky: Headers, Tables, Abstracts etc.

An introduction to L A TEX for students

L A T E X Tutorial. Wanmin Liu August. Department of Mathematics The Hong Kong University of Science and Technology

The Name of the Game. An Introduction to LATEX. Why L A TEX? The Name of the Game

LATEX TYPESETTING SYSTEM. CAAM 519, CHAPTER 3

COMP496/901: Academic Presentation and Writing Skills Using LaTeX

LaTeX in SLATE. Common Symbols. 1. Subscripts & Superscripts Fractions & Roots. 4. Brackets.. 5. Multiline Formulas.. 6. Matrices..

Introduction to L A TEX

Outline. A Sneak Peek

Introduction to L A TEX

Part - I : Short Course Typing Text

An Introduction to LATEX

An Interactive Introduction to L A TEX

Using L A TEX. A numbered list is just that a collection of items sorted and labeled by number.

The Joys of LAT E X. Vadim Ponomarenko. introducing the world s standard typesetting language.

An Introduction to L A TEX

Writing Mathematics in L A TEX by Example

Getting Started with L A TEX

Introduction to L A TEX

Introduction to LATEX

Introduction to LATEX

An introduction. C.D. Emmery & M.M. van Zaanen. October 22, Tilburg University

LaTeX: Scientific Document Writing

COMS 6100 Class note

Began as TeX, in 1982 (Knuth). Purely a typesetting tool. LaTeX added macros, maintaining TeX as it s typesetting engine (Lamport).

Research Method and Report Writing Lecture 4: An Introduction to L A TEX

Researcher Development Unit: Introduction to Latex

A Short L A TEX Introduction

LATEX Primer. 1 Introduction (Read Me)

L A T E X Workshop. Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian Institute of Technology

Helen Cameron. A Brief Overview of LATEX

Introduction to L A TEX

Latex Tutorial 1 L A TEX. 1.1 Text

Mikkel Madsen

Guide to L A TEX. Daniel M. Kane

Introduction to L A TEX Part II

Helen Cameron. A Brief Overview of LATEX

Typing Mathematics. Darrin Doud

The Joys of L A T E X

L A TEX Introduction. 1 Basic Resources: Melissa Desjarlais (amended by Dr. Dena Morton)

An Interactive Introduction to L A TEX. Part 1: The Basics. John Lees-Miller. writel A TEX

Introduction to L A TEX Part II

Just Enough L A TEX, Week 4

Transcription:

A Beginner s guide to L A TEX for CSCA67/MATA67 Kohilan Mohanarajan August 31, 2017

Contents 1 Foreword 2 2 Getting Started 3 3 Setting up your L A TEXDocument 4 4 Writing your L A TEXDocument 6 4.1 Environments............................... 6 4.2 Math, and its symbols.......................... 6 4.2.1 Equations and Operators.................... 7 4.2.2 Symbols.............................. 8 4.2.3 Writing proofs.......................... 9 4.3 Other useful L A TEXfeatures........................ 9 4.3.1 Making Lists........................... 9 4.3.2 Styling............................... 10 4.3.3 Justification............................ 10 4.3.4 Making Tables.......................... 11 5 Helpful Resources + Afterword 12 1

Chapter 1 Foreword This document references Tobias Oetiker s The Not So Short Introduction to L A TEX 2, which you should refer to if you want to learn more about L A TEX and its capabilities. This document serves to be a verbose starter s guide to writing your own L A TEX Documents with respects to what s needed for CSCA67/MATA67. L A TEX is a wonderful resource that not all students take advantage of, and will help you produce beautiful, wonderfully-formatted documents that give off an air of professionalism. As a TA or Professor marking or looking over your submitted work, having documents made in a basic text editor like Microsoft Office Word or Google Docs tends to be an eyesore. As such, being presented with a L A TEX-formatted document is much nicer in comparison. With L A TEX, you ll have access to a lot of the symbols and structuring you ll need for CSCA67/MATA67. Hopefully, the skills you learn here will carry on into your future both at UTSC, and beyond. 2

Chapter 2 Getting Started This section assumes that you haven t set up your working environment yet. If you have, move onto the Setting up your L A TEX Document There are multiple methods of working on L A TEX Documents. One of the most commonly-used methods is Downloading the L A TEX software from the official project website, and then downloading a L A TEX editor, such as Texmaker. You could also sign up for websites such as Overleaf or ShareLaTeX, which offers all the amenities of L A TEX without having to install anything. Once you ve set up your working environment, it s as simple as clicking Create a new document 1 1 Not all L A TEX editors have something that says this verbatim, but you get the idea. 3

Chapter 3 Setting up your LATEX Document There are several things you should consider including in the header of your.tex file when making your document. All L A TEX-formatted documents will have most, if not all of these lines in their headers. These are as follows: 1. \documentclass[11pt]{article} This identifies the document class, as well as the font size for your document. For this example document, we are creating an article with font size 11pt. For a full list of L A TEX classes, you can use this reference. Here are some common document classes: article: The most common document class, and the class that you ll most likely be using for your CSCA67/MATA67 documents. book: Formatting for a book. This, as well as the report class have access to \chapter{}, which works similarly to \section. report: Formatting that works similarly to the book class. slides: Formatting for presentation slides. 2. \usepackage{amsmath, amsfonts, amsthm, amssymb, hyperref} This line details the packages that you ll be using throughout your document. L A TEX offers the ability to import packages to help you construct your document to your liking. For CSCA67/MATA67, you will most definitely need the amsmath, amsfonts, amsthm, and amssymb in order to have access to the mathematical symbols and operators that you ll be encountering in the course. Some other useful packages you might need are: hyperref: This allows you to use Hyperlinks inside of your document. 4

LaTeX Basics CHAPTER 3. SETTING UP YOUR L A TEX DOCUMENT geometry: This allows you to change the page layout, such as margins and page length. graphicx: This allows you to import images into your document. fancyhdr: This allows for headers and footers. color: This allows for color. 3. \title{csca67/mata67 Exercise ##} This is the title of your document. If you use this line, and then the \maketitle line, you can create a title page for your document. 4. \author{joseph Joestar} This line details who the author is. Like \title{}, if used before \maketitle, it will be included on a cover page for your document. 5. \begin{document} This starts your document. Anything written in your document will come after this line, otherwise, it ll be considered part of the header. As with any \begin{} statement, make sure that you include a \end{document} at the very end of your.tex file to signify the end of your document. 6. \tableofcontents This creates an auto-generated table of contents at the beginning of your document. This will automatically recognize any \section{}, \subsection{}, \subsubsection{}, \chapter, and other tags that signify a new section, and include them, omitting you from having to manually create it yourself. 7. \newpage Creates a new page. Useful for page breaks. Once you ve included these lines, you re ready to get going with your document. In the next section, we ll go over formatting and writing your document. 5

Chapter 4 Writing your LATEX Document Now that you ve set up your L A TEX document, it s time to work on it! This section will go over necessary parts of your general L A TEX document that you will need over the course of the next four months. 4.1 Environments A key part of writing a L A TEX document is using environments. Even from the very beginning, you re already wrapping your content in the environment \begin{document} and \end{document}. By wrapping your content in these environments, you can modify attributes, such as margins and justification, but also set your content to be styled in a specific manner. To open and close an environment, you would use the tags \begin{} and \end{}. 4.2 Math, and its symbols 1 2 3 When writing your basic equation, you can write it inline using $1+1=2$, or center it on its own line like this: y = mx + b To do this, you would write your equation within two square brackets : \[y=mx+b] Another way you you could do this is: \begin{equation*} y=mx+b \end{equation*} Note: If we use equation instead of equation*, we can label our equation with a number, which we can refer to later on, like such: y = mx + b (4.1) 6

LaTeX Basics CHAPTER 4. WRITING YOUR L A TEX DOCUMENT To create a multiple-step equation, you would do the following: 4 5 6 7 \begin{eqnarray*} \sum_{i=0}^{3} i &=& 0 + 1 + 2 + 3\\ &=& 6 \end{eqnarray*} While in an equation environment, you will need to use \textrm{sample text} to write normally, otherwise your text will be squishedtogether. For CSC/MATA67, you re going to need an assortment of mathematical symbols as well, which can be written both inline, as well as within an environment. 4.2.1 Equations and Operators Sigma/Summation ( n i=0 ): \sum_{i=0}^{n} Integration ( x2 dx): \int_{-\infty}^{\infty} x^{2} dx Fractions ( x y ): \frac{x}{y} Modulus (a mod b): a \bmod b Equivalence (a b): a \equiv b Square Root ( 4): \sqrt{4} Greater than (3 > 2): 3 > 2 Less than (3 < 4): 3 < 4 Greater than or Equal to (x 2): x \geq 2 Less than or Equal to (x 4): x \leq 4 Logarithms (7 log n): 7 \log n Limits (lim n ): \lim_{n\rightarrow \infty} And (x n): x \land n Or (x n): x \lor n Not ( x): \neg x Implication (x n): x \rightarrow n If and only if (x n): x \leftrightarrow n Logical Implication (x n): x \Rightarrow n 7

LaTeX Basics CHAPTER 4. WRITING YOUR L A TEX DOCUMENT Logical Equivalence (x n): x \Leftrightarrow n In (x N): x \in \mathbb N Not in (x N): x \not \in \mathbb N Subset (x N): x \subseteq \mathbb N For All ( x N): \forall x \in \mathbb N There exists ( x N): \exists x \in \mathbb N Union (x n): x \cup n Intersection (x n): x \cap n 4.2.2 Symbols π: \pi : \emptyset N: \mathbb N R: \mathbb R Q: \mathbb Q Z: \mathbb Z Θ: \Theta : \Delta δ: \delta 8 9 10 11 12 13 14 15 When writing a piecewise function, by typing \begin{equation*} f(n) = \left\{\begin{array}{cl} 0 & \textrm{if } n = 0\\ 1 & \textrm{if } n = 1\\ f(n-1) + f(n-2) &\textrm{if } n\geq 2 \end{array} \right. \end{equation*} you can get 0 if n = 0 f(n) = 1 if n = 1 f(n 1) + f(n 2) if n 2 8

LaTeX Basics CHAPTER 4. WRITING YOUR L A TEX DOCUMENT 4.2.3 Writing proofs When writing proofs, there are certain elements to consider. For instance, if you want to write out a Theorem, including \textsc{theorem} will create a Theorem tag. Do note that for proofs, a proof environment exists. Here s a simple example proof, along with the L A TEX code that makes it: PROVE: For all integers n, if n 2 is odd, then n is odd. Proof. Suppose the contrapositive: For all integers n, if n is even, then n 2 is even. Assume n is even. There exists j in the integers such that n = 2j. Consider n 2 = (2j) 2 = 4j 2. Given that 4 is a multiple of 2, n 2 is even, as wanted. The code behind this proof: 16 17 18 19 20 21 22 23 \begin{proof} Suppose the contrapositive: \begin{center} For all integers $n$, if $n$ is even, then $n^{2}$ is even. \end{center} Assume $n$ is even. There exists $j$ in the integers such that $n = 2j$.\\ Consider $n^{2} = (2j)^{2} = 4j^{2}$. Given that 4 is a multiple of 2, $n^{2}$ is even, as wanted. \end{proof} 4.3 Other useful L A TEX features 4.3.1 Making Lists Creating an unordered list: 24 25 26 \begin{itemize} \item this is an item in the list \end{itemize} this is an item in the list Creating an ordered list: 27 28 29 \begin{enumerate} \item this is an item in the list \end{enumerate} 1. this is an item in the list 9

LaTeX Basics CHAPTER 4. WRITING YOUR L A TEX DOCUMENT Nesting lists: 30 31 32 33 34 35 \begin{itemize} \item this is an item in the list \begin{enumerate} \item this is an item in the nested list \end{enumerate} \end{itemize} this is an item in the list 1. this is an item in the nested list 4.3.2 Styling Bold: \textbf{bold} Italic: \textit{italic} Underline: \underline{underline} Small Caps: \textsc{small Caps} Typewriter: \texttt{typewriter} Captioning: \caption{this is a caption} Note: This is to be used after environments and figures Omitting indents: \noindent Creating new paragraphs: \par Adding horizontal space: \space The L A TEX logo: \LaTeX Footers: \footnote{this is footer text} 4.3.3 Justification Left Justification: 36 37 38 \begin{flushleft} This item is to the left of the page \end{flushleft} 10

LaTeX Basics CHAPTER 4. WRITING YOUR L A TEX DOCUMENT This item is to the left of the page Right Justification: 39 40 41 \begin{flushright} This item is to the right of the page \end{flushright} This item is to the right of the page Centering: 42 43 44 \begin{center} This item is in the center of the page \end{center} 4.3.4 Making Tables Tables are made in environments, like so: This item is in the center of the page 45 46 47 48 49 50 51 \begin{tabular}{ l l c } \hline Column 1 & Column 2 & Column 3\\ \hline 1 & 1 & 1\\ \hline \end{tabular} This creates the following table: Column 1 Column 2 Column 3 1 1 1 The second set of brackets determines the amount of columns, as well as their justification. By including, you can set vertical lines between the columns of the table. For instance, {lr c} will give you three columns, the first being left-justified, the second being right-justified, and the last being centered, with there being a vertical line between the second and third line. Note that without on the outside of your set of columns, your table will not have vertical borders. The tag \hline creates a horizontal line. You will need two \hline at the beginning and end of your table environment if you want your table to have horizontal borders. 11

Chapter 5 Helpful Resources + Afterword Unfortunately, this small guide is not able to cover the multitude of features and capabilities that L A TEX has in store. If you want to know more about L A TEX s features, consider the following resources that may be able to help you: ShareL A TEX s official documentation A L A TEX tutorial module Tobias Oetiker s The Not So Short Introduction to L A TEX 2 If there are any errors in this document, or you have any suggestions, please feel free to contact me at kohilan.mohanarajan@mail.utoronto.ca. Editing this document will only make it more helpful in the future, so any help is much appreciated. 12