Homework # (Latex Handout) by Laura Parkinson

Similar documents
Homework # You ll want to use some LaTeX editor to edit and compile your.tex files

Guide to using L A TEX

Math 235: Introduction to LaTeX

L A TEX Primer. Randall R. Holmes. August 17, 2018

An Introduction to LATEX

Introduction to MCS 220 and L A TEX

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

LATEX Primer. 1 Introduction (Read Me)

Introduction to Math in LaTeX

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

Latex Tutorial 1 L A TEX. 1.1 Text

Simple Math. Adam Dishaw 2011 September 21. Suppose you want to include some math in your documents. Just follow these basics steps:

Getting Started with L A TEX

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan


1 Obtaining LyX and L A TEX

Getting started with Latex

Meeting One. Aaron Ecay. February 2, 2011

The MathType Window. The picture below shows MathType with all parts of its toolbar visible: Small bar. Tabs. Ruler. Selection.

QUICK EXCEL TUTORIAL. The Very Basics

Learning LaTeX: The Basics

APPM 2460 Matlab Basics

Sets. Sets. Examples. 5 2 {2, 3, 5} 2, 3 2 {2, 3, 5} 1 /2 {2, 3, 5}

How To Get Your Word Document. Ready For Your Editor

Math 395 Homework #1 Due Wednesday, April 12

Welcome Back! Without further delay, let s get started! First Things First. If you haven t done it already, download Turbo Lister from ebay.

1. Welcome. (1) Hello. My name is Dr. Christopher Raridan (Dr. R). (3) In this tutorial I will introduce you to the amsart documentclass.

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.

Outline. Installing LaTeX. Opening TeXShop. Intro to LaTeX. Intro to LaTeX interface Working with text Tabbing and tables Figures Math and equations

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials

Introduction to Counting, Some Basic Principles

Teacher Activity: page 1/9 Mathematical Expressions in Microsoft Word

Introduction to L A TEX for MCS-236

Getting ready for L A TEX. Alexis Dimitriadis. Version: March 28, 2013

An Interactive Introduction to L A TEX

School of Computer Science CPS109 Course Notes 5 Alexander Ferworn Updated Fall 15

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Control Structures. Code can be purely arithmetic assignments. At some point we will need some kind of control or decision making process to occur

This is the LYX Beamer Template

Getting started with Java

Working with Questions in MathXL for School

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

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

Intro. Scheme Basics. scm> 5 5. scm>

Intro to LaTeX Workshop

DOWNLOAD PDF EXCEL MACRO TO PRINT WORKSHEET TO

NCSU Linguistics Eric Wilbanks & Jeff Mielke. November 21, An open-source typesetting language used for document mark-up

CS390 Principles of Concurrency and Parallelism. Lecture Notes for Lecture #5 2/2/2012. Author: Jared Hall

Getting Started. Excerpted from Hello World! Computer Programming for Kids and Other Beginners

Introduction to L A TEX

L A TEX for Psychological Researchers

Valuable points from Lesson 6 Adobe Flash CS5 Professional Classroom in a Book

Learning L A TEX. Patrick Lam

Pong in Unity a basic Intro

CS1 Lecture 5 Jan. 25, 2019

Professor Peter Cheung EEE, Imperial College

APPM 2460 PLOTTING IN MATLAB

How do I use BatchProcess

Become a L A TEX Guru

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

ADVANCED TECHNIQUES FOR EQUATION EDITOR AND MATHTYPE USERS. Presented by: Bob Mathews Director of Training

5. Control Statements

LaTeX A Tutorial. Mohsen Alimomeni, 2010

Typesetting in wxmaxima

9. MATHEMATICIANS ARE FOND OF COLLECTIONS

Learning to Program with Haiku

Effective Programming Practices for Economists

Java Bytecode (binary file)

1 Different Document Classes

SCHEME 7. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. October 29, 2015

Quiz 1: Functions and Procedures

Lecture 3 - Template and Vectors

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

Hello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications

C++ Reference NYU Digital Electronics Lab Fall 2016

Activity Robot Behaviors and Writing Pseudocode

Summer 2017 Discussion 10: July 25, Introduction. 2 Primitives and Define

Graphing on Excel. Open Excel (2013). The first screen you will see looks like this (it varies slightly, depending on the version):

1. The Joy of TEX. Check out this example!

(Refer Slide Time: 00:26)

CS1 Lecture 4 Jan. 23, 2019

BEGINNER PHP Table of Contents

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

CS113: Lecture 3. Topics: Variables. Data types. Arithmetic and Bitwise Operators. Order of Evaluation

CS 115 Lecture 4. More Python; testing software. Neil Moore

Decision Making in C

Foundations, Reasoning About Algorithms, and Design By Contract CMPSC 122

a b c d a b c d e 5 e 7

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

Get JAVA. I will just tell you what I did (on January 10, 2017). I went to:

Math Day 2 Programming: How to make computers do math for you

Template and Tutorial for Math Modelers

C++ Basics. Lecture 2 COP 3014 Spring January 8, 2018

Civil Engineering Computation

Introduction to Scientific Typesetting Lesson 1: Getting Started

CMSC 201 Spring 2019 Lab 06 Lists

Dynamics and Vibrations Mupad tutorial

Eclipse JWT Java Workflow Tooling. Workflow Editor (WE): Installation and Usage Tutorial

CS Summer 2013

Introduction to C++ General Rules, Conventions and Styles CS 16: Solving Problems with Computers I Lecture #2

Transcription:

1 Latex Homework # (Latex Handout) by Laura Parkinson Latex helps you make your homework pretty. It makes us happy when you use it. The best way to learn is by example, so here are some examples of pretty much everything you ll need for homeworks. You can use this document as a template for your homeworks. For more examples and a great tutorial, go to Latex Guide. For a more extensive, but also great tutorial, go to Longer Latex Guide. 2 How to use this guide You will get the most out of this guide if you open the.tex file that generated it and read the two side by side. The guide was designed to be read this way. The.tex file can be found on the course site, here. 3 Kile Kile is my favorite editor for Latex. You can run it by typing kile into your terminal, or open a.tex file in it by typing kile filename.tex. I find it useful to open Kile and Xpdf side by side. Then when I make the pdf from Kile (by clicking the blue gear with a pdf symbol), I can just type r (for refresh) into Xpdf and see the updated pdf. The pdf will be created in the same folder that your.tex file is in. Two wonderful things about Kile are: All the shortcuts on the left, One button pdf-making. 4 Code Here is an example of putting code in your homework: public static int[] bubblesort(int[] numbers) { boolean swapped = true; for(int i = numbers.length - 1; i > 0 && swapped; i--) { swapped = false; for (int j = 0; j < i; j++) { if (numbers[j] > numbers[j+1]) { int temp = numbers[j];

numbers[j] = numbers[j+1]; numbers[j+1] = temp; swapped = true; return numbers; 5 Lists 1. Enumerate automatically makes appropriate 2. numbers or letters at the start of your 3. list items. 6 Tables a. Itemize uses bullets unless you make labels. This has no label. i. This has a label. (a) Nested lists (b) of the same kind (c) look different Perhaps you would like to put a table in your homework here is how. Note that lll means three left-justified columns, whereas lcr would be a left-justified column, a center-justified column, and a right-justified column. Also, in a table (and in general) double backslash creates a new line. Name Street Number Other random number Anastasia 1441 13577893 Bob 6461 9085653233 If you want lines on your table, just put them there with vertical bars and \hline. Name Street Number Other random number Anastasia 1441 13577893 Bob 6461 9085653233

7 Math To make math things look like math, write them between dollar signs. If you use double dollar signs, then your math goes on its own line with nice spacing. You can write a lot of useful things this way. 7.1 Sums This is a plain old sum: a i = 10 This is a sum with upper and lower bounds: 5 i=1 1i = 5 That s ugly, so here s a prettier version, also with double dollar signs: 23 i=1 a i = 5 If we just want one character, we don t need braces: 8 x i = 5 1 7.2 Fractions (and other math, like logs, exponents, and roots) We can do a similar thing with fractions: 1 5 Here s another version: 1 5 2 log2 (β mod x) Sometimes we get really complicated fractions: ( log 5 x+1 2 5) + δ 12 3 Note: you should use log and mod instead of just typing log and mod. 7.3 Prettier Equations and alignment Align can be used to make your equations line up in nice ways. Note that the syntax is similar to the syntax for tables. It puts your equations in the center of the page and right-justifies them. x + 3 = 5 2x + 30 = 5000 You can use double ampersands to separate multiple equations on one line. x + 3 = 5 y < 1 x = y (1) x + 3 = 5 z 2 (2) In general, putting a * means that your equations won t get numbered.

7.4 Big-O Notation Big-O notation is just written with a big O, as in O(n log n). 7.5 Other random stuff that will be helpful Floors and ceilings: x and x Comparison: {,, >, <, =, Macros: This is in code; I write n log n a lot. { x 1, 2, 3. Special characters: \ (backslash) - escapes, begins macros (tilde) - an unbreakable space (underscore) - subscripts in math mode (they cause errors outside of math mode) ˆ (superscript) - superscripts in math mode (they cause errors outside of math mode) {, (curly brackets) - group commands 8 Images You can also include images, such as this one:

9 Pseudocode Surround your pseudocode with this environment, which will both respect your tabs and line breaks and allow M α h formatting to work. This environment comes with the package /course/cs016/latex/cs016.sty which is included at the top of this file. 10 If you re super fancy Firstly, you can define macros by putting something like this at the top of your homework: \newcommand{\command[# args]{whatever you want using #arg1 #arg2 #argetc Secondly, you can reflect, rotate, and scale text, and anything else: like this! Thirdly, you can include packages by putting this at the top of your homework: \usepackage{package name Lastly, if you look at the CS 16 homeworks and think, I want to do exactly that, there is hope for you! The CS 16 documents use a special file: the path of this file is /course/cs016/bin/cs16.cls. You will need to add /course/cs016/bin to Settings > Configure Kile... > Latex > TEXINPUTS and you will need to replace \documentclass[11pt]{article at the top of your homework with \documentclass{cs16. However, if you want to do this, it s at your own risk: the TAs have been instructed not to help you.